Skip to content

Commit e615ad8

Browse files
committed
add remove from quick access in context menu
1 parent c0f60e2 commit e615ad8

File tree

4 files changed

+35
-3
lines changed

4 files changed

+35
-3
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ public List<Result> LoadContextMenus(Result selectedResult)
5959
{
6060
contextMenus.Add(new Result
6161
{
62-
Title = Context.API.GetTranslation("plugin_explorer_add_to_quickaccess"),
63-
SubTitle = $"Add the current {fileOrFolder} to Quick Access",
62+
Title = Context.API.GetTranslation("plugin_explorer_add_to_quickaccess_title"),
63+
SubTitle = string.Format(Context.API.GetTranslation("plugin_explorer_add_to_quickaccess_subtitle"), fileOrFolder),
6464
Action = (context) =>
6565
{
6666
Settings.QuickAccessLinks.Add(new AccessLink { Path = record.FullPath, Type = record.Type });
@@ -80,6 +80,31 @@ public List<Result> LoadContextMenus(Result selectedResult)
8080
IcoPath = Constants.QuickAccessImagePath
8181
});
8282
}
83+
else
84+
{
85+
contextMenus.Add(new Result
86+
{
87+
Title = Context.API.GetTranslation("plugin_explorer_remove_from_quickaccess_title"),
88+
SubTitle = string.Format(Context.API.GetTranslation("plugin_explorer_remove_from_quickaccess_subtitle"), fileOrFolder),
89+
Action = (context) =>
90+
{
91+
Settings.QuickAccessLinks.Remove(Settings.QuickAccessLinks.FirstOrDefault(x => x.Path == record.FullPath));
92+
93+
Context.API.ShowMsg(Context.API.GetTranslation("plugin_explorer_removefilefoldersuccess"),
94+
string.Format(
95+
Context.API.GetTranslation("plugin_explorer_removefilefoldersuccess_detail"),
96+
fileOrFolder),
97+
Constants.ExplorerIconImageFullPath);
98+
99+
ViewModel.Save();
100+
101+
return true;
102+
},
103+
SubTitleToolTip = Context.API.GetTranslation("plugin_explorer_contextmenu_remove_titletooltip"),
104+
TitleToolTip = Context.API.GetTranslation("plugin_explorer_contextmenu_remove_titletooltip"),
105+
IcoPath = Constants.RemoveQuickAccessImagePath
106+
});
107+
}
83108

84109
contextMenus.Add(new Result
85110
{
11.3 KB
Loading

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,15 @@
4242
<system:String x:Key="plugin_explorer_openindexingoptions">Open Windows Indexing Options</system:String>
4343
<system:String x:Key="plugin_explorer_openindexingoptions_subtitle">Manage indexed files and folders</system:String>
4444
<system:String x:Key="plugin_explorer_openindexingoptions_errormsg">Failed to open Windows Indexing Options</system:String>
45-
<system:String x:Key="plugin_explorer_add_to_quickaccess">Add to Quick Access</system:String>
45+
<system:String x:Key="plugin_explorer_add_to_quickaccess_title">Add to Quick Access</system:String>
46+
<system:String x:Key="plugin_explorer_add_to_quickaccess_subtitle">Add the current {0} to Quick Access</system:String>
4647
<system:String x:Key="plugin_explorer_addfilefoldersuccess">Successfully Added</system:String>
4748
<system:String x:Key="plugin_explorer_addfilefoldersuccess_detail">Successfully added to Quick Access</system:String>
49+
<system:String x:Key="plugin_explorer_removefilefoldersuccess">Successfully Removed</system:String>
50+
<system:String x:Key="plugin_explorer_removefilefoldersuccess_detail">Successfully removed from Quick Access</system:String>
4851
<system:String x:Key="plugin_explorer_contextmenu_titletooltip">Add to Quick Access so it can be opened with Explorer's Search Activation action keyword</system:String>
52+
<system:String x:Key="plugin_explorer_contextmenu_remove_titletooltip">Remove from Quick Access</system:String>
53+
<system:String x:Key="plugin_explorer_remove_from_quickaccess_title">Remove from Quick Access</system:String>
54+
<system:String x:Key="plugin_explorer_remove_from_quickaccess_subtitle">Remove the current {0} from Quick Access</system:String>
4955

5056
</ResourceDictionary>

Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ internal static class Constants
1616
internal const string DifferentUserIconImagePath = "Images\\user.png";
1717
internal const string IndexingOptionsIconImagePath = "Images\\windowsindexingoptions.png";
1818
internal const string QuickAccessImagePath = "Images\\quickaccess.png";
19+
internal const string RemoveQuickAccessImagePath = "Images\\removequickaccess.png";
1920

2021
internal const string ToolTipOpenDirectory = "Ctrl + Enter to open the directory";
2122

0 commit comments

Comments
 (0)