From 61aca7409668890b1a55a14457ec02f0414d1209 Mon Sep 17 00:00:00 2001 From: 01Dri Date: Sun, 25 May 2025 02:41:17 -0300 Subject: [PATCH] Separating add commands between QuickAccessLink and IndexSearchExcludedPaths --- .../ViewModels/SettingsViewModel.cs | 27 ++++++++++--------- .../Views/ExplorerSettings.xaml | 4 +-- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs index fb33dacab..508e20893 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs @@ -365,27 +365,28 @@ namespace Flow.Launcher.Plugin.Explorer.ViewModels } [RelayCommand] - private void AddLink(object commandParameter) + private void AddQuickAccessLink(object commandParameter) { - var container = commandParameter switch - { - "QuickAccessLink" => Settings.QuickAccessLinks, - "IndexSearchExcludedPaths" => Settings.IndexSearchExcludedSubdirectoryPaths, - _ => throw new ArgumentOutOfRangeException(nameof(commandParameter)) - }; - - ArgumentNullException.ThrowIfNull(container); - + var quickAccessLinkSettings = new QuickAccessLinkSettings(); + quickAccessLinkSettings.ShowDialog(); + } + + + [RelayCommand] + private void AddIndexSearchExcludePaths(object commandParameter) + { + var container = Settings.IndexSearchExcludedSubdirectoryPaths; + var folderBrowserDialog = new FolderBrowserDialog(); - + if (folderBrowserDialog.ShowDialog() != DialogResult.OK) return; - + var newAccessLink = new AccessLink { Path = folderBrowserDialog.SelectedPath }; - + container.Add(newAccessLink); } diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml index 3ef61573d..07f05b1c1 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml @@ -762,7 +762,7 @@