File tree Expand file tree Collapse file tree 4 files changed +36
-0
lines changed
Plugins/Flow.Launcher.Plugin.Explorer Expand file tree Collapse file tree 4 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,38 @@ public List<Result> LoadContextMenus(Result selectedResult)
50
50
51
51
var icoPath = ( record . Type == ResultType . File ) ? Constants . FileImagePath : Constants . FolderImagePath ;
52
52
var fileOrFolder = ( record . Type == ResultType . File ) ? "file" : "folder" ;
53
+
54
+ if ( ! Settings . QuickFolderAccessLinks . Any ( x => x . Path == record . FullPath ) )
55
+ {
56
+ contextMenus . Add ( new Result
57
+ {
58
+ Title = Context . API . GetTranslation ( "plugin_explorer_add_to_quickaccess" ) ,
59
+ SubTitle = $ "Add the current { fileOrFolder } to Quick Access",
60
+ Action = ( context ) =>
61
+ {
62
+ try
63
+ {
64
+ Settings . QuickFolderAccessLinks . Add ( new FolderLink { Path = record . FullPath , Type = record . Type } ) ;
65
+
66
+ Context . API . ShowMsg ( Context . API . GetTranslation ( "plugin_explorer_addfilefoldersuccess" ) ,
67
+ string . Format (
68
+ Context . API . GetTranslation ( "plugin_explorer_addfilefoldersuccess_detail" ) ,
69
+ fileOrFolder ) ,
70
+ Constants . ExplorerIconImageFullPath ) ;
71
+ return true ;
72
+ }
73
+ catch ( Exception e )
74
+ {
75
+ var message = "Fail to add to Quick Access" ;
76
+ LogException ( message , e ) ;
77
+ Context . API . ShowMsg ( message ) ;
78
+ return false ;
79
+ }
80
+ } ,
81
+ IcoPath = Constants . QuickAccessImagePath
82
+ } ) ;
83
+ }
84
+
53
85
contextMenus . Add ( new Result
54
86
{
55
87
Title = Context . API . GetTranslation ( "plugin_explorer_copypath" ) ,
Original file line number Diff line number Diff line change 42
42
<system : String x : Key =" plugin_explorer_openindexingoptions" >Open Windows Indexing Options</system : String >
43
43
<system : String x : Key =" plugin_explorer_openindexingoptions_subtitle" >Manage indexed files and folders</system : String >
44
44
<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 >
46
+ <system : String x : Key =" plugin_explorer_addfilefoldersuccess" >Successfully Added</system : String >
47
+ <system : String x : Key =" plugin_explorer_addfilefoldersuccess_detail" >Successfully added to Quick Access</system : String >
45
48
46
49
</ResourceDictionary >
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ internal static class Constants
15
15
internal const string ExplorerIconImagePath = "Images\\ explorer.png" ;
16
16
internal const string DifferentUserIconImagePath = "Images\\ user.png" ;
17
17
internal const string IndexingOptionsIconImagePath = "Images\\ windowsindexingoptions.png" ;
18
+ internal const string QuickAccessImagePath = "Images\\ quickaccess.png" ;
18
19
19
20
internal const string ToolTipOpenDirectory = "Ctrl + Enter to open the directory" ;
20
21
You can’t perform that action at this time.
0 commit comments