1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 20:42:21 +02:00

Added 'Reload Settings' and 'Reset UI' to File/Preferences menu

This commit is contained in:
Brian Fiete 2020-08-12 08:48:40 -07:00
parent 14e9f9aa53
commit 0adfbce884
2 changed files with 45 additions and 3 deletions

View file

@ -229,12 +229,14 @@ namespace IDE
Add("Profile", new => gApp.[Friend]DoProfile);
Add("Quick Info", new => gApp.Cmd_QuickInfo);
Add("Reformat Document", new => gApp.Cmd_ReformatDocument);
Add("Reload Settings", new => gApp.ReloadSettings);
Add("Remove All Breakpoints", new => gApp.[Friend]RemoveAllBreakpoints);
Add("Rename Item", new => gApp.Cmd_RenameItem);
Add("Rename Symbol", new => gApp.Cmd_RenameSymbol);
Add("Replace in Document", new => gApp.Cmd_Document__Replace);
Add("Replace in Files", new => gApp.Cmd_Replace);
Add("Report Memory", new => gApp.[Friend]ReportMemory);
Add("Reset UI", new => gApp.ResetUI);
Add("Run All Tests", new () => { gApp.[Friend]RunTests(true, false); });
Add("Run Normal Tests", new () => { gApp.[Friend]RunTests(false, false); });
Add("Run To Cursor", new => gApp.[Friend]RunToCursor);

View file

@ -4595,6 +4595,45 @@ namespace IDE
workspaceProperties.PopupWindow(mMainWindow);
}
[IDECommand]
public void ReloadSettings()
{
delete mSettings;
mSettings = new .();
DeleteAndNullify!(mKeyChordState);
mSettings.Load();
mSettings.Apply();
}
[IDECommand]
public void ResetUI()
{
while (mWindows.Count > 1)
mWindows.Back.Close(true);
void ResetPanel(Widget widget)
{
if (widget.mParent != null)
widget.RemoveSelf();
}
if (!mRunningTestScript)
{
mActiveDocumentsTabbedView = null;
WithStandardPanels(scope (panel) =>
{
ResetPanel(panel);
});
mMainFrame.Reset();
}
mDockingFrame = mMainFrame.mDockingFrame;
CreateDefaultLayout(false);
}
[IDECommand]
public void ShowKeyboardShortcuts()
{
@ -5015,8 +5054,9 @@ namespace IDE
AddMenuItem(subMenu, "Save &As...", "Save As", new => UpdateMenuItem_HasActiveDocument);
AddMenuItem(subMenu, "Save A&ll", "Save All");
let prefMenu = subMenu.AddMenuItem("&Preferences");
//prefMenu.AddMenuItem("&Keyboard Shortcuts", null, new (evt) => { ShowKeyboardShortcuts(); });
AddMenuItem(prefMenu, "&Settings", "Settings");
AddMenuItem(prefMenu, "Reload Settings", "Reload Settings");
AddMenuItem(prefMenu, "Reset UI", "Reset UI");
AddMenuItem(subMenu, "Close Workspace", "Close Workspace", new => UpdateMenuItem_HasWorkspace);
AddMenuItem(subMenu, "E&xit", "Exit");
@ -10538,12 +10578,12 @@ namespace IDE
}
}
public void CreateDefaultLayout()
public void CreateDefaultLayout(bool allowSavedLayout = true)
{
//TODO:
//mConfigName.Set("Dbg");
if ((!mRunningTestScript) && (!mIsFirstRun) && (LoadDefaultLayoutData()))
if ((allowSavedLayout) && (!mRunningTestScript) && (!mIsFirstRun) && (LoadDefaultLayoutData()))
{
return;
}