mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Separating add commands between QuickAccessLink and IndexSearchExcludedPaths
This commit is contained in:
parent
3777e2b6d8
commit
61aca74096
2 changed files with 16 additions and 15 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -762,7 +762,7 @@
|
|||
<Button
|
||||
MinWidth="100"
|
||||
Margin="{StaticResource SettingPanelItemLeftMargin}"
|
||||
Command="{Binding AddLinkCommand}"
|
||||
Command="{Binding AddQuickAccessLinkCommand}"
|
||||
CommandParameter="QuickAccessLink"
|
||||
Content="{DynamicResource plugin_explorer_add}" />
|
||||
</StackPanel>
|
||||
|
|
@ -822,7 +822,7 @@
|
|||
<Button
|
||||
MinWidth="100"
|
||||
Margin="{StaticResource SettingPanelItemLeftMargin}"
|
||||
Command="{Binding AddLinkCommand}"
|
||||
Command="{Binding AddIndexSearchExcludePathsCommand}"
|
||||
CommandParameter="IndexSearchExcludedPaths"
|
||||
Content="{DynamicResource plugin_explorer_add}" />
|
||||
</StackPanel>
|
||||
|
|
|
|||
Loading…
Reference in a new issue