Skip to content

Commit 10eb5ad

Browse files
authored
Merge pull request #3839 from Flow-Launcher/explorer_deleting
Add delete confirmation when deleting quick access links & index search excluded paths
2 parents b924a79 + 3b3fe52 commit 10eb5ad

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
<system:String x:Key="plugin_explorer_make_selection_warning">Please make a selection first</system:String>
88
<system:String x:Key="plugin_explorer_quick_access_link_no_folder_selected">Please select a folder path.</system:String>
99
<system:String x:Key="plugin_explorer_quick_access_link_path_already_exists">Please choose a different name or folder path.</system:String>
10+
<system:String x:Key="plugin_explorer_delete_quick_access_link">Are you sure you want to delete this quick access link?</system:String>
11+
<system:String x:Key="plugin_explorer_delete_index_search_excluded_path">Are you sure you want to delete this index search excluded path?</system:String>
1012
<system:String x:Key="plugin_explorer_select_folder_link_warning">Please select a folder link</system:String>
1113
<system:String x:Key="plugin_explorer_delete_folder_link">Are you sure you want to delete {0}?</system:String>
1214
<system:String x:Key="plugin_explorer_deletefileconfirm">Are you sure you want to permanently delete this file?</system:String>

Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,10 +431,24 @@ private void RemoveLink(object commandParameter)
431431
{
432432
case "QuickAccessLink":
433433
if (SelectedQuickAccessLink == null) return;
434+
if (Context.API.ShowMsgBox(
435+
Context.API.GetTranslation("plugin_explorer_delete_quick_access_link"),
436+
Context.API.GetTranslation("plugin_explorer_delete"),
437+
MessageBoxButton.OKCancel,
438+
MessageBoxImage.Warning)
439+
== MessageBoxResult.Cancel)
440+
return;
434441
Settings.QuickAccessLinks.Remove(SelectedQuickAccessLink);
435442
break;
436443
case "IndexSearchExcludedPaths":
437444
if (SelectedIndexSearchExcludedPath == null) return;
445+
if (Context.API.ShowMsgBox(
446+
Context.API.GetTranslation("plugin_explorer_delete_index_search_excluded_path"),
447+
Context.API.GetTranslation("plugin_explorer_delete"),
448+
MessageBoxButton.OKCancel,
449+
MessageBoxImage.Warning)
450+
== MessageBoxResult.Cancel)
451+
return;
438452
Settings.IndexSearchExcludedSubdirectoryPaths.Remove(SelectedIndexSearchExcludedPath);
439453
break;
440454
}

0 commit comments

Comments
 (0)