diff --git a/Plugins/Wox.Plugin.CMD/Wox.Plugin.CMD.csproj b/Plugins/Wox.Plugin.CMD/Wox.Plugin.CMD.csproj
index 83d5cd93a4..bb495a5761 100644
--- a/Plugins/Wox.Plugin.CMD/Wox.Plugin.CMD.csproj
+++ b/Plugins/Wox.Plugin.CMD/Wox.Plugin.CMD.csproj
@@ -40,7 +40,7 @@
..\..\packages\log4net.2.0.3\lib\net35-full\log4net.dll
- ..\..\packages\Newtonsoft.Json.6.0.7\lib\net35\Newtonsoft.Json.dll
+ ..\..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll
True
diff --git a/Plugins/Wox.Plugin.CMD/packages.config b/Plugins/Wox.Plugin.CMD/packages.config
index a56b48a806..9b94c8e082 100644
--- a/Plugins/Wox.Plugin.CMD/packages.config
+++ b/Plugins/Wox.Plugin.CMD/packages.config
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/Plugins/Wox.Plugin.Folder/FolderPlugin.cs b/Plugins/Wox.Plugin.Folder/FolderPlugin.cs
index 0d50ce0ca0..32b41578f5 100644
--- a/Plugins/Wox.Plugin.Folder/FolderPlugin.cs
+++ b/Plugins/Wox.Plugin.Folder/FolderPlugin.cs
@@ -31,7 +31,7 @@ namespace Wox.Plugin.Folder
}
}
- private void ApiBackKeyDownEvent(object sender, WoxKeyDownEventArgs e)
+ private void ApiBackKeyDownEvent(WoxKeyDownEventArgs e)
{
string query = e.Query;
if (Directory.Exists(query))
diff --git a/Plugins/Wox.Plugin.Folder/Wox.Plugin.Folder.csproj b/Plugins/Wox.Plugin.Folder/Wox.Plugin.Folder.csproj
index 30cc7ea875..3f7e303731 100644
--- a/Plugins/Wox.Plugin.Folder/Wox.Plugin.Folder.csproj
+++ b/Plugins/Wox.Plugin.Folder/Wox.Plugin.Folder.csproj
@@ -39,9 +39,9 @@
False
..\..\packages\log4net.2.0.3\lib\net35-full\log4net.dll
-
- False
- ..\..\packages\Newtonsoft.Json.6.0.7\lib\net35\Newtonsoft.Json.dll
+
+ ..\..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll
+ True
diff --git a/Plugins/Wox.Plugin.Folder/packages.config b/Plugins/Wox.Plugin.Folder/packages.config
index 6c533b9f5c..8b4715c3c9 100644
--- a/Plugins/Wox.Plugin.Folder/packages.config
+++ b/Plugins/Wox.Plugin.Folder/packages.config
@@ -1,5 +1,5 @@
-
+
\ No newline at end of file
diff --git a/Plugins/Wox.Plugin.PluginManagement/Wox.Plugin.PluginManagement.csproj b/Plugins/Wox.Plugin.PluginManagement/Wox.Plugin.PluginManagement.csproj
index 9a3faefbd1..b7e35ad144 100644
--- a/Plugins/Wox.Plugin.PluginManagement/Wox.Plugin.PluginManagement.csproj
+++ b/Plugins/Wox.Plugin.PluginManagement/Wox.Plugin.PluginManagement.csproj
@@ -35,9 +35,9 @@
false
-
- False
- ..\..\packages\Newtonsoft.Json.6.0.7\lib\net35\Newtonsoft.Json.dll
+
+ ..\..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll
+ True
diff --git a/Plugins/Wox.Plugin.PluginManagement/packages.config b/Plugins/Wox.Plugin.PluginManagement/packages.config
index 4185726464..7a13476a54 100644
--- a/Plugins/Wox.Plugin.PluginManagement/packages.config
+++ b/Plugins/Wox.Plugin.PluginManagement/packages.config
@@ -1,4 +1,4 @@
-
+
\ No newline at end of file
diff --git a/Plugins/Wox.Plugin.Program/Wox.Plugin.Program.csproj b/Plugins/Wox.Plugin.Program/Wox.Plugin.Program.csproj
index fe3ac8026f..62d515d85f 100644
--- a/Plugins/Wox.Plugin.Program/Wox.Plugin.Program.csproj
+++ b/Plugins/Wox.Plugin.Program/Wox.Plugin.Program.csproj
@@ -39,9 +39,9 @@
..\..\packages\log4net.2.0.3\lib\net35-full\log4net.dll
True
-
- ..\..\packages\Newtonsoft.Json.6.0.7\lib\net35\Newtonsoft.Json.dll
- True
+
+ False
+ ..\..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll
diff --git a/Plugins/Wox.Plugin.Program/packages.config b/Plugins/Wox.Plugin.Program/packages.config
index 6c533b9f5c..8b4715c3c9 100644
--- a/Plugins/Wox.Plugin.Program/packages.config
+++ b/Plugins/Wox.Plugin.Program/packages.config
@@ -1,5 +1,5 @@
-
+
\ No newline at end of file
diff --git a/Plugins/Wox.Plugin.QueryHistory/HistoryItem.cs b/Plugins/Wox.Plugin.QueryHistory/HistoryItem.cs
new file mode 100644
index 0000000000..0921a95203
--- /dev/null
+++ b/Plugins/Wox.Plugin.QueryHistory/HistoryItem.cs
@@ -0,0 +1,53 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Wox.Plugin.QueryHistory
+{
+ public class HistoryItem
+ {
+ public string Query { get; set; }
+ public DateTime ExecutedDateTime { get; set; }
+
+ public string GetTimeAgo()
+ {
+ return DateTimeAgo(ExecutedDateTime);
+ }
+
+ private string DateTimeAgo(DateTime dt)
+ {
+ TimeSpan span = DateTime.Now - dt;
+ if (span.Days > 365)
+ {
+ int years = (span.Days / 365);
+ if (span.Days % 365 != 0)
+ years += 1;
+ return String.Format("about {0} {1} ago",
+ years, years == 1 ? "year" : "years");
+ }
+ if (span.Days > 30)
+ {
+ int months = (span.Days / 30);
+ if (span.Days % 31 != 0)
+ months += 1;
+ return String.Format("about {0} {1} ago",
+ months, months == 1 ? "month" : "months");
+ }
+ if (span.Days > 0)
+ return String.Format("about {0} {1} ago",
+ span.Days, span.Days == 1 ? "day" : "days");
+ if (span.Hours > 0)
+ return String.Format("about {0} {1} ago",
+ span.Hours, span.Hours == 1 ? "hour" : "hours");
+ if (span.Minutes > 0)
+ return String.Format("about {0} {1} ago",
+ span.Minutes, span.Minutes == 1 ? "minute" : "minutes");
+ if (span.Seconds > 5)
+ return String.Format("about {0} seconds ago", span.Seconds);
+ if (span.Seconds <= 5)
+ return "just now";
+ return string.Empty;
+ }
+ }
+}
diff --git a/Plugins/Wox.Plugin.QueryHistory/Images/history.png b/Plugins/Wox.Plugin.QueryHistory/Images/history.png
new file mode 100644
index 0000000000..6bb070398f
Binary files /dev/null and b/Plugins/Wox.Plugin.QueryHistory/Images/history.png differ
diff --git a/Plugins/Wox.Plugin.QueryHistory/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.QueryHistory/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000000..dce06522b6
--- /dev/null
+++ b/Plugins/Wox.Plugin.QueryHistory/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的常规信息通过以下
+// 特性集控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("Wox.Plugin.QueryHistory")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Wox.Plugin.QueryHistory")]
+[assembly: AssemblyCopyright("Copyright © 2015")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 使此程序集中的类型
+// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
+// 则将该类型上的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("25ab1bbc-f625-4bf5-a2d0-73313abdaae5")]
+
+// 程序集的版本信息由下面四个值组成:
+//
+// 主版本
+// 次版本
+// 生成号
+// 修订号
+//
+// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
+// 方法是按如下所示使用“*”:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Plugins/Wox.Plugin.QueryHistory/QueryHistory.cs b/Plugins/Wox.Plugin.QueryHistory/QueryHistory.cs
new file mode 100644
index 0000000000..6a77964e18
--- /dev/null
+++ b/Plugins/Wox.Plugin.QueryHistory/QueryHistory.cs
@@ -0,0 +1,51 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+
+namespace Wox.Plugin.QueryHistory
+{
+ public class QueryHistory : IPlugin
+ {
+ private PluginInitContext context;
+
+ public List Query(Query query)
+ {
+ var histories = QueryHistoryStorage.Instance.GetHistory();
+ string filter = query.GetAllRemainingParameter();
+ if (!string.IsNullOrEmpty(filter))
+ {
+ histories = histories.Where(o => o.Query.Contains(filter)).ToList();
+ }
+ return histories.Select(history => new Result()
+ {
+ Title = history.Query,
+ SubTitle = history.GetTimeAgo(),
+ IcoPath = "Images\\history.png",
+ Action = _ =>
+ {
+ context.API.ChangeQuery(history.Query);
+ return false;
+ }
+ }).ToList();
+ }
+
+ public void Init(PluginInitContext context)
+ {
+ this.context = context;
+ context.API.AfterWoxQueryEvent += API_AfterWoxQueryEvent;
+ context.API.BeforeWoxQueryEvent += API_BeforeWoxQueryEvent;
+ }
+
+ void API_BeforeWoxQueryEvent(WoxQueryEventArgs e)
+ {
+ Thread.Sleep(5000);
+ }
+
+ private void API_AfterWoxQueryEvent(WoxQueryEventArgs e)
+ {
+ QueryHistoryStorage.Instance.Add(e.Query.RawQuery);
+ }
+ }
+}
diff --git a/Plugins/Wox.Plugin.QueryHistory/QueryHistoryStorage.cs b/Plugins/Wox.Plugin.QueryHistory/QueryHistoryStorage.cs
new file mode 100644
index 0000000000..3d10f4a491
--- /dev/null
+++ b/Plugins/Wox.Plugin.QueryHistory/QueryHistoryStorage.cs
@@ -0,0 +1,83 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using Newtonsoft.Json;
+using Wox.Core.Exception;
+using Wox.Infrastructure.Storage;
+
+namespace Wox.Plugin.QueryHistory
+{
+ public class QueryHistoryStorage : JsonStrorage
+ {
+ [JsonProperty]
+ private List History = new List();
+
+ private int MaxHistory = 300;
+ private int cursor = 0;
+
+ protected override string ConfigFolder
+ {
+ get { return Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); }
+ }
+
+ protected override string ConfigName
+ {
+ get { return "QueryHistory"; }
+ }
+
+ public HistoryItem Pop()
+ {
+ if (History.Count == 0) return null;
+
+ if (cursor > History.Count - 1)
+ {
+ cursor = History.Count - 1;
+ }
+ if (cursor < 0)
+ {
+ cursor = 0;
+ }
+
+ return History[cursor--];
+ }
+
+ public void Reset()
+ {
+ cursor = History.Count - 1;
+ }
+
+ public void Add(string query)
+ {
+ if (string.IsNullOrEmpty(query)) return;
+ if (History.Count > MaxHistory)
+ {
+ History.RemoveAt(0);
+ }
+
+ if (History.Count > 0 && History.Last().Query == query)
+ {
+ History.Last().ExecutedDateTime = DateTime.Now;
+ }
+ else
+ {
+ History.Add(new HistoryItem()
+ {
+ Query = query,
+ ExecutedDateTime = DateTime.Now
+ });
+ }
+
+ if (History.Count % 5 == 0)
+ {
+ Save();
+ }
+ }
+
+ public List GetHistory()
+ {
+ return History.OrderByDescending(o => o.ExecutedDateTime).ToList();
+ }
+ }
+}
diff --git a/Plugins/Wox.Plugin.QueryHistory/Wox.Plugin.QueryHistory.csproj b/Plugins/Wox.Plugin.QueryHistory/Wox.Plugin.QueryHistory.csproj
new file mode 100644
index 0000000000..9ae22def69
--- /dev/null
+++ b/Plugins/Wox.Plugin.QueryHistory/Wox.Plugin.QueryHistory.csproj
@@ -0,0 +1,92 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {B552DCB6-692E-4B1D-9E0B-9096A2A7E6B0}
+ Library
+ Properties
+ Wox.Plugin.QueryHistory
+ Wox.Plugin.QueryHistory
+ v3.5
+ 512
+ ..\..\
+ true
+
+
+ true
+ full
+ false
+ ..\..\Output\Debug\Plugins\Wox.Plugin.QueryHistory\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ ..\..\Output\Release\Plugins\Wox.Plugin.Program\
+ TRACE
+ prompt
+ 4
+
+
+
+ False
+ ..\..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {B749F0DB-8E75-47DB-9E5E-265D16D0C0D2}
+ Wox.Core
+
+
+ {4fd29318-a8ab-4d8f-aa47-60bc241b8da3}
+ Wox.Infrastructure
+
+
+ {8451ecdd-2ea4-4966-bb0a-7bbc40138e80}
+ Wox.Plugin
+
+
+
+
+
+ PreserveNewest
+
+
+
+
+ PreserveNewest
+
+
+
+
+
+
+ 这台计算机上缺少此项目引用的 NuGet 程序包。启用“NuGet 程序包还原”可下载这些程序包。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。
+
+
+
+
+
\ No newline at end of file
diff --git a/Plugins/Wox.Plugin.QueryHistory/packages.config b/Plugins/Wox.Plugin.QueryHistory/packages.config
new file mode 100644
index 0000000000..7a13476a54
--- /dev/null
+++ b/Plugins/Wox.Plugin.QueryHistory/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/Plugins/Wox.Plugin.QueryHistory/plugin.json b/Plugins/Wox.Plugin.QueryHistory/plugin.json
new file mode 100644
index 0000000000..959874b682
--- /dev/null
+++ b/Plugins/Wox.Plugin.QueryHistory/plugin.json
@@ -0,0 +1,12 @@
+{
+ "ID":"54F327C503414B9489CDD331EE9472EF",
+ "ActionKeyword":"history",
+ "Name":"Query History",
+ "Description":"Remember Wox query history",
+ "Author":"qianlifeng",
+ "Version":"1.0.0",
+ "Language":"csharp",
+ "Website":"http://www.getwox.com/plugin",
+ "ExecuteFileName":"Wox.Plugin.QueryHistory.dll",
+ "IcoPath":"Images\\history.png"
+}
\ No newline at end of file
diff --git a/Plugins/Wox.Plugin.WebSearch/WebSearchPlugin.cs b/Plugins/Wox.Plugin.WebSearch/WebSearchPlugin.cs
index f7bd002aa5..11989fb32c 100644
--- a/Plugins/Wox.Plugin.WebSearch/WebSearchPlugin.cs
+++ b/Plugins/Wox.Plugin.WebSearch/WebSearchPlugin.cs
@@ -44,7 +44,7 @@ namespace Wox.Plugin.WebSearch
return true;
}
}
- });
+ },true);
if (UserSettingStorage.Instance.EnableWebSearchSuggestion && !string.IsNullOrEmpty(keyword))
{
diff --git a/Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj b/Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj
index fbace415a0..a78368bfa1 100644
--- a/Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj
+++ b/Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj
@@ -41,7 +41,7 @@
False
- ..\..\packages\Newtonsoft.Json.6.0.7\lib\net35\Newtonsoft.Json.dll
+ ..\..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll
diff --git a/Plugins/Wox.Plugin.WebSearch/packages.config b/Plugins/Wox.Plugin.WebSearch/packages.config
index 6c533b9f5c..8b4715c3c9 100644
--- a/Plugins/Wox.Plugin.WebSearch/packages.config
+++ b/Plugins/Wox.Plugin.WebSearch/packages.config
@@ -1,5 +1,5 @@
-
+
\ No newline at end of file
diff --git a/Wox.Core/Plugin/QueryDispatcher/SystemPluginQueryDispatcher.cs b/Wox.Core/Plugin/QueryDispatcher/SystemPluginQueryDispatcher.cs
index c69e591328..e8ef1ee4fe 100644
--- a/Wox.Core/Plugin/QueryDispatcher/SystemPluginQueryDispatcher.cs
+++ b/Wox.Core/Plugin/QueryDispatcher/SystemPluginQueryDispatcher.cs
@@ -16,15 +16,6 @@ namespace Wox.Core.Plugin.QueryDispatcher
public void Dispatch(Query query)
{
var queryPlugins = allSytemPlugins;
- if (UserSettingStorage.Instance.WebSearches.Exists(o => o.ActionWord == query.ActionName && o.Enabled))
- {
- //websearch mode
- queryPlugins = new List()
- {
- allSytemPlugins.First(o => o.Metadata.ID == "565B73353DBF4806919830B9202EE3BF")
- };
- }
-
foreach (PluginPair pair in queryPlugins)
{
PluginPair pair1 = pair;
diff --git a/Wox.Core/UserSettings/UserSettingStorage.cs b/Wox.Core/UserSettings/UserSettingStorage.cs
index 100d7c4fde..9b1af13a61 100644
--- a/Wox.Core/UserSettings/UserSettingStorage.cs
+++ b/Wox.Core/UserSettings/UserSettingStorage.cs
@@ -167,7 +167,14 @@ namespace Wox.Core.UserSettings
OpacityMode = OpacityMode.Normal;
LeaveCmdOpen = false;
HideWhenDeactive = false;
-
+ CustomPluginHotkeys = new List()
+ {
+ new CustomPluginHotkey()
+ {
+ ActionKeyword = "history ",
+ Hotkey = "Alt + H"
+ }
+ };
return this;
}
diff --git a/Wox.Core/Wox.Core.csproj b/Wox.Core/Wox.Core.csproj
index 05aff0cd08..87cbaa4e5b 100644
--- a/Wox.Core/Wox.Core.csproj
+++ b/Wox.Core/Wox.Core.csproj
@@ -41,7 +41,7 @@
False
- ..\packages\Newtonsoft.Json.6.0.7\lib\net35\Newtonsoft.Json.dll
+ ..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll
diff --git a/Wox.Core/packages.config b/Wox.Core/packages.config
index 6311fc40d5..09e1c4eff1 100644
--- a/Wox.Core/packages.config
+++ b/Wox.Core/packages.config
@@ -1,5 +1,5 @@
-
+
\ No newline at end of file
diff --git a/Wox.Infrastructure/Wox.Infrastructure.csproj b/Wox.Infrastructure/Wox.Infrastructure.csproj
index fdb44026ea..1e897d3d26 100644
--- a/Wox.Infrastructure/Wox.Infrastructure.csproj
+++ b/Wox.Infrastructure/Wox.Infrastructure.csproj
@@ -44,7 +44,7 @@
False
- ..\packages\Newtonsoft.Json.6.0.7\lib\net35\Newtonsoft.Json.dll
+ ..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll
diff --git a/Wox.Infrastructure/packages.config b/Wox.Infrastructure/packages.config
index 6c533b9f5c..8b4715c3c9 100644
--- a/Wox.Infrastructure/packages.config
+++ b/Wox.Infrastructure/packages.config
@@ -1,5 +1,5 @@
-
+
\ No newline at end of file
diff --git a/Wox.Plugin/EventHandler.cs b/Wox.Plugin/EventHandler.cs
index f3ef7e2e2d..f3c6121f92 100644
--- a/Wox.Plugin/EventHandler.cs
+++ b/Wox.Plugin/EventHandler.cs
@@ -6,7 +6,8 @@ using System.Windows.Input;
namespace Wox.Plugin
{
- public delegate void WoxKeyDownEventHandler(object sender, WoxKeyDownEventArgs e);
+ public delegate void WoxKeyDownEventHandler(WoxKeyDownEventArgs e);
+ public delegate void AfterWoxQueryEventHandler(WoxQueryEventArgs e);
///
/// Global keyboard events
@@ -22,4 +23,9 @@ namespace Wox.Plugin
public string Query { get; set; }
public KeyEventArgs keyEventArgs { get; set; }
}
+
+ public class WoxQueryEventArgs
+ {
+ public Query Query { get; set; }
+ }
}
diff --git a/Wox.Plugin/IPublicAPI.cs b/Wox.Plugin/IPublicAPI.cs
index 231faf4a7f..9188d9afd3 100644
--- a/Wox.Plugin/IPublicAPI.cs
+++ b/Wox.Plugin/IPublicAPI.cs
@@ -12,7 +12,8 @@ namespace Wox.Plugin
///
///
///
- void PushResults(Query query,PluginMetadata plugin, List results);
+ ///
+ void PushResults(Query query,PluginMetadata plugin, List results,bool clearBeforeInsert = false);
bool ShellRun(string cmd, bool runAsAdministrator = false);
@@ -43,5 +44,15 @@ namespace Wox.Plugin
event WoxKeyDownEventHandler BackKeyDownEvent;
event WoxGlobalKeyboardEventHandler GlobalKeyboardEvent;
+
+ ///
+ /// fired after wox execute a query
+ ///
+ event AfterWoxQueryEventHandler AfterWoxQueryEvent;
+
+ ///
+ /// fired before wox start to execute a query
+ ///
+ event AfterWoxQueryEventHandler BeforeWoxQueryEvent;
}
}
diff --git a/Wox.Test/Wox.Test.csproj b/Wox.Test/Wox.Test.csproj
index 122f1f9520..8ddecc0bac 100644
--- a/Wox.Test/Wox.Test.csproj
+++ b/Wox.Test/Wox.Test.csproj
@@ -39,9 +39,9 @@
..\packages\Moq.4.2.1409.1722\lib\net35\Moq.dll
True
-
+
False
- ..\packages\NUnit.2.6.3\lib\nunit.framework.dll
+ ..\packages\NUnit.2.6.4\lib\nunit.framework.dll
diff --git a/Wox.Test/packages.config b/Wox.Test/packages.config
index 27bc1f3865..565203e846 100644
--- a/Wox.Test/packages.config
+++ b/Wox.Test/packages.config
@@ -1,5 +1,5 @@
-
+
\ No newline at end of file
diff --git a/Wox.sln b/Wox.sln
index 089fe39c81..cd2007ff85 100644
--- a/Wox.sln
+++ b/Wox.sln
@@ -39,6 +39,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.Color", "Plugins
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.CrashReporter", "Wox.CrashReporter\Wox.CrashReporter.csproj", "{2FEB2298-7653-4009-B1EA-FFFB1A768BCC}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.QueryHistory", "Plugins\Wox.Plugin.QueryHistory\Wox.Plugin.QueryHistory.csproj", "{B552DCB6-692E-4B1D-9E0B-9096A2A7E6B0}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -113,6 +115,10 @@ Global
{2FEB2298-7653-4009-B1EA-FFFB1A768BCC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2FEB2298-7653-4009-B1EA-FFFB1A768BCC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2FEB2298-7653-4009-B1EA-FFFB1A768BCC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B552DCB6-692E-4B1D-9E0B-9096A2A7E6B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B552DCB6-692E-4B1D-9E0B-9096A2A7E6B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B552DCB6-692E-4B1D-9E0B-9096A2A7E6B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B552DCB6-692E-4B1D-9E0B-9096A2A7E6B0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -129,5 +135,6 @@ Global
{0B9DE348-9361-4940-ADB6-F5953BFFCCEC} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
{A3DCCBCA-ACC1-421D-B16E-210896234C26} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
{F35190AA-4758-4D9E-A193-E3BDF6AD3567} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
+ {B552DCB6-692E-4B1D-9E0B-9096A2A7E6B0} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
EndGlobalSection
EndGlobal
diff --git a/Wox/MainWindow.xaml.cs b/Wox/MainWindow.xaml.cs
index a61d37ff83..e80c981372 100644
--- a/Wox/MainWindow.xaml.cs
+++ b/Wox/MainWindow.xaml.cs
@@ -132,8 +132,10 @@ namespace Wox
public event WoxKeyDownEventHandler BackKeyDownEvent;
public event WoxGlobalKeyboardEventHandler GlobalKeyboardEvent;
+ public event AfterWoxQueryEventHandler AfterWoxQueryEvent;
+ public event AfterWoxQueryEventHandler BeforeWoxQueryEvent;
- public void PushResults(Query query, PluginMetadata plugin, List results)
+ public void PushResults(Query query, PluginMetadata plugin, List results, bool clearBeforeInsert = false)
{
results.ForEach(o =>
{
@@ -147,7 +149,7 @@ namespace Wox
}
o.OriginQuery = query;
});
- OnUpdateResultView(results);
+ OnUpdateResultView(results, clearBeforeInsert);
}
#endregion
@@ -360,6 +362,7 @@ namespace Wox
}, TimeSpan.FromMilliseconds(100), null);
queryHasReturn = false;
var q = new Query(lastQuery);
+ FireBeforeWoxQueryEvent(q);
Query(q);
BackToResultMode();
Dispatcher.DelayInvoke("ShowProgressbar", originQuery =>
@@ -369,9 +372,42 @@ namespace Wox
StartProgress();
}
}, TimeSpan.FromMilliseconds(150), lastQuery);
+ FireAfterWoxQueryEvent(q);
}, TimeSpan.FromMilliseconds(ShouldNotDelayQuery ? 0 : 200));
}
+ private void FireAfterWoxQueryEvent(Query q)
+ {
+ if (AfterWoxQueryEvent != null)
+ {
+ //We shouldn't let those events slow down real query
+ //so I put it in the new thread
+ ThreadPool.QueueUserWorkItem(o =>
+ {
+ AfterWoxQueryEvent(new WoxQueryEventArgs()
+ {
+ Query = q
+ });
+ });
+ }
+ }
+
+ private void FireBeforeWoxQueryEvent(Query q)
+ {
+ if (BeforeWoxQueryEvent != null)
+ {
+ //We shouldn't let those events slow down real query
+ //so I put it in the new thread
+ ThreadPool.QueueUserWorkItem(o =>
+ {
+ BeforeWoxQueryEvent(new WoxQueryEventArgs()
+ {
+ Query = q
+ });
+ });
+ }
+ }
+
private void Query(Query q)
{
try
@@ -532,7 +568,7 @@ namespace Wox
case Key.Back:
if (BackKeyDownEvent != null)
{
- BackKeyDownEvent(tbQuery, new WoxKeyDownEventArgs()
+ BackKeyDownEvent(new WoxKeyDownEventArgs()
{
Query = tbQuery.Text,
keyEventArgs = e
@@ -623,7 +659,7 @@ namespace Wox
}
}
- private void OnUpdateResultView(List list)
+ private void OnUpdateResultView(List list, bool clearBeforeInsert = false)
{
queryHasReturn = true;
progressBar.Dispatcher.Invoke(new Action(StopProgress));
@@ -639,8 +675,13 @@ namespace Wox
});
List l = list.Where(o => o.OriginQuery != null && o.OriginQuery.RawQuery == lastQuery).ToList();
Dispatcher.Invoke(new Action(() =>
- pnlResult.AddResults(l))
- );
+ {
+ if (clearBeforeInsert)
+ {
+ pnlResult.Clear();
+ }
+ pnlResult.AddResults(l);
+ }));
}
}
diff --git a/Wox/Wox.csproj b/Wox/Wox.csproj
index 159ee42067..3de730a3c6 100644
--- a/Wox/Wox.csproj
+++ b/Wox/Wox.csproj
@@ -72,14 +72,14 @@
False
- ..\packages\Newtonsoft.Json.6.0.7\lib\net35\Newtonsoft.Json.dll
+ ..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll
-
- ..\packages\NHotkey.1.1.0.0\lib\NHotkey.dll
- True
+
+ False
+ ..\packages\NHotkey.1.2.1\lib\net20\NHotkey.dll
- ..\packages\NHotkey.Wpf.1.1.0.0\lib\NHotkey.Wpf.dll
+ ..\packages\NHotkey.Wpf.1.2.1\lib\net35\NHotkey.Wpf.dll
True
diff --git a/Wox/packages.config b/Wox/packages.config
index 3db4249dc3..5c9cf4a6fb 100644
--- a/Wox/packages.config
+++ b/Wox/packages.config
@@ -2,8 +2,8 @@
-
-
-
+
+
+
\ No newline at end of file