mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-14 03:37:10 +08:00
Merge pull request #22 from jjw24/add_save_allsettings
Add to Sys plugin- save all Wox settings
This commit is contained in:
commit
31c0fc5742
@ -168,6 +168,18 @@ namespace Wox.Plugin.Sys
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
new Result
|
new Result
|
||||||
|
{
|
||||||
|
Title = "Save Settings",
|
||||||
|
SubTitle = "Save all Wox settings",
|
||||||
|
IcoPath = "Images\\app.png",
|
||||||
|
Action = c =>
|
||||||
|
{
|
||||||
|
context.API.SaveAppAllSettings();
|
||||||
|
context.API.ShowMsg("Success","All Wox settings saved");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new Result
|
||||||
{
|
{
|
||||||
Title = "Restart Wox",
|
Title = "Restart Wox",
|
||||||
SubTitle = context.API.GetTranslation("wox_plugin_sys_restart"),
|
SubTitle = context.API.GetTranslation("wox_plugin_sys_restart"),
|
||||||
|
@ -57,6 +57,11 @@ namespace Wox.Plugin
|
|||||||
[Obsolete]
|
[Obsolete]
|
||||||
void ShowApp();
|
void ShowApp();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Save all Wox settings
|
||||||
|
/// </summary>
|
||||||
|
void SaveAppAllSettings();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Show message box
|
/// Show message box
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -59,13 +59,18 @@ namespace Wox
|
|||||||
// we must manually save
|
// we must manually save
|
||||||
// UpdateManager.RestartApp() will call Environment.Exit(0)
|
// UpdateManager.RestartApp() will call Environment.Exit(0)
|
||||||
// which will cause ungraceful exit
|
// which will cause ungraceful exit
|
||||||
|
SaveAppAllSettings();
|
||||||
|
|
||||||
|
UpdateManager.RestartApp();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SaveAppAllSettings()
|
||||||
|
{
|
||||||
_mainVM.Save();
|
_mainVM.Save();
|
||||||
_settingsVM.Save();
|
_settingsVM.Save();
|
||||||
PluginManager.Save();
|
PluginManager.Save();
|
||||||
ImageLoader.Save();
|
ImageLoader.Save();
|
||||||
Alphabet.Save();
|
Alphabet.Save();
|
||||||
|
|
||||||
UpdateManager.RestartApp();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Obsolete]
|
[Obsolete]
|
||||||
|
Loading…
Reference in New Issue
Block a user