[PTRun][Shell]Shell selection and combobox improvements (#28972)

* Make combobox items sortable

* Update plugin settings

* settings description

* fix settings hang on outdated plugin code

* spell fixes, shell implementation, translation improvements

* rename property

* backward compatibility

* comment changes

* comment changes

* review feedback 1

* review feedback 2

* Code clean up
This commit is contained in:
Heiko
2023-10-11 14:54:49 +02:00
committed by GitHub
parent 5d669df21a
commit 19827d0093
7 changed files with 175 additions and 49 deletions

View File

@@ -54,8 +54,13 @@ namespace Microsoft.PowerToys.Settings.UI.Library
public int ComboBoxValue { get; set; }
/// <summary>
/// Gets or sets the list of dropdown items for the ComboBox. Please use the item name as Key and an integer as Value.
/// The value gets converted in settings UI to an integer and will be saved in <see cref="ComboBoxValue"/>.
/// You can define the visibility order in settings ui by arranging the list items.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<string> ComboBoxOptions { get; set; }
public List<KeyValuePair<string, string>> ComboBoxItems { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string TextValue { get; set; }
@@ -91,5 +96,15 @@ namespace Microsoft.PowerToys.Settings.UI.Library
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public double? NumberBoxLargeChange { get; set; }
// Outdated properties kept for backward compatibility with third-party plugins. (They are only required to not have old third-party plugins crashing when propagating their plugin options.)
#pragma warning disable SA1623 // Property summary documentation should match accessors
/// <summary>
/// PLEASE DON'T USE ANYMORE!! (The property was used for the list of combobox items in the past and is not functional anymore.)
/// </summary>
[JsonIgnore]
public List<string> ComboBoxOptions { get; set; }
#pragma warning restore SA1623 // Property summary documentation should match accessors
}
}