From 7d00b84a07383b0caceda488c191756f8731248f Mon Sep 17 00:00:00 2001 From: Jeffrey <9938813+Raphire@users.noreply.github.com> Date: Wed, 18 Feb 2026 21:39:00 +0100 Subject: [PATCH] Add option to quickly apply default settings from home page (#479) --- Schemas/MainWindow.xaml | 21 +++++++++++++++------ Scripts/GUI/Show-MainWindow.ps1 | 21 +++++++++++++++++++++ 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/Schemas/MainWindow.xaml b/Schemas/MainWindow.xaml index ade544b..76b3612 100644 --- a/Schemas/MainWindow.xaml +++ b/Schemas/MainWindow.xaml @@ -787,12 +787,21 @@ - - + + + + + diff --git a/Scripts/GUI/Show-MainWindow.ps1 b/Scripts/GUI/Show-MainWindow.ps1 index 729d24e..1d2f1ed 100644 --- a/Scripts/GUI/Show-MainWindow.ps1 +++ b/Scripts/GUI/Show-MainWindow.ps1 @@ -1245,6 +1245,27 @@ function Show-MainWindow { UpdateNavigationButtons }) + # Handle Home Default Mode button - apply defaults and navigate directly to overview + $homeDefaultModeBtn = $window.FindName('HomeDefaultModeBtn') + $homeDefaultModeBtn.Add_Click({ + # Load and apply default settings + $defaultsJson = LoadJsonFile -filePath $script:DefaultSettingsFilePath -expectedVersion "1.0" + if ($defaultsJson) { + ApplySettingsToUiControls -window $window -settingsJson $defaultsJson -uiControlMappings $script:UiControlMappings + } + + # Select default apps + foreach ($child in $appsPanel.Children) { + if ($child -is [System.Windows.Controls.CheckBox]) { + $child.IsChecked = ($child.SelectedByDefault -eq $true) + } + } + + # Navigate directly to the Overview tab + $tabControl.SelectedIndex = 3 + UpdateNavigationButtons + }) + # Handle Overview Apply Changes button - validates and immediately starts applying changes $overviewApplyBtn = $window.FindName('OverviewApplyBtn') $overviewApplyBtn.Add_Click({