Skip to content

Commit a2eb769

Browse files
committed
Merge branch 'development' into code_formatter
2 parents 7a9f05b + dbd939d commit a2eb769

File tree

18 files changed

+138
-54
lines changed

18 files changed

+138
-54
lines changed

External/Plugins/FlashConnect/XmlSocket.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ public class XmlSocket
1313
private Socket server;
1414
private Socket client;
1515
private StringBuilder packets;
16-
1716
public event XmlReceivedEventHandler XmlReceived;
1817
public event DataReceivedEventHandler DataReceived;
19-
2018
private readonly String INCORRECT_PKT = TextHelper.GetString("Info.IncorrectPacket");
21-
19+
private readonly String CONNECTION_FAILED = TextHelper.GetString("Info.ConnectionFailed");
20+
2221
public XmlSocket(String address, Int32 port)
2322
{
2423
try
@@ -29,6 +28,11 @@ public XmlSocket(String address, Int32 port)
2928
this.server.Listen(10);
3029
this.server.BeginAccept(new AsyncCallback(this.OnConnectRequest), this.server);
3130
}
31+
catch (SocketException ex)
32+
{
33+
if (ex.ErrorCode == 10048) TraceManager.Add("FlashConnect: " + String.Format(CONNECTION_FAILED, port));
34+
else ErrorManager.ShowError(ex);
35+
}
3236
catch (Exception ex)
3337
{
3438
ErrorManager.ShowError(ex);
@@ -106,10 +110,7 @@ public void OnReceivedData(IAsyncResult result)
106110
String msg = packets.ToString(); packets = null;
107111
if (msg == "<policy-file-request/>\0")
108112
{
109-
String policy = "<cross-domain-policy>"
110-
+ "<site-control permitted-cross-domain-policies=\"master-only\"/>"
111-
+ "<allow-access-from domain=\"*\" to-ports=\"*\" />"
112-
+ "</cross-domain-policy>\0";
113+
String policy = "<cross-domain-policy><site-control permitted-cross-domain-policies=\"master-only\"/><allow-access-from domain=\"*\" to-ports=\"*\" /></cross-domain-policy>\0";
113114
so.Client.Send(Encoding.ASCII.GetBytes(policy));
114115
}
115116
else if (msg.EndsWithOrdinal("</flashconnect>\0")) this.XmlReceived(this, new XmlReceivedEventArgs(msg, so.Client));

External/Plugins/ProjectManager/Projects/MoreProjectPaths.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.IO;
44
using PluginCore.Helpers;
5+
using PluginCore;
56

67
namespace ProjectManager.Projects
78
{
@@ -28,7 +29,7 @@ public static List<String> GetAllProjectDirs()
2829
{
2930
allDirs.AddRange(Directory.GetDirectories(ProjectTemplatesDirectory));
3031
}
31-
if (Directory.Exists(PathHelper.UserProjectsDir))
32+
if (!PluginBase.MainForm.StandaloneMode && Directory.Exists(PathHelper.UserProjectsDir))
3233
{
3334
allDirs.AddRange(Directory.GetDirectories(PathHelper.UserProjectsDir));
3435
}

External/Plugins/ResultsPanel/PluginUI.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,10 @@ public void InitializeContextMenu()
283283

284284
this.copyEntryContextMenuItem.ShortcutKeyDisplayString = DataConverter.KeysToString(PluginMain.CopyEntryKeys);
285285
this.ignoreEntryContextMenuItem.ShortcutKeyDisplayString = DataConverter.KeysToString(PluginMain.IgnoreEntryKeys);
286+
Keys keys = PluginBase.MainForm.GetShortcutItemKeys("ResultsPanel.ShowNextResult");
287+
if (keys != Keys.None) this.nextEntryContextMenuItem.ShortcutKeyDisplayString = DataConverter.KeysToString(keys);
288+
keys = PluginBase.MainForm.GetShortcutItemKeys("ResultsPanel.ShowPrevResult");
289+
if (keys != Keys.None) this.previousEntryContextMenuItem.ShortcutKeyDisplayString = DataConverter.KeysToString(keys);
286290

287291
menu.Items.Add(this.clearEntriesContextMenuItem);
288292
menu.Items.Add(this.copyEntryContextMenuItem);

External/Scripts/InstallHaxeFlixel.cmd

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,24 @@ haxelib run openfl setup
8484
:: Check for errors
8585
if %errorlevel% neq 0 goto :install_error
8686

87+
goto :options_vs
88+
89+
:options_vs
90+
91+
set /p option="Also install free Visual Studio for C++ Windows applications? [y/n] "
92+
if "%option%" == "y" goto :install_vs
93+
if "%option%" == "n" goto :check_flixel
94+
echo Invalid value, try again.
95+
96+
goto :options_vs
97+
98+
:install_vs
99+
100+
lime setup windows
101+
102+
:: Check for errors
103+
if %errorlevel% neq 0 goto :install_error
104+
87105
goto :check_flixel
88106

89107
:check_flixel
@@ -117,7 +135,7 @@ exit -1
117135

118136
:install_error
119137

120-
echo Could not install required Haxelib libraries: openfl or flixel.
138+
echo Could not install the requested tools.
121139
pause
122140
exit -1
123141

External/Scripts/InstallOpenFL.cmd

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,24 @@ haxelib run openfl setup
8484
:: Check for errors
8585
if %errorlevel% neq 0 goto :install_error
8686

87+
goto :options_vs
88+
89+
:options_vs
90+
91+
set /p option="Also install free Visual Studio for C++ Windows applications? [y/n] "
92+
if "%option%" == "y" goto :install_vs
93+
if "%option%" == "n" goto :done
94+
echo Invalid value, try again.
95+
96+
goto :options_vs
97+
98+
:install_vs
99+
100+
lime setup windows
101+
102+
:: Check for errors
103+
if %errorlevel% neq 0 goto :install_error
104+
87105
goto :done
88106

89107
:haxelib_error
@@ -94,7 +112,7 @@ exit -1
94112

95113
:install_error
96114

97-
echo Could not install required Haxelib library: openfl.
115+
echo Could not install the requested tools.
98116
pause
99117
exit -1
100118

External/Tools/AppMan/MainForm.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ private void MainFormHelpButtonClicked(Object sender, CancelEventArgs e)
366366
/// <summary>
367367
/// Save notification files to the notify paths.
368368
/// </summary>
369-
private void NotifyPaths()
369+
private void NotifyPaths(Boolean restart)
370370
{
371371
try
372372
{
@@ -379,7 +379,8 @@ private void NotifyPaths()
379379
if (Directory.Exists(path))
380380
{
381381
String amFile = Path.Combine(path, ".appman");
382-
File.WriteAllText(amFile, "");
382+
if (restart) File.WriteAllText(amFile, "restart");
383+
else File.WriteAllText(amFile, "");
383384
}
384385
}
385386
catch { /* NO ERRORS */ }
@@ -483,7 +484,7 @@ private void DeleteButtonClick(Object sender, EventArgs e)
483484
this.TryDeleteEntryDir(entry);
484485
}
485486
}
486-
this.NotifyPaths();
487+
this.NotifyPaths(false);
487488
}
488489
}
489490
catch (Exception ex)
@@ -969,6 +970,7 @@ private void RunExecutableProcess(String file, Boolean wait)
969970
if (wait)
970971
{
971972
process.WaitForExit();
973+
this.NotifyPaths(true);
972974
}
973975
}
974976
catch (Exception ex)
@@ -1365,7 +1367,7 @@ private void WorkerDoCompleted(Object sender, RunWorkerCompletedEventArgs e)
13651367
Thread.Sleep(100); // Wait for files...
13661368
this.LoadInstalledEntries();
13671369
this.UpdateEntryStates();
1368-
this.NotifyPaths();
1370+
this.NotifyPaths(false);
13691371
}
13701372
else this.RunExecutableProcess(this.tempFile, true);
13711373
if (this.downloadQueue.Count > 0) this.DownloadNextFromQueue();
0 Bytes
Binary file not shown.

