mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 20:42:21 +02:00
Added safe mode toggle to Preferences menu
This commit is contained in:
parent
d4460f0236
commit
d5642b6558
5 changed files with 27 additions and 6 deletions
|
@ -69,6 +69,12 @@ namespace Beefy.sys
|
|||
Modify(mText, mHotKey, mBitmap, mEnabled, mCheckState, mRadioCheck);
|
||||
}
|
||||
|
||||
public void SetCheckState(int32 checkState)
|
||||
{
|
||||
mCheckState = checkState;
|
||||
Modify(mText, mHotKey, mBitmap, mEnabled, mCheckState, mRadioCheck);
|
||||
}
|
||||
|
||||
public void SetHotKey(StringView hotKey)
|
||||
{
|
||||
if (hotKey.IsNull)
|
||||
|
|
|
@ -10,6 +10,7 @@ namespace Beefy.widgets
|
|||
public interface IMenu
|
||||
{
|
||||
void SetDisabled(bool enable);
|
||||
void SetCheckState(int32 checkState);
|
||||
}
|
||||
|
||||
public interface IMenuContainer
|
||||
|
|
|
@ -616,5 +616,10 @@ namespace Beefy.widgets
|
|||
{
|
||||
mDisabled = disabled;
|
||||
}
|
||||
|
||||
public void SetCheckState(int32 checkState)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -253,6 +253,7 @@ namespace IDE
|
|||
Add("Run Normal Tests", new () => { gApp.[Friend]RunTests(false, false); });
|
||||
Add("Run To Cursor", new => gApp.[Friend]RunToCursor);
|
||||
Add("Run Without Compiling", new => gApp.[Friend]RunWithoutCompiling);
|
||||
Add("Safe Mode Toggle", new () => { gApp.SafeModeToggle(); });
|
||||
Add("Save All", new () => { gApp.SaveAll(); });
|
||||
Add("Save As", new () => { gApp.SaveAs(); });
|
||||
Add("Save File", new => gApp.SaveFile);
|
||||
|
|
|
@ -4895,6 +4895,14 @@ namespace IDE
|
|||
CreateDefaultLayout(false);
|
||||
}
|
||||
|
||||
[IDECommand]
|
||||
public void SafeModeToggle()
|
||||
{
|
||||
mSafeMode = !mSafeMode;
|
||||
mNoResolve = mSafeMode;
|
||||
mWantsBeefClean = true;
|
||||
}
|
||||
|
||||
[IDECommand]
|
||||
public void ShowKeyboardShortcuts()
|
||||
{
|
||||
|
@ -5331,6 +5339,7 @@ namespace IDE
|
|||
AddMenuItem(prefMenu, "&Settings", "Settings");
|
||||
AddMenuItem(prefMenu, "Reload Settings", "Reload Settings");
|
||||
AddMenuItem(prefMenu, "Reset UI", "Reset UI");
|
||||
AddMenuItem(prefMenu, "Safe Mode", "Safe Mode Toggle", new (menu) => { menu.SetCheckState(mSafeMode ? 1 : 0); }, null, true, mSafeMode ? 1 : 0);
|
||||
AddMenuItem(subMenu, "Close Workspace", "Close Workspace", new => UpdateMenuItem_HasWorkspace);
|
||||
AddMenuItem(subMenu, "E&xit", "Exit");
|
||||
|
||||
|
@ -12078,11 +12087,11 @@ namespace IDE
|
|||
if (mErrorsPanel != null)
|
||||
mErrorsPanel.ClearParserErrors(null);
|
||||
|
||||
delete mBfResolveCompiler;
|
||||
delete mBfResolveSystem;
|
||||
delete mBfResolveHelper;
|
||||
delete mBfBuildCompiler;
|
||||
delete mBfBuildSystem;
|
||||
DeleteAndNullify!(mBfResolveCompiler);
|
||||
DeleteAndNullify!(mBfResolveSystem);
|
||||
DeleteAndNullify!(mBfResolveHelper);
|
||||
DeleteAndNullify!(mBfBuildCompiler);
|
||||
DeleteAndNullify!(mBfBuildSystem);
|
||||
|
||||
///
|
||||
mDebugger.FullReportMemory();
|
||||
|
@ -13736,7 +13745,6 @@ namespace IDE
|
|||
[Import("user32.lib"), CLink, CallingConvention(.Stdcall)]
|
||||
public static extern bool MessageBeep(MessageBeepType type);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
static
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue