Files
PowerToys/src/settings-ui/Settings.UI.Library/AdvancedPastePythonScriptSettings.cs
Muyuan Li (from Dev Box) f8bca48db3 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>
2026-04-17 15:56:08 +08:00

30 lines
988 B
C#

// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
using System.Text.Json.Serialization;
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;
[JsonPropertyName("pythonExecutablePath")]
public string PythonExecutablePath { get; set; } = string.Empty;
[JsonPropertyName("timeoutSeconds")]
public int TimeoutSeconds { get; set; } = 30;
[JsonPropertyName("value")]
public List<AdvancedPastePythonScriptAction> Value { get; set; } = [];
[JsonPropertyName("trustedScriptHashes")]
public Dictionary<string, string> TrustedScriptHashes { get; set; } = [];
}