File tree 3 files changed +25
-1
lines changed
Plugins/Flow.Launcher.Plugin.Explorer
3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,29 @@ public List<Result> LoadContextMenus(Result selectedResult)
140
140
Glyph = new GlyphInfo ( FontFamily : "/Resources/#Segoe Fluent Icons" , Glyph : "\ue8c8 " )
141
141
} ) ;
142
142
143
+ contextMenus . Add ( new Result
144
+ {
145
+ Title = Context . API . GetTranslation ( "plugin_explorer_copyname" ) ,
146
+ SubTitle = Context . API . GetTranslation ( "plugin_explorer_copyname_subtitle" ) ,
147
+ Action = _ =>
148
+ {
149
+ try
150
+ {
151
+ Context . API . CopyToClipboard ( Path . GetFileName ( record . FullPath ) ) ;
152
+ return true ;
153
+ }
154
+ catch ( Exception e )
155
+ {
156
+ var message = "Fail to set text in clipboard" ;
157
+ LogException ( message , e ) ;
158
+ Context . API . ShowMsg ( message ) ;
159
+ return false ;
160
+ }
161
+ } ,
162
+ IcoPath = Constants . CopyImagePath ,
163
+ Glyph = new GlyphInfo ( FontFamily : "/Resources/#Segoe Fluent Icons" , Glyph : "\ue8c8 " )
164
+ } ) ;
165
+
143
166
contextMenus . Add ( new Result
144
167
{
145
168
Title = Context . API . GetTranslation ( "plugin_explorer_copyfilefolder" ) ,
Original file line number Diff line number Diff line change 82
82
<!-- Context menu items -->
83
83
<system : String x : Key =" plugin_explorer_copypath" >Copy path</system : String >
84
84
<system : String x : Key =" plugin_explorer_copypath_subtitle" >Copy path of current item to clipboard</system : String >
85
+ <system : String x : Key =" plugin_explorer_copyname" >Copy name</system : String >
86
+ <system : String x : Key =" plugin_explorer_copyname_subtitle" >Copy name of current item to clipboard</system : String >
85
87
<system : String x : Key =" plugin_explorer_copyfilefolder" >Copy</system : String >
86
88
<system : String x : Key =" plugin_explorer_copyfile_subtitle" >Copy current file to clipboard</system : String >
87
89
<system : String x : Key =" plugin_explorer_copyfolder_subtitle" >Copy current folder to clipboard</system : String >
Original file line number Diff line number Diff line change 8
8
using System . IO ;
9
9
using System . Threading ;
10
10
using System . Threading . Tasks ;
11
- using System . Windows ;
12
11
using System . Windows . Controls ;
13
12
using Flow . Launcher . Plugin . Explorer . Exceptions ;
14
13
You can’t perform that action at this time.
0 commit comments