mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[PT Run > PluginAdditionalOptions] Refactoring and more settings types (#28601)
* refactor existing code * fixes * fix combo box layout * improve layout * add more settings types * combined setting * enabled state * fix spelling * improve settings.json handling on null values * textbox improvements * rework xaml code * fix xaml style * spell fixes * spell fixes * update comment
This commit is contained in:
@@ -52,7 +52,7 @@ namespace Microsoft.Plugin.Shell
|
||||
{
|
||||
Key = "ShellCommandExecution",
|
||||
DisplayLabel = Resources.wox_shell_command_execution,
|
||||
SelectionTypeValue = (int)PluginAdditionalOption.SelectionType.Combobox,
|
||||
PluginOptionType = PluginAdditionalOption.AdditionalOptionType.Combobox,
|
||||
ComboBoxOptions = new List<string>
|
||||
{
|
||||
Resources.run_command_in_command_prompt,
|
||||
@@ -60,7 +60,7 @@ namespace Microsoft.Plugin.Shell
|
||||
Resources.find_executable_file_and_run_it,
|
||||
Resources.run_command_in_windows_terminal,
|
||||
},
|
||||
Option = (int)_settings.Shell,
|
||||
ComboBoxValue = (int)_settings.Shell,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -442,7 +442,7 @@ namespace Microsoft.Plugin.Shell
|
||||
_settings.LeaveShellOpen = leaveShellOpen;
|
||||
|
||||
var optionShell = settings.AdditionalOptions.FirstOrDefault(x => x.Key == "ShellCommandExecution");
|
||||
shellOption = optionShell?.Option ?? shellOption;
|
||||
shellOption = optionShell?.ComboBoxValue ?? shellOption;
|
||||
_settings.Shell = (ExecutionShell)shellOption;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user