From b123d95b71520540c73e92d5dc776a7630f323ab Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Tue, 10 Dec 2019 20:03:43 +1100 Subject: [PATCH] Add run as admin toggle option to plugin settings --- Plugins/Wox.Plugin.Shell/Languages/en.xaml | 1 + Plugins/Wox.Plugin.Shell/ShellSetting.xaml | 4 +++- Plugins/Wox.Plugin.Shell/ShellSetting.xaml.cs | 11 +++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Plugins/Wox.Plugin.Shell/Languages/en.xaml b/Plugins/Wox.Plugin.Shell/Languages/en.xaml index 7a953986cc..6f56e83f58 100644 --- a/Plugins/Wox.Plugin.Shell/Languages/en.xaml +++ b/Plugins/Wox.Plugin.Shell/Languages/en.xaml @@ -4,6 +4,7 @@ Replace Win+R Do not close Command Prompt after command execution + Always run as administrator Shell Allows to execute system commands from Wox. Commands should start with > this command has been executed {0} times diff --git a/Plugins/Wox.Plugin.Shell/ShellSetting.xaml b/Plugins/Wox.Plugin.Shell/ShellSetting.xaml index f631f6e228..dc6de53bac 100644 --- a/Plugins/Wox.Plugin.Shell/ShellSetting.xaml +++ b/Plugins/Wox.Plugin.Shell/ShellSetting.xaml @@ -12,10 +12,12 @@ + - + + CMD PowerShell RunCommand diff --git a/Plugins/Wox.Plugin.Shell/ShellSetting.xaml.cs b/Plugins/Wox.Plugin.Shell/ShellSetting.xaml.cs index 639c5c3c98..ffa3b58568 100644 --- a/Plugins/Wox.Plugin.Shell/ShellSetting.xaml.cs +++ b/Plugins/Wox.Plugin.Shell/ShellSetting.xaml.cs @@ -17,6 +17,7 @@ namespace Wox.Plugin.Shell { ReplaceWinR.IsChecked = _settings.ReplaceWinR; LeaveShellOpen.IsChecked = _settings.LeaveShellOpen; + AlwaysRunAsAdministrator.IsChecked = _settings.RunAsAdministrator; LeaveShellOpen.IsEnabled = _settings.Shell != Shell.RunCommand; LeaveShellOpen.Checked += (o, e) => @@ -29,6 +30,16 @@ namespace Wox.Plugin.Shell _settings.LeaveShellOpen = false; }; + AlwaysRunAsAdministrator.Checked += (o, e) => + { + _settings.RunAsAdministrator = true; + }; + + AlwaysRunAsAdministrator.Unchecked += (o, e) => + { + _settings.RunAsAdministrator = false; + }; + ReplaceWinR.Checked += (o, e) => { _settings.ReplaceWinR = true;