FlashDevelop/Dialogs/SettingDialog.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ private void DisableCheckBoxCheck(Object sender, EventArgs e)
547547
}
548548

549549
/// <summary>
550-
/// Restore the selected index - only if a item id hasn't been provided
550+
/// Restore the selected index - only if an item id hasn't been provided
551551
/// </summary>
552552
private void DialogShown(Object sender, EventArgs e)
553553
{
@@ -556,6 +556,7 @@ private void DialogShown(Object sender, EventArgs e)
556556
this.itemListView.SelectedIndices.Add(lastItemIndex);
557557
this.itemListView.EnsureVisible(lastItemIndex);
558558
}
559+
this.filterText.Focus();
559560
}
560561

561562
/// <summary>

FlashDevelop/Installer/Installer.nsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
;--------------------------------
1111

1212
; Define version info
13-
!define VERSION "5.1.1"
13+
!define VERSION "5.2.0"
1414

1515
; Installer details
1616
VIAddVersionKey "CompanyName" "${DIST_COMP}"

FlashDevelop/MainForm.cs

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -728,14 +728,22 @@ private void InitializeConfig()
728728
}
729729

730730
/// <summary>
731-
/// When AppMan is closed, it notifies of changes. Forward notifications.
731+
/// When AppMan installs something it notifies of changes. Forward notifications.
732732
/// </summary>
733733
private void AppManUpdate(Object sender, FileSystemEventArgs e)
734734
{
735735
try
736736
{
737+
737738
NotifyEvent ne = new NotifyEvent(EventType.AppChanges);
738-
EventManager.DispatchEvent(this, ne);
739+
EventManager.DispatchEvent(this, ne); // Notify plugins...
740+
String appMan = Path.Combine(PathHelper.BaseDir, ".appman");
741+
String contents = File.ReadAllText(appMan);
742+
if (contents == "restart")
743+
{
744+
String message = TextHelper.GetString("Info.RequiresRestart");
745+
TraceManager.Add(message);
746+
}
739747
}
740748
catch {} // No errors...
741749
}
@@ -1026,14 +1034,14 @@ private void InitializeComponents()
10261034
this.Font = this.appSettings.DefaultFont;
10271035
this.StartPosition = FormStartPosition.Manual;
10281036
this.Closing += new CancelEventHandler(this.OnMainFormClosing);
1037+
this.FormClosed += new FormClosedEventHandler(this.OnMainFormClosed);
10291038
this.Activated += new EventHandler(this.OnMainFormActivate);
10301039
this.Shown += new EventHandler(this.OnMainFormShow);
10311040
this.Load += new EventHandler(this.OnMainFormLoad);
10321041
this.LocationChanged += new EventHandler(this.OnMainFormLocationChange);
10331042
this.GotFocus += new EventHandler(this.OnMainFormGotFocus);
10341043
this.Resize += new EventHandler(this.OnMainFormResize);
1035-
1036-
ScintillaManager.ConfigurationLoaded += ApplyAllSettings;
1044+
ScintillaManager.ConfigurationLoaded += this.ApplyAllSettings;
10371045
}
10381046

