mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-04-05 22:28:31 +00:00
export and import toggle switch states in config JSON (#4037)
* feat: add support for importing and exporting WPFToggle checkbox states. * feat: add export and import * remove unnecessary buttons from tweaks tab * Merge branch 'main' into feature/import-export * Merge branch 'main' into feature/import-export
This commit is contained in:
@@ -25,10 +25,19 @@ Function Get-WinUtilCheckBoxes {
|
||||
WPFTweaks = @()
|
||||
WPFFeature = @()
|
||||
WPFInstall = @()
|
||||
WPFToggle = @()
|
||||
}
|
||||
|
||||
$CheckBoxes = $sync.GetEnumerator() | Where-Object { $_.Value -is [System.Windows.Controls.CheckBox] }
|
||||
|
||||
# Collect toggle switch states
|
||||
foreach ($CheckBox in $CheckBoxes) {
|
||||
if ($CheckBox.Key -like "WPFToggle*" -and $CheckBox.Value.IsChecked -eq $true) {
|
||||
$Output["WPFToggle"] += $CheckBox.Key
|
||||
Write-Debug "Adding toggle: $($CheckBox.Key)"
|
||||
}
|
||||
}
|
||||
|
||||
# First check and add WPFTweaksRestorePoint if checked
|
||||
$RestorePoint = $CheckBoxes | Where-Object { $_.Key -eq 'WPFTweaksRestorePoint' -and $_.Value.IsChecked -eq $true }
|
||||
if ($RestorePoint) {
|
||||
|
||||
Reference in New Issue
Block a user