From 1511aae2192c44cabf928205938b526e6f366818 Mon Sep 17 00:00:00 2001
From: Ray Berezowski <6616212+rberezowski@users.noreply.github.com>
Date: Tue, 2 Jun 2026 22:00:35 -0400
Subject: [PATCH] Consolidate config actions into menu
---
MainWindow.xaml | 24 ++++++++++++++++++------
MainWindow.xaml.cs | 38 ++++++++++++++++++++++++++++++++++++++
Services/ConfigService.cs | 7 +++++++
3 files changed, 63 insertions(+), 6 deletions(-)
diff --git a/MainWindow.xaml b/MainWindow.xaml
index 963b943..30f15bf 100644
--- a/MainWindow.xaml
+++ b/MainWindow.xaml
@@ -21,12 +21,24 @@
BorderBrush="{DynamicResource AppBorderBrush}">
-
-
-
-
-
-
+
diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs
index 8cdeff6..e6bc740 100644
--- a/MainWindow.xaml.cs
+++ b/MainWindow.xaml.cs
@@ -721,6 +721,17 @@ public partial class MainWindow : Window
}
}
+ private void ConfigMenuButton_Click(object sender, RoutedEventArgs e)
+ {
+ if (ConfigMenuButton.ContextMenu is null)
+ {
+ return;
+ }
+
+ ConfigMenuButton.ContextMenu.PlacementTarget = ConfigMenuButton;
+ ConfigMenuButton.ContextMenu.IsOpen = true;
+ }
+
private void ExportConfig_Click(object sender, RoutedEventArgs e)
{
if (controller is null)
@@ -792,6 +803,33 @@ public partial class MainWindow : Window
}
}
+ private void ResetConfig_Click(object sender, RoutedEventArgs e)
+ {
+ MessageBoxResult result = MessageBox.Show(
+ "Reset launcher config to the default folders and apps?\n\nA local backup will be created first.",
+ "Taskbar Launcher",
+ MessageBoxButton.YesNo,
+ MessageBoxImage.Warning);
+
+ if (result != MessageBoxResult.Yes)
+ {
+ return;
+ }
+
+ try
+ {
+ string backupPath = ConfigService.Backup();
+ ConfigService.ResetToDefaults();
+ controller?.ReloadConfig();
+ RefreshView();
+ StatusText.Text = $"Reset config to defaults. Previous config backed up to {backupPath}";
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show($"Could not reset config.\n\n{ex.Message}", "Taskbar Launcher");
+ }
+ }
+
private List? FindItemPath(LauncherItem item)
{
if (controller is null)
diff --git a/Services/ConfigService.cs b/Services/ConfigService.cs
index e9558f4..7b41f36 100644
--- a/Services/ConfigService.cs
+++ b/Services/ConfigService.cs
@@ -87,6 +87,13 @@ public static class ConfigService
return config;
}
+ public static LauncherConfig ResetToDefaults()
+ {
+ LauncherConfig config = CreateDefaultConfig();
+ Save(config);
+ return config;
+ }
+
public static LauncherConfig Restore(string sourcePath)
{
LauncherConfig config = ReadConfigFile(sourcePath);