mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 20:27:36 +02:00
Add run as admin toggle option to plugin settings
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
<system:String x:Key="wox_plugin_cmd_relace_winr">Replace Win+R</system:String>
|
<system:String x:Key="wox_plugin_cmd_relace_winr">Replace Win+R</system:String>
|
||||||
<system:String x:Key="wox_plugin_cmd_leave_cmd_open">Do not close Command Prompt after command execution</system:String>
|
<system:String x:Key="wox_plugin_cmd_leave_cmd_open">Do not close Command Prompt after command execution</system:String>
|
||||||
|
<system:String x:Key="wox_plugin_cmd_always_run_as_administrator">Always run as administrator</system:String>
|
||||||
<system:String x:Key="wox_plugin_cmd_plugin_name">Shell</system:String>
|
<system:String x:Key="wox_plugin_cmd_plugin_name">Shell</system:String>
|
||||||
<system:String x:Key="wox_plugin_cmd_plugin_description">Allows to execute system commands from Wox. Commands should start with ></system:String>
|
<system:String x:Key="wox_plugin_cmd_plugin_description">Allows to execute system commands from Wox. Commands should start with ></system:String>
|
||||||
<system:String x:Key="wox_plugin_cmd_cmd_has_been_executed_times">this command has been executed {0} times</system:String>
|
<system:String x:Key="wox_plugin_cmd_cmd_has_been_executed_times">this command has been executed {0} times</system:String>
|
||||||
|
|||||||
@@ -12,10 +12,12 @@
|
|||||||
<RowDefinition/>
|
<RowDefinition/>
|
||||||
<RowDefinition/>
|
<RowDefinition/>
|
||||||
<RowDefinition/>
|
<RowDefinition/>
|
||||||
|
<RowDefinition/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<CheckBox Grid.Row="0" x:Name="ReplaceWinR" Content="{DynamicResource wox_plugin_cmd_relace_winr}" Margin="10" HorizontalAlignment="Left"/>
|
<CheckBox Grid.Row="0" x:Name="ReplaceWinR" Content="{DynamicResource wox_plugin_cmd_relace_winr}" Margin="10" HorizontalAlignment="Left"/>
|
||||||
<CheckBox Grid.Row="1" x:Name="LeaveShellOpen" Content="{DynamicResource wox_plugin_cmd_leave_cmd_open}" Margin="10" HorizontalAlignment="Left"/>
|
<CheckBox Grid.Row="1" x:Name="LeaveShellOpen" Content="{DynamicResource wox_plugin_cmd_leave_cmd_open}" Margin="10" HorizontalAlignment="Left"/>
|
||||||
<ComboBox Grid.Row="2" x:Name="ShellComboBox" Margin="10" HorizontalAlignment="Left" >
|
<CheckBox Grid.Row="2" x:Name="AlwaysRunAsAdministrator" Content="{DynamicResource wox_plugin_cmd_always_run_as_administrator}" Margin="10" HorizontalAlignment="Left"/>
|
||||||
|
<ComboBox Grid.Row="3" x:Name="ShellComboBox" Margin="10" HorizontalAlignment="Left" >
|
||||||
<ComboBoxItem>CMD</ComboBoxItem>
|
<ComboBoxItem>CMD</ComboBoxItem>
|
||||||
<ComboBoxItem>PowerShell</ComboBoxItem>
|
<ComboBoxItem>PowerShell</ComboBoxItem>
|
||||||
<ComboBoxItem>RunCommand</ComboBoxItem>
|
<ComboBoxItem>RunCommand</ComboBoxItem>
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ namespace Wox.Plugin.Shell
|
|||||||
{
|
{
|
||||||
ReplaceWinR.IsChecked = _settings.ReplaceWinR;
|
ReplaceWinR.IsChecked = _settings.ReplaceWinR;
|
||||||
LeaveShellOpen.IsChecked = _settings.LeaveShellOpen;
|
LeaveShellOpen.IsChecked = _settings.LeaveShellOpen;
|
||||||
|
AlwaysRunAsAdministrator.IsChecked = _settings.RunAsAdministrator;
|
||||||
LeaveShellOpen.IsEnabled = _settings.Shell != Shell.RunCommand;
|
LeaveShellOpen.IsEnabled = _settings.Shell != Shell.RunCommand;
|
||||||
|
|
||||||
LeaveShellOpen.Checked += (o, e) =>
|
LeaveShellOpen.Checked += (o, e) =>
|
||||||
@@ -29,6 +30,16 @@ namespace Wox.Plugin.Shell
|
|||||||
_settings.LeaveShellOpen = false;
|
_settings.LeaveShellOpen = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
AlwaysRunAsAdministrator.Checked += (o, e) =>
|
||||||
|
{
|
||||||
|
_settings.RunAsAdministrator = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
AlwaysRunAsAdministrator.Unchecked += (o, e) =>
|
||||||
|
{
|
||||||
|
_settings.RunAsAdministrator = false;
|
||||||
|
};
|
||||||
|
|
||||||
ReplaceWinR.Checked += (o, e) =>
|
ReplaceWinR.Checked += (o, e) =>
|
||||||
{
|
{
|
||||||
_settings.ReplaceWinR = true;
|
_settings.ReplaceWinR = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user