Settings UX: enable toggle, Load/Refresh button, greyed-out Apply

- Add master toggle to enable/disable Python scripts feature entirely
  (IsPythonScriptsEnabled in settings model, ViewModel, and runtime)
- Button shows 'Load scripts' initially, changes to 'Refresh scripts'
  after first load
- Edit dialog 'Apply changes' button is greyed out until a field changes
  (tracks initial snapshot vs current values for all fields)
- Runtime BuildPythonScriptFormats respects IsPythonScriptsEnabled

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Muyuan Li (from Dev Box)
2026-04-17 15:56:08 +08:00
parent 5104d0846c
commit f8bca48db3
8 changed files with 134 additions and 6 deletions

View File

@@ -9,6 +9,9 @@ namespace Microsoft.PowerToys.Settings.UI.Library;
public sealed class AdvancedPastePythonScriptSettings
{
[JsonPropertyName("isEnabled")]
public bool IsEnabled { get; set; }
[JsonPropertyName("scriptsFolder")]
public string ScriptsFolder { get; set; } = string.Empty;