Skip to content

Commit 6be0958

Browse files
committed
- FileExplorer crash prevention
- Dock debugger panels together on first run
1 parent 2398a40 commit 6be0958

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

External/Plugins/FileExplorer/PluginUI.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ private Boolean SelectedItemsAreOnlyFiles()
811811
private void RefreshFileView(Object sender, System.EventArgs e)
812812
{
813813
String path = this.selectedPath.Text;
814-
this.PopulateFileView(path);
814+
if (!String.IsNullOrEmpty(path)) this.PopulateFileView(path);
815815
}
816816

817817
/// <summary>

External/Plugins/FlashDebugger/Helpers/PanelsHelper.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using PluginCore;
55
using PluginCore.Localization;
66
using WeifenLuo.WinFormsUI.Docking;
7+
using System.Windows.Forms;
78

89
namespace FlashDebugger
910
{
@@ -66,6 +67,21 @@ public PanelsHelper(PluginMain pluginMain, Image pluginImage)
6667
threadsPanel.Hide();
6768
}
6869

70+
/// <summary>
71+
/// Docks all panels into a group
72+
/// </summary>
73+
public void DockTogether()
74+
{
75+
if (watchPanel!= null && watchPanel.Pane != null)
76+
{
77+
localsPanel.DockTo(watchPanel.Pane, DockStyle.Fill, -1);
78+
stackframePanel.DockTo(watchPanel.Pane, DockStyle.Fill, -1);
79+
immediatePanel.DockTo(watchPanel.Pane, DockStyle.Fill, -1);
80+
threadsPanel.DockTo(watchPanel.Pane, DockStyle.Fill, -1);
81+
breakPointPanel.DockTo(watchPanel.Pane, DockStyle.Fill, -1);
82+
}
83+
}
84+
6985
}
7086

7187
}

External/Plugins/FlashDebugger/PluginMain.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public class PluginMain : IPlugin
2222
private MenusHelper menusHelper;
2323
private String settingFilename;
2424
private Image pluginImage;
25+
private Boolean firstRun = false;
2526

2627
static internal Settings settingObject;
2728
static internal LiveDataTip liveDataTip;
@@ -260,6 +261,7 @@ private void CreateMenuItems()
260261
private void CreatePluginPanel()
261262
{
262263
panelsHelpers = new PanelsHelper(this, pluginImage);
264+
if (this.firstRun) this.panelsHelpers.DockTogether();
263265
}
264266

265267
/// <summary>
@@ -290,7 +292,11 @@ private void AddEventHandlers()
290292
public void LoadSettings()
291293
{
292294
settingObject = new Settings();
293-
if (!File.Exists(this.settingFilename)) SaveSettings();
295+
if (!File.Exists(this.settingFilename))
296+
{
297+
SaveSettings();
298+
firstRun = true;
299+
}
294300
else
295301
{
296302
Object obj = ObjectSerializer.Deserialize(this.settingFilename, settingObject);

0 commit comments

Comments
 (0)