diff --git a/Plugins/Wox.Plugin.Everything/Languages/en.xaml b/Plugins/Wox.Plugin.Everything/Languages/en.xaml
index 46f8bc5225..4e94146604 100644
--- a/Plugins/Wox.Plugin.Everything/Languages/en.xaml
+++ b/Plugins/Wox.Plugin.Everything/Languages/en.xaml
@@ -9,6 +9,10 @@
Open parent folder
Open with {0}
Editor Path
+ Copy path
+ Copy
+ Delete
+ Can't delete {0}
Everything
Search on-disk files using Everything
diff --git a/Plugins/Wox.Plugin.Everything/Languages/zh-cn.xaml b/Plugins/Wox.Plugin.Everything/Languages/zh-cn.xaml
index 9e192172f4..6b57eed286 100644
--- a/Plugins/Wox.Plugin.Everything/Languages/zh-cn.xaml
+++ b/Plugins/Wox.Plugin.Everything/Languages/zh-cn.xaml
@@ -9,6 +9,10 @@
打开所属文件夹
使用{0}打开
编辑器路径
+ 拷贝路径
+ 拷贝
+ 删除
+ 无法删除 {0}
Everything
利用 Everything 搜索磁盘文件
diff --git a/Plugins/Wox.Plugin.Everything/Main.cs b/Plugins/Wox.Plugin.Everything/Main.cs
index f050154d67..7969a079fe 100644
--- a/Plugins/Wox.Plugin.Everything/Main.cs
+++ b/Plugins/Wox.Plugin.Everything/Main.cs
@@ -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;
}
diff --git a/Plugins/Wox.Plugin.Url/Languages/en.xaml b/Plugins/Wox.Plugin.Url/Languages/en.xaml
index eec48e692b..6f408e0ca7 100644
--- a/Plugins/Wox.Plugin.Url/Languages/en.xaml
+++ b/Plugins/Wox.Plugin.Url/Languages/en.xaml
@@ -8,4 +8,8 @@
URL
Open the typed URL from Wox
+ Please set your browser path:
+ Choose
+ Apply
+ Application(*.exe)|*.exe|All files|*.*
\ No newline at end of file
diff --git a/Plugins/Wox.Plugin.Url/Languages/zh-cn.xaml b/Plugins/Wox.Plugin.Url/Languages/zh-cn.xaml
index d44f845570..e563536251 100644
--- a/Plugins/Wox.Plugin.Url/Languages/zh-cn.xaml
+++ b/Plugins/Wox.Plugin.Url/Languages/zh-cn.xaml
@@ -8,4 +8,8 @@
URL
从Wox打开链接
+ 请设置你的浏览器路径:
+ 选择
+ 应用
+ 程序文件(*.exe)|*.exe|所有文件|*.*
\ No newline at end of file
diff --git a/Plugins/Wox.Plugin.Url/Main.cs b/Plugins/Wox.Plugin.Url/Main.cs
index 80758c97fb..6cd486919b 100644
--- a/Plugins/Wox.Plugin.Url/Main.cs
+++ b/Plugins/Wox.Plugin.Url/Main.cs
@@ -2,10 +2,12 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Text.RegularExpressions;
+using System.Windows.Controls;
+using Wox.Infrastructure.Storage;
namespace Wox.Plugin.Url
{
- public class Main : IPlugin, IPluginI18n
+ public class Main : ISettingProvider,IPlugin, IPluginI18n, ISavable
{
//based on https://gist.github.com/dperini/729294
private const string urlPattern = "^" +
@@ -42,6 +44,19 @@ namespace Wox.Plugin.Url
"$";
Regex reg = new Regex(urlPattern, RegexOptions.Compiled | RegexOptions.IgnoreCase);
private PluginInitContext context;
+ private readonly Settings _settings;
+ private readonly PluginJsonStorage _storage;
+
+ public Main()
+ {
+ _storage = new PluginJsonStorage();
+ _settings = _storage.Load();
+ }
+
+ public void Save()
+ {
+ _storage.Save();
+ }
public List Query(Query query)
{
@@ -64,7 +79,15 @@ namespace Wox.Plugin.Url
}
try
{
- Process.Start(raw);
+ if (_settings.BrowserPath.Length == 0)
+ {
+ Process.Start(raw);
+ }
+ else
+ {
+ Process.Start(_settings.BrowserPath,raw);
+ }
+
return true;
}
catch(Exception ex)
@@ -79,6 +102,12 @@ namespace Wox.Plugin.Url
return new List(0);
}
+
+ public Control CreateSettingPanel()
+ {
+ return new SettingsControl(context.API,_settings);
+ }
+
public bool IsURL(string raw)
{
raw = raw.ToLower();
diff --git a/Plugins/Wox.Plugin.Url/Settings.cs b/Plugins/Wox.Plugin.Url/Settings.cs
new file mode 100644
index 0000000000..8dce1770d7
--- /dev/null
+++ b/Plugins/Wox.Plugin.Url/Settings.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Wox.Plugin.Url
+{
+ public class Settings
+ {
+ public string BrowserPath { get; set; }
+ }
+}
diff --git a/Plugins/Wox.Plugin.Url/SettingsControl.xaml b/Plugins/Wox.Plugin.Url/SettingsControl.xaml
new file mode 100644
index 0000000000..ea607cdc52
--- /dev/null
+++ b/Plugins/Wox.Plugin.Url/SettingsControl.xaml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Plugins/Wox.Plugin.Url/SettingsControl.xaml.cs b/Plugins/Wox.Plugin.Url/SettingsControl.xaml.cs
new file mode 100644
index 0000000000..ea6fa26d6f
--- /dev/null
+++ b/Plugins/Wox.Plugin.Url/SettingsControl.xaml.cs
@@ -0,0 +1,53 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using Microsoft.Win32;
+
+
+namespace Wox.Plugin.Url
+{
+ ///
+ /// SettingsControl.xaml 的交互逻辑
+ ///
+ public partial class SettingsControl : UserControl
+ {
+ private Settings _settings;
+ private IPublicAPI _woxAPI;
+
+ public SettingsControl(IPublicAPI woxAPI,Settings settings)
+ {
+ InitializeComponent();
+ _settings = settings;
+ _woxAPI = woxAPI;
+ browserPathBox.Text = _settings.BrowserPath;
+ }
+
+ private void OnApplyBTClick(object sender, RoutedEventArgs e)
+ {
+ _settings.BrowserPath = browserPathBox.Text;
+ }
+
+ private void OnChooseClick(object sender, RoutedEventArgs e)
+ {
+ var fileBrowserDialog = new OpenFileDialog();
+ fileBrowserDialog.Filter = _woxAPI.GetTranslation("wox_plugin_url_plugin_filter"); ;
+ fileBrowserDialog.CheckFileExists = true;
+ fileBrowserDialog.CheckPathExists = true;
+ if (fileBrowserDialog.ShowDialog() == true)
+ {
+ browserPathBox.Text = fileBrowserDialog.FileName;
+ }
+ }
+ }
+}
diff --git a/Plugins/Wox.Plugin.Url/Wox.Plugin.Url.csproj b/Plugins/Wox.Plugin.Url/Wox.Plugin.Url.csproj
index 53bb9fb592..ee0e09c18f 100644
--- a/Plugins/Wox.Plugin.Url/Wox.Plugin.Url.csproj
+++ b/Plugins/Wox.Plugin.Url/Wox.Plugin.Url.csproj
@@ -37,9 +37,12 @@
..\..\packages\JetBrains.Annotations.10.3.0\lib\net\JetBrains.Annotations.dll
True
+
+
+
@@ -47,6 +50,10 @@
+
+
+ SettingsControl.xaml
+
@@ -104,6 +111,12 @@
PreserveNewest
+
+
+ Designer
+ MSBuild:Compile
+
+
Hotkey
diff --git a/Wox/Languages/zh-cn.xaml b/Wox/Languages/zh-cn.xaml
index 9b3bff0c7c..5e9570d543 100644
--- a/Wox/Languages/zh-cn.xaml
+++ b/Wox/Languages/zh-cn.xaml
@@ -52,6 +52,8 @@
结果项字体
窗口模式
透明度
+ 无法找到主题 {0} ,切换为默认主题
+ 无法加载主题 {0} ,切换为默认主题
热键
diff --git a/Wox/ResultListBox.xaml b/Wox/ResultListBox.xaml
index ad6a22e877..cad02d5198 100644
--- a/Wox/ResultListBox.xaml
+++ b/Wox/ResultListBox.xaml
@@ -16,7 +16,8 @@
KeyboardNavigation.DirectionalNavigation="Cycle" SelectionMode="Single"
VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Standard"
SelectionChanged="OnSelectionChanged"
- IsSynchronizedWithCurrentItem="True">
+ IsSynchronizedWithCurrentItem="True"
+ PreviewMouseDown="ListBox_PreviewMouseDown">
@@ -65,6 +66,7 @@
-
\ No newline at end of file
+
diff --git a/Wox/ResultListBox.xaml.cs b/Wox/ResultListBox.xaml.cs
index ce6de8afb4..d448d02ca9 100644
--- a/Wox/ResultListBox.xaml.cs
+++ b/Wox/ResultListBox.xaml.cs
@@ -1,4 +1,5 @@
using System.Runtime.Remoting.Contexts;
+using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
@@ -7,6 +8,8 @@ namespace Wox
[Synchronization]
public partial class ResultListBox
{
+ private Point _lastpos;
+ private ListBoxItem curItem = null;
public ResultListBox()
{
InitializeComponent();
@@ -22,7 +25,26 @@ namespace Wox
private void OnMouseEnter(object sender, MouseEventArgs e)
{
- ((ListBoxItem) sender).IsSelected = true;
+ curItem = (ListBoxItem)sender;
+ var p = e.GetPosition((IInputElement)sender);
+ _lastpos = p;
+ }
+
+ private void OnMouseMove(object sender, MouseEventArgs e)
+ {
+ var p = e.GetPosition((IInputElement)sender);
+ if (_lastpos != p)
+ {
+ ((ListBoxItem) sender).IsSelected = true;
+ }
+ }
+
+ private void ListBox_PreviewMouseDown(object sender, MouseButtonEventArgs e)
+ {
+ if (curItem != null)
+ {
+ curItem.IsSelected = true;
+ }
}
}
-}
\ No newline at end of file
+}
diff --git a/Wox/Themes/BlurBlack.xaml b/Wox/Themes/BlurBlack.xaml
index ebd1ef0df7..488048cf44 100644
--- a/Wox/Themes/BlurBlack.xaml
+++ b/Wox/Themes/BlurBlack.xaml
@@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
-
+
True
diff --git a/Wox/Themes/BlurWhite.xaml b/Wox/Themes/BlurWhite.xaml
index 4c52ee4d39..2fe9e3185f 100644
--- a/Wox/Themes/BlurWhite.xaml
+++ b/Wox/Themes/BlurWhite.xaml
@@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
-
+
True
diff --git a/Wox/Themes/Dark.xaml b/Wox/Themes/Dark.xaml
index 9ef1609b2b..5bd54b0eda 100644
--- a/Wox/Themes/Dark.xaml
+++ b/Wox/Themes/Dark.xaml
@@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
-
+