From ad6936337b5ad001b2c6af4d0f44cfd2b9820c36 Mon Sep 17 00:00:00 2001 From: DeveloperDurp Date: Wed, 18 May 2022 15:29:51 -0500 Subject: [PATCH] converted tweak-buttons to use applications.json --- applications.json | 38 ++++++++++++++++++++++++++++++++++++++ winutil-test.ps1 | 44 ++------------------------------------------ 2 files changed, 40 insertions(+), 42 deletions(-) diff --git a/applications.json b/applications.json index e3a2d1e0..6204f96c 100644 --- a/applications.json +++ b/applications.json @@ -225,5 +225,43 @@ "Installzoom": { "winget": "Zoom.Zoom" } + }, + "Preset": { + "desktop": [ + "EssTweaksAH", + "EssTweaksDVR", + "EssTweaksHiber", + "EssTweaksHome", + "EssTweaksLoc", + "EssTweaksOO", + "EssTweaksRP", + "EssTweaksServices", + "EssTweaksStorage", + "EssTweaksTele", + "EssTweaksWifi", + "MiscTweaksPower", + "MiscTweaksNum" + ], + "laptop": [ + "EssTweaksAH", + "EssTweaksDVR", + "EssTweaksHome", + "EssTweaksLoc", + "EssTweaksOO", + "EssTweaksRP", + "EssTweaksServices", + "EssTweaksStorage", + "EssTweaksTele", + "EssTweaksWifi", + "MiscTweaksLapPower", + "MiscTweaksLapNum" + ], + "minimal": [ + "EssTweaksHome", + "EssTweaksOO", + "EssTweaksRP", + "EssTweaksServices", + "EssTweaksTele" + ] } } diff --git a/winutil-test.ps1 b/winutil-test.ps1 index f9b873d2..36175b15 100644 --- a/winutil-test.ps1 +++ b/winutil-test.ps1 @@ -137,48 +137,8 @@ $xaml.SelectNodes("//*[@Name]") | ForEach-Object {$global:sync["$("$($_.Name)")" Function Tweak-Buttons { Param ($button) - if ($button -eq "desktop"){ - $preset = @( - "EssTweaksAH" - "EssTweaksDVR" - "EssTweaksHiber" - "EssTweaksHome" - "EssTweaksLoc" - "EssTweaksOO" - "EssTweaksRP" - "EssTweaksServices" - "EssTweaksStorage" - "EssTweaksTele" - "EssTweaksWifi" - "MiscTweaksPower" - "MiscTweaksNum" - ) - } - if ($button -eq "laptop"){ - $preset = @( - "EssTweaksAH" - "EssTweaksDVR" - "EssTweaksHome" - "EssTweaksLoc" - "EssTweaksOO" - "EssTweaksRP" - "EssTweaksServices" - "EssTweaksStorage" - "EssTweaksTele" - "EssTweaksWifi" - "MiscTweaksLapPower" - "MiscTweaksLapNum" - ) - } - if ($button -eq "minimal"){ - $preset = @( - "EssTweaksHome" - "EssTweaksOO" - "EssTweaksRP" - "EssTweaksServices" - "EssTweaksTele" - ) - } + $preset = $global:sync["applications"].preset.$button + $global:sync.keys | Where-Object {$_ -like "*tweaks*" -and $_ -notlike "tweaksbutton"} | ForEach-Object { if ($preset -contains $_ ){$global:sync["$_"].IsChecked = $True} Else{$global:sync["$_"].IsChecked = $false}