[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:
Heiko
2023-09-20 19:31:40 +02:00
committed by GitHub
parent 5ddd8d72dd
commit 59f0ccebc7
5 changed files with 296 additions and 21 deletions

View File

@@ -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;
}