10391047
#endregion
@@ -1208,16 +1216,23 @@ public void OnMainFormClosing(Object sender, System.ComponentModel.CancelEventAr
12081216
PluginServices.DisposePlugins();
12091217
this.KillProcess();
12101218
this.SaveAllSettings();
1211-
/* Restart if requested */
1212-
if (this.restartRequested)
1213-
{
1214-
this.restartRequested = false;
1215-
Application.Restart();
1216-
}
12171219
}
12181220
else this.restartRequested = false;
12191221
}
12201222

1223+
/// <summary>
1224+
/// When form is closed restart if requested.
1225+
/// </summary>
1226+
public void OnMainFormClosed(Object sender, FormClosedEventArgs e)
1227+
{
1228+
if (this.restartRequested)
1229+
{
1230+
this.restartRequested = false;
1231+
Process.Start(Application.ExecutablePath);
1232+
Process.GetCurrentProcess().Kill();
1233+
}
1234+
}
1235+
12211236
/// <summary>
12221237
/// When dock changes, applies the padding to documents
12231238
/// </summary>
@@ -3013,7 +3028,7 @@ public void ExtractZip(Object sender, System.EventArgs e)
30133028
{
30143029
zipLog += "Restart required.\r\n";
30153030
if (!silentInstall) finish += "\n" + restart;
3016-
else TraceManager.AddAsync(finish + "\r\n" + restart);
3031+
else TraceManager.AddAsync(restart);
30173032
}
30183033
String logFile = Path.Combine(PathHelper.BaseDir, "Extensions.log");
30193034
File.AppendAllText(logFile, zipLog + "Done.\r\n\r\n", Encoding.UTF8);
@@ -3098,7 +3113,7 @@ public void RemoveZip(Object sender, System.EventArgs e)
30983113
{
30993114
zipLog += "Restart required.\r\n";
31003115
if (!silentRemove) finish += "\n" + restart;
3101-
else TraceManager.AddAsync(finish + "\r\n" + restart);
3116+
else TraceManager.AddAsync(restart);
31023117
}
31033118
String logFile = Path.Combine(PathHelper.BaseDir, "Extensions.log");
31043119
File.AppendAllText(logFile, zipLog + "Done.\r\n\r\n", Encoding.UTF8);

0 commit comments

Comments
 (0)