mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-04 15:26:00 +02:00
Improved settings reloading recent file menu item updating
This commit is contained in:
parent
c1f4466dd1
commit
ed444416f0
4 changed files with 27 additions and 9 deletions
|
@ -5189,13 +5189,16 @@ namespace IDE
|
|||
[IDECommand]
|
||||
public void ReloadSettings()
|
||||
{
|
||||
delete mSettings;
|
||||
mSettings = new .();
|
||||
var prevSettings = mSettings;
|
||||
defer delete prevSettings;
|
||||
mSettings = new .(prevSettings);
|
||||
|
||||
DeleteAndNullify!(mKeyChordState);
|
||||
|
||||
mSettings.Load();
|
||||
mSettings.Apply();
|
||||
UpdateRecentFileMenuItems();
|
||||
UpdateRecentDisplayedFilesMenuItems();
|
||||
}
|
||||
|
||||
public void CheckReloadSettings()
|
||||
|
|
|
@ -1106,12 +1106,24 @@ namespace IDE
|
|||
public bool mEnableDevMode;
|
||||
public TutorialsFinished mTutorialsFinished = .();
|
||||
|
||||
|
||||
public this()
|
||||
{
|
||||
SetDefaults();
|
||||
}
|
||||
|
||||
public this(Settings prevSettings)
|
||||
{
|
||||
Swap!(mRecentFiles, prevSettings.mRecentFiles);
|
||||
|
||||
for (var recent in mRecentFiles.mRecents)
|
||||
{
|
||||
recent.mList.ClearAndDeleteItems();
|
||||
for (var item in recent.mMenuItems)
|
||||
item.Dispose();
|
||||
recent.mMenuItems.ClearAndDeleteItems();
|
||||
}
|
||||
}
|
||||
|
||||
public void SetDefaults()
|
||||
{
|
||||
mVSSettings.SetDefaults();
|
||||
|
@ -1192,6 +1204,9 @@ namespace IDE
|
|||
|
||||
public bool WantsReload()
|
||||
{
|
||||
if (mSettingFileDateTime == default)
|
||||
return false;
|
||||
|
||||
String path = scope .();
|
||||
GetSettingsPath(path);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue