diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs index f545df08b..21eb844b4 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs @@ -59,8 +59,8 @@ namespace Flow.Launcher.Plugin.Explorer { contextMenus.Add(new Result { - Title = Context.API.GetTranslation("plugin_explorer_add_to_quickaccess"), - SubTitle = $"Add the current {fileOrFolder} to Quick Access", + Title = Context.API.GetTranslation("plugin_explorer_add_to_quickaccess_title"), + SubTitle = string.Format(Context.API.GetTranslation("plugin_explorer_add_to_quickaccess_subtitle"), fileOrFolder), Action = (context) => { Settings.QuickAccessLinks.Add(new AccessLink { Path = record.FullPath, Type = record.Type }); @@ -80,6 +80,31 @@ namespace Flow.Launcher.Plugin.Explorer IcoPath = Constants.QuickAccessImagePath }); } + else + { + contextMenus.Add(new Result + { + Title = Context.API.GetTranslation("plugin_explorer_remove_from_quickaccess_title"), + SubTitle = string.Format(Context.API.GetTranslation("plugin_explorer_remove_from_quickaccess_subtitle"), fileOrFolder), + Action = (context) => + { + Settings.QuickAccessLinks.Remove(Settings.QuickAccessLinks.FirstOrDefault(x => x.Path == record.FullPath)); + + Context.API.ShowMsg(Context.API.GetTranslation("plugin_explorer_removefilefoldersuccess"), + string.Format( + Context.API.GetTranslation("plugin_explorer_removefilefoldersuccess_detail"), + fileOrFolder), + Constants.ExplorerIconImageFullPath); + + ViewModel.Save(); + + return true; + }, + SubTitleToolTip = Context.API.GetTranslation("plugin_explorer_contextmenu_remove_titletooltip"), + TitleToolTip = Context.API.GetTranslation("plugin_explorer_contextmenu_remove_titletooltip"), + IcoPath = Constants.RemoveQuickAccessImagePath + }); + } contextMenus.Add(new Result { diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Images/removequickaccess.png b/Plugins/Flow.Launcher.Plugin.Explorer/Images/removequickaccess.png new file mode 100644 index 000000000..fbfb0b960 Binary files /dev/null and b/Plugins/Flow.Launcher.Plugin.Explorer/Images/removequickaccess.png differ diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml index b9b670742..9ba0da3f6 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml @@ -42,9 +42,15 @@ Open Windows Indexing Options Manage indexed files and folders Failed to open Windows Indexing Options - Add to Quick Access + Add to Quick Access + Add the current {0} to Quick Access Successfully Added Successfully added to Quick Access + Successfully Removed + Successfully removed from Quick Access Add to Quick Access so it can be opened with Explorer's Search Activation action keyword + Remove from Quick Access + Remove from Quick Access + Remove the current {0} from Quick Access \ No newline at end of file diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs index c3e72deb2..78c7c98a5 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs @@ -16,6 +16,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search internal const string DifferentUserIconImagePath = "Images\\user.png"; internal const string IndexingOptionsIconImagePath = "Images\\windowsindexingoptions.png"; internal const string QuickAccessImagePath = "Images\\quickaccess.png"; + internal const string RemoveQuickAccessImagePath = "Images\\removequickaccess.png"; internal const string ToolTipOpenDirectory = "Ctrl + Enter to open the directory";