diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs index c9a0b7303..b5d756d3d 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs @@ -50,6 +50,38 @@ namespace Flow.Launcher.Plugin.Explorer var icoPath = (record.Type == ResultType.File) ? Constants.FileImagePath : Constants.FolderImagePath; var fileOrFolder = (record.Type == ResultType.File) ? "file" : "folder"; + + if (!Settings.QuickFolderAccessLinks.Any(x => x.Path == record.FullPath)) + { + contextMenus.Add(new Result + { + Title = Context.API.GetTranslation("plugin_explorer_add_to_quickaccess"), + SubTitle = $"Add the current {fileOrFolder} to Quick Access", + Action = (context) => + { + try + { + Settings.QuickFolderAccessLinks.Add(new FolderLink { Path = record.FullPath, Type = record.Type }); + + Context.API.ShowMsg(Context.API.GetTranslation("plugin_explorer_addfilefoldersuccess"), + string.Format( + Context.API.GetTranslation("plugin_explorer_addfilefoldersuccess_detail"), + fileOrFolder), + Constants.ExplorerIconImageFullPath); + return true; + } + catch (Exception e) + { + var message = "Fail to add to Quick Access"; + LogException(message, e); + Context.API.ShowMsg(message); + return false; + } + }, + IcoPath = Constants.QuickAccessImagePath + }); + } + contextMenus.Add(new Result { Title = Context.API.GetTranslation("plugin_explorer_copypath"), diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Images/quickaccess.png b/Plugins/Flow.Launcher.Plugin.Explorer/Images/quickaccess.png new file mode 100644 index 000000000..470a6782f Binary files /dev/null and b/Plugins/Flow.Launcher.Plugin.Explorer/Images/quickaccess.png differ diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml index 2fb16e0e1..c31ef8f8f 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml @@ -42,5 +42,8 @@ Open Windows Indexing Options Manage indexed files and folders Failed to open Windows Indexing Options + Add to Quick Access + Successfully Added + Successfully added to 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 38939e244..c3e72deb2 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs @@ -15,6 +15,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search internal const string ExplorerIconImagePath = "Images\\explorer.png"; internal const string DifferentUserIconImagePath = "Images\\user.png"; internal const string IndexingOptionsIconImagePath = "Images\\windowsindexingoptions.png"; + internal const string QuickAccessImagePath = "Images\\quickaccess.png"; internal const string ToolTipOpenDirectory = "Ctrl + Enter to open the directory";