Add option to quickly apply default settings from home page (#479)

This commit is contained in:
Jeffrey
2026-02-18 21:39:00 +01:00
committed by GitHub
parent 15775d9dc8
commit 7d00b84a07
2 changed files with 36 additions and 6 deletions

View File

@@ -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({