Add everything plugin context menu and add settings in Url plugin (#2299)

1. Add useful context menu items in everything
2. Add settings in Url plugin, can set browser path

* let url plugin support multi Languages
This commit is contained in:
magicdmer
2018-12-25 15:11:24 +08:00
committed by jhdxr
parent 0baf7744bc
commit a6e82475a3
11 changed files with 200 additions and 4 deletions

View File

@@ -9,6 +9,10 @@
<system:String x:Key="wox_plugin_everything_open_containing_folder">Open parent folder</system:String>
<system:String x:Key="wox_plugin_everything_open_with_editor">Open with {0}</system:String>
<system:String x:Key="wox_plugin_everything_editor_path">Editor Path</system:String>
<system:String x:Key="wox_plugin_everything_copy_path">Copy path</system:String>
<system:String x:Key="wox_plugin_everything_copy">Copy</system:String>
<system:String x:Key="wox_plugin_everything_delete">Delete</system:String>
<system:String x:Key="wox_plugin_everything_canot_delete">Can't delete {0}</system:String>
<system:String x:Key="wox_plugin_everything_plugin_name">Everything</system:String>
<system:String x:Key="wox_plugin_everything_plugin_description">Search on-disk files using Everything</system:String>

View File

@@ -9,6 +9,10 @@
<system:String x:Key="wox_plugin_everything_open_containing_folder">打开所属文件夹</system:String>
<system:String x:Key="wox_plugin_everything_open_with_editor">使用{0}打开</system:String>
<system:String x:Key="wox_plugin_everything_editor_path">编辑器路径</system:String>
<system:String x:Key="wox_plugin_everything_copy_path">拷贝路径</system:String>
<system:String x:Key="wox_plugin_everything_copy">拷贝</system:String>
<system:String x:Key="wox_plugin_everything_delete">删除</system:String>
<system:String x:Key="wox_plugin_everything_canot_delete">无法删除 {0}</system:String>
<system:String x:Key="wox_plugin_everything_plugin_name">Everything</system:String>
<system:String x:Key="wox_plugin_everything_plugin_description">利用 Everything 搜索磁盘文件</system:String>

View File

@@ -211,6 +211,53 @@ namespace Wox.Plugin.Everything
}
}
var icoPath = (record.Type == ResultType.File) ? "Images\\file.png" : "Images\\folder.png";
contextMenus.Add(new Result
{
Title = _context.API.GetTranslation("wox_plugin_everything_copy_path"),
Action = (context) =>
{
Clipboard.SetText(record.FullPath);
return true;
},
IcoPath = icoPath
});
contextMenus.Add(new Result
{
Title = _context.API.GetTranslation("wox_plugin_everything_copy"),
Action = (context) =>
{
Clipboard.SetFileDropList(new System.Collections.Specialized.StringCollection { record.FullPath });
return true;
},
IcoPath = icoPath
});
if (record.Type == ResultType.File || record.Type == ResultType.Folder)
contextMenus.Add(new Result
{
Title = _context.API.GetTranslation("wox_plugin_everything_delete"),
Action = (context) =>
{
try
{
if (record.Type == ResultType.File)
System.IO.File.Delete(record.FullPath);
else
System.IO.Directory.Delete(record.FullPath);
}
catch
{
_context.API.ShowMsg(string.Format(_context.API.GetTranslation("wox_plugin_everything_canot_delete"), record.FullPath), string.Empty, string.Empty);
return false;
}
return true;
},
IcoPath = icoPath
});
return contextMenus;
}