From 7b386c4f412b328b47a9e8b7481574f4cf20e57f Mon Sep 17 00:00:00 2001 From: bao-qian Date: Sun, 29 Nov 2015 08:20:13 +0000 Subject: [PATCH 01/18] Fix FindResource http://windowsasusual.blogspot.ie/2015/10/wpf-applicationcurrentfindresource-and.html --- Wox.Core/Theme/Theme.cs | 13 ++++--------- Wox.Core/i18n/Internationalization.cs | 11 +++-------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/Wox.Core/Theme/Theme.cs b/Wox.Core/Theme/Theme.cs index e9f55a83a..9475a9fa2 100644 --- a/Wox.Core/Theme/Theme.cs +++ b/Wox.Core/Theme/Theme.cs @@ -59,16 +59,11 @@ namespace Wox.Core.Theme UserSettingStorage.Instance.Save(); ResourceMerger.UpdateResource(this); - try - { - var isBlur = Application.Current.FindResource("ThemeBlurEnabled"); - if (isBlur is bool) - { - SetBlurForWindow(Application.Current.MainWindow, (bool)isBlur); - } - } - catch (ResourceReferenceKeyNotFoundException e) + // Exception of FindResource can't be cathed if global exception handle is set + var isBlur = Application.Current.TryFindResource("ThemeBlurEnabled"); + if (isBlur is bool) { + SetBlurForWindow(Application.Current.MainWindow, (bool)isBlur); } } diff --git a/Wox.Core/i18n/Internationalization.cs b/Wox.Core/i18n/Internationalization.cs index 5ce242f18..f2ad412da 100644 --- a/Wox.Core/i18n/Internationalization.cs +++ b/Wox.Core/i18n/Internationalization.cs @@ -88,20 +88,15 @@ namespace Wox.Core.i18n public string GetTranslation(string key) { - try + var translation = Application.Current.TryFindResource(key); + if (translation is string) { - object translation = Application.Current.FindResource(key); - if (translation == null) - { - return "NoTranslation"; - } return translation.ToString(); } - catch + else { return "NoTranslation"; } - } private string GetLanguagePath(string languageCode) From 8b8a3033651296e0b636450d3d9308a978e7bc17 Mon Sep 17 00:00:00 2001 From: bao-qian Date: Sun, 29 Nov 2015 08:50:17 +0000 Subject: [PATCH 02/18] Fix hardcode Fix #385 --- Plugins/Wox.Plugin.CMD/CMD.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Plugins/Wox.Plugin.CMD/CMD.cs b/Plugins/Wox.Plugin.CMD/CMD.cs index 786ad9ab6..99b18559d 100644 --- a/Plugins/Wox.Plugin.CMD/CMD.cs +++ b/Plugins/Wox.Plugin.CMD/CMD.cs @@ -176,8 +176,7 @@ namespace Wox.Plugin.CMD private void OnWinRPressed() { context.API.ShowApp(); - // todo don't hardcode action keywords. - context.API.ChangeQuery($">{Plugin.Query.TermSeperater}"); + context.API.ChangeQuery($"{context.CurrentPluginMetadata.ActionKeywords[0]}{Plugin.Query.TermSeperater}"); } public Control CreateSettingPanel() From 547bd46bb3e5272ca10edb4c559fb540f5af10b6 Mon Sep 17 00:00:00 2001 From: bao-qian Date: Sun, 29 Nov 2015 12:47:04 +0000 Subject: [PATCH 03/18] Disable blur when os is not supported Releated: #330 --- Wox.Core/Theme/Theme.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Wox.Core/Theme/Theme.cs b/Wox.Core/Theme/Theme.cs index 9475a9fa2..1317b5f9c 100644 --- a/Wox.Core/Theme/Theme.cs +++ b/Wox.Core/Theme/Theme.cs @@ -168,10 +168,13 @@ namespace Wox.Core.Theme /// Sets the blur for a window via SetWindowCompositionAttribute /// /// window to blur - /// true/false - on or off correspondingly - private void SetBlurForWindow(Window wind, bool status) + /// true/false - on or off correspondingly + private void SetBlurForWindow(Window wind, bool isBlur) { - SetWindowAccent(wind, status ? AccentState.ACCENT_ENABLE_BLURBEHIND : AccentState.ACCENT_DISABLED); + if (isBlur) + { + SetWindowAccent(wind, AccentState.ACCENT_ENABLE_BLURBEHIND); + } } private void SetWindowAccent(Window wind, AccentState themeAccentMode) From cbc3cfc33b54010b48f2e237b008a6808f34c364 Mon Sep 17 00:00:00 2001 From: bao-qian Date: Mon, 30 Nov 2015 19:49:46 +0000 Subject: [PATCH 04/18] Fix duplication of tray icons Fix #413 --- Wox/MainWindow.xaml.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Wox/MainWindow.xaml.cs b/Wox/MainWindow.xaml.cs index 39cf8b3c7..aef06b9eb 100644 --- a/Wox/MainWindow.xaml.cs +++ b/Wox/MainWindow.xaml.cs @@ -80,6 +80,7 @@ namespace Wox public void CloseApp() { + notifyIcon.Visible = false; Application.Current.Shutdown(); } From d5b6744a41b4cf36616fe8bd15240a50ac6cd987 Mon Sep 17 00:00:00 2001 From: bao-qian Date: Mon, 30 Nov 2015 21:57:07 +0000 Subject: [PATCH 05/18] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a993a059b..4b5fd6046 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Simple Usage Contribute ========= -If you are a developer, please feel free to send a pull request to the **Dev** branch. We still have a lot of features and bugs to resolve. Take a look at [issues page](https://github.com/Wox-launcher/Wox/issues) if you want to contribute :) +If you are a developer, please feel free to send a pull request to the **Dev** branch. We still have a lot of features and bugs to resolve. Take a look at [issues page](https://github.com/Wox-launcher/Wox/issues), especially for [help_needed](https://github.com/Wox-launcher/Wox/issues?q=is%3Aopen+is%3Aissue+label%3Ahelp_needed) labeled issue. :) If you are not a developer, please install the [Latest build](https://ci.appveyor.com/project/qianlifeng/wox/history) and report bugs (how to: [English](https://github.com/Wox-launcher/Wox/wiki/FAQ-English) [中文](https://github.com/Wox-launcher/Wox/wiki/FAQ-%E4%B8%AD%E6%96%87)). Feedback is always welcome! From 29f535da9439005fed4a5bc3cec5caec970c8808 Mon Sep 17 00:00:00 2001 From: bao-qian Date: Mon, 30 Nov 2015 22:44:58 +0000 Subject: [PATCH 06/18] Upgrade json package --- Plugins/Wox.Plugin.CMD/Wox.Plugin.CMD.csproj | 7 ++--- Plugins/Wox.Plugin.CMD/packages.config | 2 +- .../Wox.Plugin.Everything.csproj | 6 ++--- Plugins/Wox.Plugin.Everything/packages.config | 2 +- .../Wox.Plugin.Folder.csproj | 4 +-- Plugins/Wox.Plugin.Folder/packages.config | 2 +- .../Wox.Plugin.PluginManagement.csproj | 4 +-- .../packages.config | 2 +- .../Wox.Plugin.Program.csproj | 6 ++--- Plugins/Wox.Plugin.Program/packages.config | 2 +- .../Wox.Plugin.WebSearch.csproj | 6 ++--- Plugins/Wox.Plugin.WebSearch/packages.config | 2 +- Wox.Core/Wox.Core.csproj | 8 +++--- Wox.Core/packages.config | 2 +- Wox.Infrastructure/Wox.Infrastructure.csproj | 8 +++--- Wox.Infrastructure/packages.config | 2 +- .../Wox.UpdateFeedGenerator.csproj | 6 ++--- Wox.UpdateFeedGenerator/packages.config | 2 +- Wox/App.config | 4 +++ Wox/Wox.csproj | 27 ++++++++++++++----- Wox/packages.config | 2 +- 21 files changed, 63 insertions(+), 43 deletions(-) diff --git a/Plugins/Wox.Plugin.CMD/Wox.Plugin.CMD.csproj b/Plugins/Wox.Plugin.CMD/Wox.Plugin.CMD.csproj index b0b1fd0df..1d6384003 100644 --- a/Plugins/Wox.Plugin.CMD/Wox.Plugin.CMD.csproj +++ b/Plugins/Wox.Plugin.CMD/Wox.Plugin.CMD.csproj @@ -34,8 +34,8 @@ false - - ..\..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll + + ..\..\packages\Newtonsoft.Json.7.0.1\lib\net35\Newtonsoft.Json.dll True @@ -48,8 +48,9 @@ - + ..\..\packages\InputSimulator.1.0.4.0\lib\net20\WindowsInput.dll + True diff --git a/Plugins/Wox.Plugin.CMD/packages.config b/Plugins/Wox.Plugin.CMD/packages.config index 4687456d1..838721e88 100644 --- a/Plugins/Wox.Plugin.CMD/packages.config +++ b/Plugins/Wox.Plugin.CMD/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Everything/Wox.Plugin.Everything.csproj b/Plugins/Wox.Plugin.Everything/Wox.Plugin.Everything.csproj index 586aa2233..8a76c3216 100644 --- a/Plugins/Wox.Plugin.Everything/Wox.Plugin.Everything.csproj +++ b/Plugins/Wox.Plugin.Everything/Wox.Plugin.Everything.csproj @@ -35,9 +35,9 @@ - - False - ..\..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll + + ..\..\packages\Newtonsoft.Json.7.0.1\lib\net35\Newtonsoft.Json.dll + True diff --git a/Plugins/Wox.Plugin.Everything/packages.config b/Plugins/Wox.Plugin.Everything/packages.config index 7a13476a5..9b49c9e22 100644 --- a/Plugins/Wox.Plugin.Everything/packages.config +++ b/Plugins/Wox.Plugin.Everything/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Folder/Wox.Plugin.Folder.csproj b/Plugins/Wox.Plugin.Folder/Wox.Plugin.Folder.csproj index 50b66b365..78e2830a2 100644 --- a/Plugins/Wox.Plugin.Folder/Wox.Plugin.Folder.csproj +++ b/Plugins/Wox.Plugin.Folder/Wox.Plugin.Folder.csproj @@ -34,8 +34,8 @@ false - - ..\..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll + + ..\..\packages\Newtonsoft.Json.7.0.1\lib\net35\Newtonsoft.Json.dll True diff --git a/Plugins/Wox.Plugin.Folder/packages.config b/Plugins/Wox.Plugin.Folder/packages.config index 7a13476a5..9b49c9e22 100644 --- a/Plugins/Wox.Plugin.Folder/packages.config +++ b/Plugins/Wox.Plugin.Folder/packages.config @@ -1,4 +1,4 @@  - + \ 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 089c4d9ae..3870480f3 100644 --- a/Plugins/Wox.Plugin.PluginManagement/Wox.Plugin.PluginManagement.csproj +++ b/Plugins/Wox.Plugin.PluginManagement/Wox.Plugin.PluginManagement.csproj @@ -34,8 +34,8 @@ false - - ..\..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll + + ..\..\packages\Newtonsoft.Json.7.0.1\lib\net35\Newtonsoft.Json.dll True diff --git a/Plugins/Wox.Plugin.PluginManagement/packages.config b/Plugins/Wox.Plugin.PluginManagement/packages.config index 7a13476a5..9b49c9e22 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 1506641de..784a900d9 100644 --- a/Plugins/Wox.Plugin.Program/Wox.Plugin.Program.csproj +++ b/Plugins/Wox.Plugin.Program/Wox.Plugin.Program.csproj @@ -34,9 +34,9 @@ false - - False - ..\..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll + + ..\..\packages\Newtonsoft.Json.7.0.1\lib\net35\Newtonsoft.Json.dll + True diff --git a/Plugins/Wox.Plugin.Program/packages.config b/Plugins/Wox.Plugin.Program/packages.config index 7a13476a5..9b49c9e22 100644 --- a/Plugins/Wox.Plugin.Program/packages.config +++ b/Plugins/Wox.Plugin.Program/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj b/Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj index 049780ab0..fec98b0da 100644 --- a/Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj +++ b/Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj @@ -34,9 +34,9 @@ false - - False - ..\..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll + + ..\..\packages\Newtonsoft.Json.7.0.1\lib\net35\Newtonsoft.Json.dll + True diff --git a/Plugins/Wox.Plugin.WebSearch/packages.config b/Plugins/Wox.Plugin.WebSearch/packages.config index 7a13476a5..9b49c9e22 100644 --- a/Plugins/Wox.Plugin.WebSearch/packages.config +++ b/Plugins/Wox.Plugin.WebSearch/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Wox.Core/Wox.Core.csproj b/Wox.Core/Wox.Core.csproj index 02376a034..877abfa32 100644 --- a/Wox.Core/Wox.Core.csproj +++ b/Wox.Core/Wox.Core.csproj @@ -35,16 +35,16 @@ - False ..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll + True ..\packages\NAppUpdate.Framework.0.3.2.0\lib\net20\NAppUpdate.Framework.dll True - - False - ..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.7.0.1\lib\net35\Newtonsoft.Json.dll + True diff --git a/Wox.Core/packages.config b/Wox.Core/packages.config index 2825ea4cc..1bef75167 100644 --- a/Wox.Core/packages.config +++ b/Wox.Core/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/Wox.Infrastructure/Wox.Infrastructure.csproj b/Wox.Infrastructure/Wox.Infrastructure.csproj index 6e65f0d1e..0c75c7456 100644 --- a/Wox.Infrastructure/Wox.Infrastructure.csproj +++ b/Wox.Infrastructure/Wox.Infrastructure.csproj @@ -36,9 +36,9 @@ false - - False - ..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.7.0.1\lib\net35\Newtonsoft.Json.dll + True ..\packages\NLog.4.2.0\lib\net35\NLog.dll @@ -89,6 +89,8 @@ Always + + Designer diff --git a/Wox.Infrastructure/packages.config b/Wox.Infrastructure/packages.config index 0c8252da9..ff40a49ba 100644 --- a/Wox.Infrastructure/packages.config +++ b/Wox.Infrastructure/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/Wox.UpdateFeedGenerator/Wox.UpdateFeedGenerator.csproj b/Wox.UpdateFeedGenerator/Wox.UpdateFeedGenerator.csproj index 12f4c1d0f..cc61dc165 100644 --- a/Wox.UpdateFeedGenerator/Wox.UpdateFeedGenerator.csproj +++ b/Wox.UpdateFeedGenerator/Wox.UpdateFeedGenerator.csproj @@ -37,9 +37,9 @@ ..\packages\NAppUpdate.Framework.0.3.2.0\lib\net20\NAppUpdate.Framework.dll True - - False - ..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.7.0.1\lib\net35\Newtonsoft.Json.dll + True diff --git a/Wox.UpdateFeedGenerator/packages.config b/Wox.UpdateFeedGenerator/packages.config index 9661aa0af..988cd2fc4 100644 --- a/Wox.UpdateFeedGenerator/packages.config +++ b/Wox.UpdateFeedGenerator/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/Wox/App.config b/Wox/App.config index c718ae367..e52b8a201 100644 --- a/Wox/App.config +++ b/Wox/App.config @@ -1,7 +1,11 @@ + +
+ + \ No newline at end of file diff --git a/Wox/Wox.csproj b/Wox/Wox.csproj index 12ffaea6b..0452d92c3 100644 --- a/Wox/Wox.csproj +++ b/Wox/Wox.csproj @@ -61,21 +61,30 @@ - False ..\packages\Exceptionless.1.5.2121\lib\net35\Exceptionless.dll + True - + + ..\packages\Exceptionless.1.5.2121\lib\net35\Exceptionless.Models.dll + True + + + ..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll + True + + ..\packages\MarkdownSharp.1.13.0.0\lib\35\MarkdownSharp.dll + True - - False - ..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.7.0.1\lib\net35\Newtonsoft.Json.dll + True - False ..\packages\NHotkey.1.2.1\lib\net20\NHotkey.dll + True - + ..\packages\NHotkey.Wpf.1.2.1\lib\net35\NHotkey.Wpf.dll True @@ -98,6 +107,10 @@ + + ..\packages\InputSimulator.1.0.4.0\lib\net20\WindowsInput.dll + True + diff --git a/Wox/packages.config b/Wox/packages.config index 054bbd20c..5dbff9249 100644 --- a/Wox/packages.config +++ b/Wox/packages.config @@ -3,7 +3,7 @@ - + From c852ad1d45d2f7324fa54ff7faca473c9f2ab645 Mon Sep 17 00:00:00 2001 From: qianlifeng Date: Thu, 3 Dec 2015 23:21:53 +0800 Subject: [PATCH 07/18] change https to http becuase the SSL has expired --- Wox.Core/Updater/UpdaterManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Wox.Core/Updater/UpdaterManager.cs b/Wox.Core/Updater/UpdaterManager.cs index 65778896a..b9284a5ca 100644 --- a/Wox.Core/Updater/UpdaterManager.cs +++ b/Wox.Core/Updater/UpdaterManager.cs @@ -18,7 +18,7 @@ namespace Wox.Core.Updater public class UpdaterManager { private static UpdaterManager instance; - private const string VersionCheckURL = "https://api.getwox.com/release/latest/"; + private const string VersionCheckURL = "http://api.getwox.com/release/latest/"; private const string UpdateFeedURL = "http://upgrade.getwox.com/update.xml"; //private const string UpdateFeedURL = "http://127.0.0.1:8888/update.xml"; private static SemanticVersion currentVersion; From bb9684f7d342a0c648b0eb4bbc8044283178378c Mon Sep 17 00:00:00 2001 From: bao-qian Date: Wed, 9 Dec 2015 19:25:29 +0000 Subject: [PATCH 08/18] Remove https link to getwox due to ssl certificate expired Fix #421 --- Plugins/Wox.Plugin.PluginManagement/Main.cs | 2 +- README.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Plugins/Wox.Plugin.PluginManagement/Main.cs b/Plugins/Wox.Plugin.PluginManagement/Main.cs index c11fa86da..785d28017 100644 --- a/Plugins/Wox.Plugin.PluginManagement/Main.cs +++ b/Plugins/Wox.Plugin.PluginManagement/Main.cs @@ -14,7 +14,7 @@ namespace Wox.Plugin.PluginManagement { public class Main : IPlugin, IPluginI18n { - private static string APIBASE = "https://api.getwox.com"; + private static string APIBASE = "http://api.getwox.com"; private static string PluginConfigName = "plugin.json"; private static string pluginSearchUrl = APIBASE + "/plugin/search/"; private const string ListCommand = "list"; diff --git a/README.md b/README.md index 4b5fd6046..82639722a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ Wox [![Build status](https://ci.appveyor.com/api/projects/status/bfktntbivg32e103)](https://ci.appveyor.com/project/qianlifeng/wox) [![Bountysource](https://www.bountysource.com/badge/team?team_id=39433&style=raised)](https://www.bountysource.com/teams/wox?utm_source=Wox&utm_medium=shield&utm_campaign=raised) [![Issue Stats](http://issuestats.com/github/Wox-launcher/Wox/badge/pr)](http://issuestats.com/github/Wox-launcher/Wox) ========= -[Wox](https://www.getwox.com/) is a launcher for Windows, an alternative to [Alfred](https://www.alfredapp.com/) or [Launchy](http://www.launchy.net/). You can launch everything with just a few keystrokes! +[Wox](http://www.getwox.com/) is a launcher for Windows, an alternative to [Alfred](https://www.alfredapp.com/) or [Launchy](http://www.launchy.net/). You can launch everything with just a few keystrokes! Screenshot ========= @@ -10,10 +10,10 @@ Screenshot Features ========= -1. Search all applications, folders, files, [bookmarks](https://www.getwox.com/plugin/16). +1. Search all applications, folders, files, [bookmarks](http://www.getwox.com/plugin/16). 2. Search Web using keyword (e.g. search google with `g search_term`) -3. Build custom themes in [https://www.getwox.com/theme/builder](https://www.getwox.com/theme/builder) -4. Install plugins from [https://www.getwox.com/plugin](https://www.getwox.com/plugin) +3. Build custom themes in [http://www.getwox.com/theme/builder](http://www.getwox.com/theme/builder) +4. Install plugins from [http://www.getwox.com/plugin](http://www.getwox.com/plugin) Installation ========= From 3beebd42a8d0cee3b4e9af9a29f99bc24527e4de Mon Sep 17 00:00:00 2001 From: bao-qian Date: Sun, 13 Dec 2015 13:16:33 +0000 Subject: [PATCH 09/18] delete junk --- Wox/ias03vpr.pm0 | 850 ----------------------------------------------- Wox/su54u2mz.xrz | 850 ----------------------------------------------- 2 files changed, 1700 deletions(-) delete mode 100644 Wox/ias03vpr.pm0 delete mode 100644 Wox/su54u2mz.xrz diff --git a/Wox/ias03vpr.pm0 b/Wox/ias03vpr.pm0 deleted file mode 100644 index 2bf2868f8..000000000 --- a/Wox/ias03vpr.pm0 +++ /dev/null @@ -1,850 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics; -using System.Drawing; -using System.IO; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Threading; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Forms; -using System.Windows.Input; -using System.Windows.Media.Animation; -using NHotkey; -using NHotkey.Wpf; -using Wox.Core.i18n; -using Wox.Core.Plugin; -using Wox.Core.Theme; -using Wox.Core.Updater; -using Wox.Core.UserSettings; -using Wox.Helper; -using Wox.Infrastructure; -using Wox.Infrastructure.Hotkey; -using Wox.Plugin; -using Wox.Storage; -using ContextMenu = System.Windows.Forms.ContextMenu; -using DataFormats = System.Windows.DataFormats; -using DragEventArgs = System.Windows.DragEventArgs; -using IDataObject = System.Windows.IDataObject; -using KeyEventArgs = System.Windows.Input.KeyEventArgs; -using MenuItem = System.Windows.Forms.MenuItem; -using MessageBox = System.Windows.MessageBox; -using ToolTip = System.Windows.Controls.ToolTip; - -namespace Wox -{ - public partial class MainWindow : IPublicAPI - { - - #region Properties - - private readonly Storyboard progressBarStoryboard = new Storyboard(); - private NotifyIcon notifyIcon; - private bool queryHasReturn; - private string lastQuery; - private ToolTip toolTip = new ToolTip(); - - private bool ignoreTextChange = false; - - #endregion - - #region Public API - - public void ChangeQuery(string query, bool requery = false) - { - Dispatcher.Invoke(new Action(() => - { - tbQuery.Text = query; - tbQuery.CaretIndex = tbQuery.Text.Length; - if (requery) - { - TextBoxBase_OnTextChanged(null, null); - } - })); - } - - public void CloseApp() - { - Dispatcher.Invoke(new Action(() => - { - notifyIcon.Visible = false; - Close(); - Environment.Exit(0); - })); - } - - public void HideApp() - { - Dispatcher.Invoke(new Action(HideWox)); - } - - public void ShowApp() - { - Dispatcher.Invoke(new Action(() => ShowWox())); - } - - public void ShowMsg(string title, string subTitle, string iconPath) - { - Dispatcher.Invoke(new Action(() => - { - var m = new Msg { Owner = GetWindow(this) }; - m.Show(title, subTitle, iconPath); - })); - } - - public void OpenSettingDialog() - { - Dispatcher.Invoke(new Action(() => WindowOpener.Open(this))); - } - - public void StartLoadingBar() - { - Dispatcher.Invoke(new Action(StartProgress)); - } - - public void StopLoadingBar() - { - Dispatcher.Invoke(new Action(StopProgress)); - } - - public void InstallPlugin(string path) - { - Dispatcher.Invoke(new Action(() => PluginManager.InstallPlugin(path))); - } - - public void ReloadPlugins() - { - Dispatcher.Invoke(new Action(() => PluginManager.Init(this))); - } - - public string GetTranslation(string key) - { - return InternationalizationManager.Instance.GetTranslation(key); - } - - public List GetAllPlugins() - { - return PluginManager.AllPlugins; - } - - public event WoxKeyDownEventHandler BackKeyDownEvent; - public event WoxGlobalKeyboardEventHandler GlobalKeyboardEvent; - public event AfterWoxQueryEventHandler AfterWoxQueryEvent; - public event AfterWoxQueryEventHandler BeforeWoxQueryEvent; - public event ResultItemDropEventHandler ResultItemDropEvent; - - public void PushResults(Query query, PluginMetadata plugin, List results) - { - results.ForEach(o => - { - o.PluginDirectory = plugin.PluginDirectory; - o.PluginID = plugin.ID; - o.OriginQuery = query; - if (o.ContextMenu != null) - { - o.ContextMenu.ForEach(t => - { - t.PluginDirectory = plugin.PluginDirectory; - t.PluginID = plugin.ID; - }); - } - }); - UpdateResultView(results); - } - - public void ShowContextMenu(PluginMetadata plugin, List results) - { - if (results != null && results.Count > 0) - { - results.ForEach(o => - { - o.PluginDirectory = plugin.PluginDirectory; - o.PluginID = plugin.ID; - o.ContextMenu = null; - }); - pnlContextMenu.Clear(); - pnlContextMenu.AddResults(results); - pnlContextMenu.Visibility = Visibility.Visible; - pnlResult.Visibility = Visibility.Collapsed; - } - } - - #endregion - - public MainWindow() - { - InitializeComponent(); - ThreadPool.SetMaxThreads(30, 10); - ThreadPool.SetMinThreads(10, 5); - - WebRequest.RegisterPrefix("data", new DataWebRequestFactory()); - GlobalHotkey.Instance.hookedKeyboardCallback += KListener_hookedKeyboardCallback; - progressBar.ToolTip = toolTip; - InitialTray(); - pnlResult.LeftMouseClickEvent += SelectResult; - pnlResult.ItemDropEvent += pnlResult_ItemDropEvent; - pnlContextMenu.LeftMouseClickEvent += SelectResult; - pnlResult.RightMouseClickEvent += pnlResult_RightMouseClickEvent; - - ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme); - InternationalizationManager.Instance.ChangeLanguage(UserSettingStorage.Instance.Language); - - SetHotkey(UserSettingStorage.Instance.Hotkey, OnHotkey); - SetCustomPluginHotkey(); - - Closing += MainWindow_Closing; - //since MainWIndow implement IPublicAPI, so we need to finish ctor MainWindow object before - //PublicAPI invoke in plugin init methods. E.g FolderPlugin - ThreadPool.QueueUserWorkItem(o => - { - Thread.Sleep(50); - PluginManager.Init(this); - }); - ThreadPool.QueueUserWorkItem(o => - { - Thread.Sleep(50); - PreLoadImages(); - }); - } - - void pnlResult_ItemDropEvent(Result result, IDataObject dropDataObject, DragEventArgs args) - { - PluginPair pluginPair = PluginManager.AllPlugins.FirstOrDefault(o => o.Metadata.ID == result.PluginID); - if (ResultItemDropEvent != null && pluginPair != null) - { - foreach (var delegateHandler in ResultItemDropEvent.GetInvocationList()) - { - if (delegateHandler.Target == pluginPair.Plugin) - { - delegateHandler.DynamicInvoke(result, dropDataObject, args); - } - } - } - } - - private bool KListener_hookedKeyboardCallback(KeyEvent keyevent, int vkcode, SpecialKeyState state) - { - if (GlobalKeyboardEvent != null) - { - return GlobalKeyboardEvent((int)keyevent, vkcode, state); - } - return true; - } - - private void PreLoadImages() - { - ImageLoader.ImageLoader.PreloadImages(); - } - - void pnlResult_RightMouseClickEvent(Result result) - { - ShowContextMenuFromResult(result); - } - - void MainWindow_Closing(object sender, CancelEventArgs e) - { - UserSettingStorage.Instance.WindowLeft = Left; - UserSettingStorage.Instance.WindowTop = Top; - UserSettingStorage.Instance.Save(); - this.HideWox(); - e.Cancel = true; - } - - private void MainWindow_OnLoaded(object sender, RoutedEventArgs e) - { - if (UserSettingStorage.Instance.WindowLeft == 0 - && UserSettingStorage.Instance.WindowTop == 0) - { - Left = UserSettingStorage.Instance.WindowLeft - = (SystemParameters.PrimaryScreenWidth - ActualWidth) / 2; - Top = UserSettingStorage.Instance.WindowTop - = (SystemParameters.PrimaryScreenHeight - ActualHeight) / 5; - } - else - { - Left = UserSettingStorage.Instance.WindowLeft; - Top = UserSettingStorage.Instance.WindowTop; - } - - InitProgressbarAnimation(); - WindowIntelopHelper.DisableControlBox(this); - CheckUpdate(); - } - - private void CheckUpdate() - { - UpdaterManager.Instance.PrepareUpdateReady += OnPrepareUpdateReady; - UpdaterManager.Instance.UpdateError += OnUpdateError; - UpdaterManager.Instance.CheckUpdate(); - } - - void OnUpdateError(object sender, EventArgs e) - { - string updateError = InternationalizationManager.Instance.GetTranslation("update_wox_update_error"); - MessageBox.Show(updateError); - } - - private void OnPrepareUpdateReady(object sender, EventArgs e) - { - Dispatcher.Invoke(new Action(() => - { - new WoxUpdate().ShowDialog(); - })); - } - - public void SetHotkey(string hotkeyStr, EventHandler action) - { - var hotkey = new HotkeyModel(hotkeyStr); - try - { - HotkeyManager.Current.AddOrReplace(hotkeyStr, hotkey.CharKey, hotkey.ModifierKeys, action); - } - catch (Exception) - { - string errorMsg = string.Format(InternationalizationManager.Instance.GetTranslation("registerHotkeyFailed"), hotkeyStr); - MessageBox.Show(errorMsg); - } - } - - public void RemoveHotkey(string hotkeyStr) - { - if (!string.IsNullOrEmpty(hotkeyStr)) - { - HotkeyManager.Current.Remove(hotkeyStr); - } - } - - private void SetCustomPluginHotkey() - { - if (UserSettingStorage.Instance.CustomPluginHotkeys == null) return; - foreach (CustomPluginHotkey hotkey in UserSettingStorage.Instance.CustomPluginHotkeys) - { - CustomPluginHotkey hotkey1 = hotkey; - SetHotkey(hotkey.Hotkey, delegate - { - ShowApp(); - ChangeQuery(hotkey1.ActionKeyword, true); - }); - } - } - - private void OnHotkey(object sender, HotkeyEventArgs e) - { - ToggleWox(); - e.Handled = true; - } - - public void ToggleWox() - { - if (!IsVisible) - { - ShowWox(); - } - else - { - HideWox(); - } - } - - private void InitProgressbarAnimation() - { - var da = new DoubleAnimation(progressBar.X2, ActualWidth + 100, new Duration(new TimeSpan(0, 0, 0, 0, 1600))); - var da1 = new DoubleAnimation(progressBar.X1, ActualWidth, new Duration(new TimeSpan(0, 0, 0, 0, 1600))); - Storyboard.SetTargetProperty(da, new PropertyPath("(Line.X2)")); - Storyboard.SetTargetProperty(da1, new PropertyPath("(Line.X1)")); - progressBarStoryboard.Children.Add(da); - progressBarStoryboard.Children.Add(da1); - progressBarStoryboard.RepeatBehavior = RepeatBehavior.Forever; - progressBar.Visibility = Visibility.Hidden; - progressBar.BeginStoryboard(progressBarStoryboard); - } - - private void InitialTray() - { - notifyIcon = new NotifyIcon { Text = "Wox", Icon = Properties.Resources.app, Visible = true }; - notifyIcon.Click += (o, e) => ShowWox(); - var open = new MenuItem("Open"); - open.Click += (o, e) => ShowWox(); - var setting = new MenuItem("Settings"); - setting.Click += (o, e) => OpenSettingDialog(); - var exit = new MenuItem("Exit"); - exit.Click += (o, e) => CloseApp(); - MenuItem[] childen = { open, setting, exit }; - notifyIcon.ContextMenu = new ContextMenu(childen); - } - - private void TextBoxBase_OnTextChanged(object sender, TextChangedEventArgs e) - { - if (ignoreTextChange) { ignoreTextChange = false; return; } - - lastQuery = tbQuery.Text; - toolTip.IsOpen = false; - pnlResult.Dirty = true; - int searchDelay = GetSearchDelay(lastQuery); - - Dispatcher.DelayInvoke("UpdateSearch", - o => - { - Dispatcher.DelayInvoke("ClearResults", i => - { - // first try to use clear method inside pnlResult, which is more closer to the add new results - // and this will not bring splash issues.After waiting 100ms, if there still no results added, we - // must clear the result. otherwise, it will be confused why the query changed, but the results - // didn't. - if (pnlResult.Dirty) pnlResult.Clear(); - }, TimeSpan.FromMilliseconds(100), null); - queryHasReturn = false; - Query query = new Query(lastQuery); - query.IsIntantQuery = searchDelay == 0; - FireBeforeWoxQueryEvent(query); - Query(query); - Dispatcher.DelayInvoke("ShowProgressbar", originQuery => - { - if (!queryHasReturn && originQuery == tbQuery.Text && !string.IsNullOrEmpty(lastQuery)) - { - StartProgress(); - } - }, TimeSpan.FromMilliseconds(150), tbQuery.Text); - FireAfterWoxQueryEvent(query); - }, TimeSpan.FromMilliseconds(searchDelay)); - } - - private int GetSearchDelay(string query) - { - if (!string.IsNullOrEmpty(query) && PluginManager.IsInstantQuery(query)) - { - DebugHelper.WriteLine("execute query without delay"); - return 0; - } - - DebugHelper.WriteLine("execute query with 200ms delay"); - return 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) - { - PluginManager.Query(q); - StopProgress(); - BackToResultMode(); - } - - private void BackToResultMode() - { - pnlResult.Visibility = Visibility.Visible; - pnlContextMenu.Visibility = Visibility.Collapsed; - } - - private void Border_OnMouseDown(object sender, MouseButtonEventArgs e) - { - if (e.ChangedButton == MouseButton.Left) DragMove(); - } - - private void StartProgress() - { - progressBar.Visibility = Visibility.Visible; - } - - private void StopProgress() - { - progressBar.Visibility = Visibility.Hidden; - } - - private void HideWox() - { - Hide(); - } - - private void ShowWox(bool selectAll = true) - { - UserSettingStorage.Instance.IncreaseActivateTimes(); - if (!double.IsNaN(Left) && !double.IsNaN(Top)) - { - var origScreen = Screen.FromRectangle(new Rectangle((int)Left, (int)Top, (int)ActualWidth, (int)ActualHeight)); - var screen = Screen.FromPoint(System.Windows.Forms.Cursor.Position); - var coordX = (Left - origScreen.WorkingArea.Left) / (origScreen.WorkingArea.Width - ActualWidth); - var coordY = (Top - origScreen.WorkingArea.Top) / (origScreen.WorkingArea.Height - ActualHeight); - Left = (screen.WorkingArea.Width - ActualWidth) * coordX + screen.WorkingArea.Left; - Top = (screen.WorkingArea.Height - ActualHeight) * coordY + screen.WorkingArea.Top; - } - - Show(); - Activate(); - Focus(); - tbQuery.Focus(); - if (selectAll) tbQuery.SelectAll(); - } - - private void MainWindow_OnDeactivated(object sender, EventArgs e) - { - if (UserSettingStorage.Instance.HideWhenDeactive) - { - HideWox(); - } - } - - private void TbQuery_OnPreviewKeyDown(object sender, KeyEventArgs e) - { - //when alt is pressed, the real key should be e.SystemKey - Key key = (e.Key == Key.System ? e.SystemKey : e.Key); - switch (key) - { - case Key.Escape: - if (IsInContextMenuMode) - { - BackToResultMode(); - } - else - { - HideWox(); - } - e.Handled = true; - break; - - case Key.Tab: - if (GlobalHotkey.Instance.CheckModifiers().ShiftPressed) - { - SelectPrevItem(); - } - else - { - SelectNextItem(); - } - e.Handled = true; - break; - - case Key.N: - case Key.J: - if (GlobalHotkey.Instance.CheckModifiers().CtrlPressed) - { - SelectNextItem(); - } - break; - - case Key.P: - case Key.K: - if (GlobalHotkey.Instance.CheckModifiers().CtrlPressed) - { - SelectPrevItem(); - } - break; - - case Key.O: - if (GlobalHotkey.Instance.CheckModifiers().CtrlPressed) - { - if (IsInContextMenuMode) - { - BackToResultMode(); - } - else - { - ShowContextMenuFromResult(GetActiveResult()); - } - } - break; - - case Key.Down: - SelectNextItem(); - e.Handled = true; - break; - - case Key.Up: - SelectPrevItem(); - e.Handled = true; - break; - - case Key.D: - if (GlobalHotkey.Instance.CheckModifiers().CtrlPressed) - { - pnlResult.SelectNextPage(); - } - break; - - case Key.PageDown: - pnlResult.SelectNextPage(); - e.Handled = true; - break; - - case Key.U: - if (GlobalHotkey.Instance.CheckModifiers().CtrlPressed) - { - pnlResult.SelectPrevPage(); - } - break; - - case Key.PageUp: - pnlResult.SelectPrevPage(); - e.Handled = true; - break; - - case Key.Back: - if (BackKeyDownEvent != null) - { - BackKeyDownEvent(new WoxKeyDownEventArgs() - { - Query = tbQuery.Text, - keyEventArgs = e - }); - } - break; - - case Key.F1: - Process.Start("http://doc.getwox.com"); - break; - - case Key.Enter: - Result activeResult = GetActiveResult(); - if (GlobalHotkey.Instance.CheckModifiers().ShiftPressed) - { - ShowContextMenuFromResult(activeResult); - } - else - { - SelectResult(activeResult); - } - e.Handled = true; - break; - - case Key.D1: - SelectItem(1); - break; - - case Key.D2: - SelectItem(2); - break; - - case Key.D3: - SelectItem(3); - break; - - case Key.D4: - SelectItem(4); - break; - - case Key.D5: - SelectItem(5); - break; - case Key.D6: - SelectItem(6); - break; - - } - } - - private void SelectItem(int index) - { - int zeroBasedIndex = index - 1; - SpecialKeyState keyState = GlobalHotkey.Instance.CheckModifiers(); - if (keyState.AltPressed || keyState.CtrlPressed) - { - List visibleResults = pnlResult.GetVisibleResults(); - if (zeroBasedIndex < visibleResults.Count) - { - SelectResult(visibleResults[zeroBasedIndex]); - } - } - } - - private bool IsInContextMenuMode - { - get { return pnlContextMenu.Visibility == Visibility.Visible; } - } - - private Result GetActiveResult() - { - if (IsInContextMenuMode) - { - return pnlContextMenu.GetActiveResult(); - } - else - { - return pnlResult.GetActiveResult(); - } - } - - private void SelectPrevItem() - { - if (IsInContextMenuMode) - { - pnlContextMenu.SelectPrev(); - } - else - { - pnlResult.SelectPrev(); - } - toolTip.IsOpen = false; - } - - private void SelectNextItem() - { - if (IsInContextMenuMode) - { - pnlContextMenu.SelectNext(); - } - else - { - pnlResult.SelectNext(); - } - toolTip.IsOpen = false; - } - - private void SelectResult(Result result) - { - if (result != null) - { - if (result.Action != null) - { - bool hideWindow = result.Action(new ActionContext() - { - SpecialKeyState = GlobalHotkey.Instance.CheckModifiers() - }); - if (hideWindow) - { - HideWox(); - } - UserSelectedRecordStorage.Instance.Add(result); - } - } - } - - private void UpdateResultView(List list) - { - queryHasReturn = true; - progressBar.Dispatcher.Invoke(new Action(StopProgress)); - if (list == null || list.Count == 0) return; - - if (list.Count > 0) - { - list.ForEach(o => - { - o.Score += UserSelectedRecordStorage.Instance.GetSelectedCount(o) * 5; - if (o.ContextMenu == null) - { - o.ContextMenu = new List(); - } - HanleTopMost(o); - }); - List l = list.Where(o => o.OriginQuery != null && o.OriginQuery.RawQuery == lastQuery).ToList(); - Dispatcher.Invoke(new Action(() => - { - pnlResult.AddResults(l); - })); - } - } - - private void HanleTopMost(Result result) - { - if (TopMostRecordStorage.Instance.IsTopMost(result)) - { - result.ContextMenu.Add(new Result("Remove top most in this query", "Images\\down.png") - { - PluginDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), - Action = _ => - { - TopMostRecordStorage.Instance.Remove(result); - ShowMsg("Succeed", "", ""); - return false; - } - }); - } - else - { - result.ContextMenu.Add(new Result("Set as top most in this query", "Images\\up.png") - { - PluginDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), - Action = _ => - { - TopMostRecordStorage.Instance.Add(result); - ShowMsg("Succeed", "", ""); - return false; - } - }); - } - } - - private void ShowContextMenuFromResult(Result result) - { - if (result.ContextMenu != null && result.ContextMenu.Count > 0) - { - pnlContextMenu.Clear(); - pnlContextMenu.AddResults(result.ContextMenu); - pnlContextMenu.Visibility = Visibility.Visible; - pnlResult.Visibility = Visibility.Collapsed; - } - } - - public bool ShellRun(string cmd, bool runAsAdministrator = false) - { - try - { - if (string.IsNullOrEmpty(cmd)) - throw new ArgumentNullException(); - - WindowsShellRun.Start(cmd, runAsAdministrator); - return true; - } - catch (Exception ex) - { - string errorMsg = string.Format(InternationalizationManager.Instance.GetTranslation("couldnotStartCmd"), cmd); - ShowMsg(errorMsg, ex.Message, null); - } - return false; - } - - private void MainWindow_OnDrop(object sender, DragEventArgs e) - { - if (e.Data.GetDataPresent(DataFormats.FileDrop)) - { - // Note that you can have more than one file. - string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); - if (files[0].ToLower().EndsWith(".wox")) - { - PluginManager.InstallPlugin(files[0]); - } - else - { - MessageBox.Show(InternationalizationManager.Instance.GetTranslation("invalidWoxPluginFileFormat")); - } - } - } - - private void TbQuery_OnPreviewDragOver(object sender, DragEventArgs e) - { - e.Handled = true; - } - } -} \ No newline at end of file diff --git a/Wox/su54u2mz.xrz b/Wox/su54u2mz.xrz deleted file mode 100644 index b83197e8f..000000000 --- a/Wox/su54u2mz.xrz +++ /dev/null @@ -1,850 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics; -using System.Drawing; -using System.IO; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Threading; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Forms; -using System.Windows.Input; -using System.Windows.Media.Animation; -using NHotkey; -using NHotkey.Wpf; -using Wox.Core.i18n; -using Wox.Core.Plugin; -using Wox.Core.Theme; -using Wox.Core.Updater; -using Wox.Core.UserSettings; -using Wox.Helper; -using Wox.Infrastructure; -using Wox.Infrastructure.Hotkey; -using Wox.Plugin; -using Wox.Storage; -using ContextMenu = System.Windows.Forms.ContextMenu; -using DataFormats = System.Windows.DataFormats; -using DragEventArgs = System.Windows.DragEventArgs; -using IDataObject = System.Windows.IDataObject; -using KeyEventArgs = System.Windows.Input.KeyEventArgs; -using MenuItem = System.Windows.Forms.MenuItem; -using MessageBox = System.Windows.MessageBox; -using ToolTip = System.Windows.Controls.ToolTip; - -namespace Wox -{ - public partial class MainWindow : IPublicAPI - { - - #region Properties - - private readonly Storyboard progressBarStoryboard = new Storyboard(); - private NotifyIcon notifyIcon; - private bool queryHasReturn; - private string lastQuery; - private ToolTip toolTip = new ToolTip(); - - private bool ignoreTextChange = false; - - #endregion - - #region Public API - - public void ChangeQuery(string query, bool requery = false) - { - Dispatcher.Invoke(new Action(() => - { - tbQuery.Text = query; - tbQuery.CaretIndex = tbQuery.Text.Length; - if (requery) - { - TextBoxBase_OnTextChanged(null, null); - } - })); - } - - public void CloseApp() - { - Dispatcher.Invoke(new Action(() => - { - notifyIcon.Visible = false; - Close(); - Environment.Exit(0); - })); - } - - public void HideApp() - { - Dispatcher.Invoke(new Action(HideWox)); - } - - public void ShowApp() - { - Dispatcher.Invoke(new Action(() => ShowWox())); - } - - public void ShowMsg(string title, string subTitle, string iconPath) - { - Dispatcher.Invoke(new Action(() => - { - var m = new Msg { Owner = GetWindow(this) }; - m.Show(title, subTitle, iconPath); - })); - } - - public void OpenSettingDialog() - { - Dispatcher.Invoke(new Action(() => WindowOpener.Open(this))); - } - - public void StartLoadingBar() - { - Dispatcher.Invoke(new Action(StartProgress)); - } - - public void StopLoadingBar() - { - Dispatcher.Invoke(new Action(StopProgress)); - } - - public void InstallPlugin(string path) - { - Dispatcher.Invoke(new Action(() => PluginManager.InstallPlugin(path))); - } - - public void ReloadPlugins() - { - Dispatcher.Invoke(new Action(() => PluginManager.Init(this))); - } - - public string GetTranslation(string key) - { - return InternationalizationManager.Instance.GetTranslation(key); - } - - public List GetAllPlugins() - { - return PluginManager.AllPlugins; - } - - public event WoxKeyDownEventHandler BackKeyDownEvent; - public event WoxGlobalKeyboardEventHandler GlobalKeyboardEvent; - public event AfterWoxQueryEventHandler AfterWoxQueryEvent; - public event AfterWoxQueryEventHandler BeforeWoxQueryEvent; - public event ResultItemDropEventHandler ResultItemDropEvent; - - public void PushResults(Query query, PluginMetadata plugin, List results) - { - results.ForEach(o => - { - o.PluginDirectory = plugin.PluginDirectory; - o.PluginID = plugin.ID; - o.OriginQuery = query; - if (o.ContextMenu != null) - { - o.ContextMenu.ForEach(t => - { - t.PluginDirectory = plugin.PluginDirectory; - t.PluginID = plugin.ID; - }); - } - }); - UpdateResultView(results); - } - - public void ShowContextMenu(PluginMetadata plugin, List results) - { - if (results != null && results.Count > 0) - { - results.ForEach(o => - { - o.PluginDirectory = plugin.PluginDirectory; - o.PluginID = plugin.ID; - o.ContextMenu = null; - }); - pnlContextMenu.Clear(); - pnlContextMenu.AddResults(results); - pnlContextMenu.Visibility = Visibility.Visible; - pnlResult.Visibility = Visibility.Collapsed; - } - } - - #endregion - - public MainWindow() - { - InitializeComponent(); - ThreadPool.SetMaxThreads(30, 10); - ThreadPool.SetMinThreads(10, 5); - - WebRequest.RegisterPrefix("data", new DataWebRequestFactory()); - GlobalHotkey.Instance.hookedKeyboardCallback += KListener_hookedKeyboardCallback; - progressBar.ToolTip = toolTip; - InitialTray(); - pnlResult.LeftMouseClickEvent += SelectResult; - pnlResult.ItemDropEvent += pnlResult_ItemDropEvent; - pnlContextMenu.LeftMouseClickEvent += SelectResult; - pnlResult.RightMouseClickEvent += pnlResult_RightMouseClickEvent; - - ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme); - InternationalizationManager.Instance.ChangeLanguage(UserSettingStorage.Instance.Language); - - SetHotkey(UserSettingStorage.Instance.Hotkey, OnHotkey); - SetCustomPluginHotkey(); - - Closing += MainWindow_Closing; - //since MainWIndow implement IPublicAPI, so we need to finish ctor MainWindow object before - //PublicAPI invoke in plugin init methods. E.g FolderPlugin - ThreadPool.QueueUserWorkItem(o => - { - Thread.Sleep(50); - PluginManager.Init(this); - }); - ThreadPool.QueueUserWorkItem(o => - { - Thread.Sleep(50); - PreLoadImages(); - }); - } - - void pnlResult_ItemDropEvent(Result result, IDataObject dropDataObject, DragEventArgs args) - { - PluginPair pluginPair = PluginManager.AllPlugins.FirstOrDefault(o => o.Metadata.ID == result.PluginID); - if (ResultItemDropEvent != null && pluginPair != null) - { - foreach (var delegateHandler in ResultItemDropEvent.GetInvocationList()) - { - if (delegateHandler.Target == pluginPair.Plugin) - { - delegateHandler.DynamicInvoke(result, dropDataObject, args); - } - } - } - } - - private bool KListener_hookedKeyboardCallback(KeyEvent keyevent, int vkcode, SpecialKeyState state) - { - if (GlobalKeyboardEvent != null) - { - return GlobalKeyboardEvent((int)keyevent, vkcode, state); - } - return true; - } - - private void PreLoadImages() - { - ImageLoader.ImageLoader.PreloadImages(); - } - - void pnlResult_RightMouseClickEvent(Result result) - { - ShowContextMenuFromResult(result); - } - - void MainWindow_Closing(object sender, CancelEventArgs e) - { - UserSettingStorage.Instance.WindowLeft = Left; - UserSettingStorage.Instance.WindowTop = Top; - UserSettingStorage.Instance.Save(); - this.HideWox(); - e.Cancel = true; - } - - private void MainWindow_OnLoaded(object sender, RoutedEventArgs e) - { - if (UserSettingStorage.Instance.WindowLeft == 0 - && UserSettingStorage.Instance.WindowTop == 0) - { - Left = UserSettingStorage.Instance.WindowLeft - = (SystemParameters.PrimaryScreenWidth - ActualWidth) / 2; - Top = UserSettingStorage.Instance.WindowTop - = (SystemParameters.PrimaryScreenHeight - ActualHeight) / 5; - } - else - { - Left = UserSettingStorage.Instance.WindowLeft; - Top = UserSettingStorage.Instance.WindowTop; - } - - InitProgressbarAnimation(); - WindowIntelopHelper.DisableControlBox(this); - CheckUpdate(); - } - - private void CheckUpdate() - { - UpdaterManager.Instance.PrepareUpdateReady += OnPrepareUpdateReady; - UpdaterManager.Instance.UpdateError += OnUpdateError; - UpdaterManager.Instance.CheckUpdate(); - } - - void OnUpdateError(object sender, EventArgs e) - { - string updateError = InternationalizationManager.Instance.GetTranslation("update_wox_update_error"); - MessageBox.Show(updateError); - } - - private void OnPrepareUpdateReady(object sender, EventArgs e) - { - Dispatcher.Invoke(new Action(() => - { - new WoxUpdate().ShowDialog(); - })); - } - - public void SetHotkey(string hotkeyStr, EventHandler action) - { - var hotkey = new HotkeyModel(hotkeyStr); - try - { - HotkeyManager.Current.AddOrReplace(hotkeyStr, hotkey.CharKey, hotkey.ModifierKeys, action); - } - catch (Exception) - { - string errorMsg = string.Format(InternationalizationManager.Instance.GetTranslation("registerHotkeyFailed"), hotkeyStr); - MessageBox.Show(errorMsg); - } - } - - public void RemoveHotkey(string hotkeyStr) - { - if (!string.IsNullOrEmpty(hotkeyStr)) - { - HotkeyManager.Current.Remove(hotkeyStr); - } - } - - private void SetCustomPluginHotkey() - { - if (UserSettingStorage.Instance.CustomPluginHotkeys == null) return; - foreach (CustomPluginHotkey hotkey in UserSettingStorage.Instance.CustomPluginHotkeys) - { - CustomPluginHotkey hotkey1 = hotkey; - SetHotkey(hotkey.Hotkey, delegate - { - ShowApp(); - ChangeQuery(hotkey1.ActionKeyword, true); - }); - } - } - - private void OnHotkey(object sender, HotkeyEventArgs e) - { - ToggleWox(); - e.Handled = true; - } - - public void ToggleWox() - { - if (!IsVisible) - { - ShowWox(); - } - else - { - HideWox(); - } - } - - private void InitProgressbarAnimation() - { - var da = new DoubleAnimation(progressBar.X2, ActualWidth + 100, new Duration(new TimeSpan(0, 0, 0, 0, 1600))); - var da1 = new DoubleAnimation(progressBar.X1, ActualWidth, new Duration(new TimeSpan(0, 0, 0, 0, 1600))); - Storyboard.SetTargetProperty(da, new PropertyPath("(Line.X2)")); - Storyboard.SetTargetProperty(da1, new PropertyPath("(Line.X1)")); - progressBarStoryboard.Children.Add(da); - progressBarStoryboard.Children.Add(da1); - progressBarStoryboard.RepeatBehavior = RepeatBehavior.Forever; - progressBar.Visibility = Visibility.Hidden; - progressBar.BeginStoryboard(progressBarStoryboard); - } - - private void InitialTray() - { - notifyIcon = new NotifyIcon { Text = "Wox", Icon = Properties.Resources.app, Visible = true }; - notifyIcon.Click += (o, e) => ShowWox(); - var open = new MenuItem("Open"); - open.Click += (o, e) => ShowWox(); - var setting = new MenuItem("Settings"); - setting.Click += (o, e) => OpenSettingDialog(); - var exit = new MenuItem("Exit"); - exit.Click += (o, e) => CloseApp(); - MenuItem[] childen = { open, setting, exit }; - notifyIcon.ContextMenu = new ContextMenu(childen); - } - - private void TextBoxBase_OnTextChanged(object sender, TextChangedEventArgs e) - { - if (ignoreTextChange) { ignoreTextChange = false; return; } - - lastQuery = tbQuery.Text; - toolTip.IsOpen = false; - pnlResult.Dirty = true; - int searchDelay = GetSearchDelay(lastQuery); - - Dispatcher.DelayInvoke("UpdateSearch", - o => - { - Dispatcher.DelayInvoke("ClearResults", i => - { - // first try to use clear method inside pnlResult, which is more closer to the add new results - // and this will not bring splash issues.After waiting 100ms, if there still no results added, we - // must clear the result. otherwise, it will be confused why the query changed, but the results - // didn't. - if (pnlResult.Dirty) pnlResult.Clear(); - }, TimeSpan.FromMilliseconds(100), null); - queryHasReturn = false; - Query query = new Query(lastQuery); - query.IsIntantQuery = searchDelay == 0; - FireBeforeWoxQueryEvent(query); - Query(query); - Dispatcher.DelayInvoke("ShowProgressbar", originQuery => - { - if (!queryHasReturn && originQuery == tbQuery.Text && !string.IsNullOrEmpty(lastQuery)) - { - StartProgress(); - } - }, TimeSpan.FromMilliseconds(150), tbQuery.Text); - FireAfterWoxQueryEvent(query); - }, TimeSpan.FromMilliseconds(searchDelay)); - } - - private int GetSearchDelay(string query) - { - if (!string.IsNullOrEmpty(query) && PluginManager.IsInstantQuery(query)) - { - DebugHelper.WriteLine("execute query without delay"); - return 0; - } - - DebugHelper.WriteLine("execute query with 200ms delay"); - return 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) - { - PluginManager.Query(q); - StopProgress(); - BackToResultMode(); - } - - private void BackToResultMode() - { - pnlResult.Visibility = Visibility.Visible; - pnlContextMenu.Visibility = Visibility.Collapsed; - } - - private void Border_OnMouseDown(object sender, MouseButtonEventArgs e) - { - if (e.ChangedButton == MouseButton.Left) DragMove(); - } - - private void StartProgress() - { - progressBar.Visibility = Visibility.Visible; - } - - private void StopProgress() - { - progressBar.Visibility = Visibility.Hidden; - } - - private void HideWox() - { - Hide(); - } - - private void ShowWox(bool selectAll = true) - { - UserSettingStorage.Instance.IncreaseActivateTimes(); - if (!double.IsNaN(Left) && !double.IsNaN(Top)) - { - var origScreen = Screen.FromRectangle(new Rectangle((int)Left, (int)Top, (int)ActualWidth, (int)ActualHeight)); - var screen = Screen.FromPoint(System.Windows.Forms.Cursor.Position); - var coordX = (Left - origScreen.WorkingArea.Left) / (origScreen.WorkingArea.Width - ActualWidth); - var coordY = (Top - origScreen.WorkingArea.Top) / (origScreen.WorkingArea.Height - ActualHeight); - Left = (screen.WorkingArea.Width - ActualWidth) * coordX + screen.WorkingArea.Left; - Top = (screen.WorkingArea.Height - ActualHeight) * coordY + screen.WorkingArea.Top; - } - - Show(); - Activate(); - Focus(); - tbQuery.Focus(); - if (selectAll) tbQuery.SelectAll(); - } - - private void MainWindow_OnDeactivated(object sender, EventArgs e) - { - if (UserSettingStorage.Instance.HideWhenDeactive) - { - HideWox(); - } - } - - private void TbQuery_OnPreviewKeyDown(object sender, KeyEventArgs e) - { - //when alt is pressed, the real key should be e.SystemKey - Key key = (e.Key == Key.System ? e.SystemKey : e.Key); - switch (key) - { - case Key.Escape: - if (IsInContextMenuMode) - { - BackToResultMode(); - } - else - { - HideWox(); - } - e.Handled = true; - break; - - case Key.Tab: - if (GlobalHotkey.Instance.CheckModifiers().ShiftPressed) - { - SelectPrevItem(); - } - else - { - SelectNextItem(); - } - e.Handled = true; - break; - - case Key.N: - case Key.J: - if (GlobalHotkey.Instance.CheckModifiers().CtrlPressed) - { - SelectNextItem(); - } - break; - - case Key.P: - case Key.K: - if (GlobalHotkey.Instance.CheckModifiers().CtrlPressed) - { - SelectPrevItem(); - } - break; - - case Key.O: - if (GlobalHotkey.Instance.CheckModifiers().CtrlPressed) - { - if (IsInContextMenuMode) - { - BackToResultMode(); - } - else - { - ShowContextMenuFromResult(GetActiveResult()); - } - } - break; - - case Key.Down: - SelectNextItem(); - e.Handled = true; - break; - - case Key.Up: - SelectPrevItem(); - e.Handled = true; - break; - - case Key.D: - if (GlobalHotkey.Instance.CheckModifiers().AltPressed) - { - pnlResult.SelectNextPage(); - } - break; - - case Key.PageDown: - pnlResult.SelectNextPage(); - e.Handled = true; - break; - - case Key.U: - if (GlobalHotkey.Instance.CheckModifiers().AltPressed) - { - pnlResult.SelectPrevPage(); - } - break; - - case Key.PageUp: - pnlResult.SelectPrevPage(); - e.Handled = true; - break; - - case Key.Back: - if (BackKeyDownEvent != null) - { - BackKeyDownEvent(new WoxKeyDownEventArgs() - { - Query = tbQuery.Text, - keyEventArgs = e - }); - } - break; - - case Key.F1: - Process.Start("http://doc.getwox.com"); - break; - - case Key.Enter: - Result activeResult = GetActiveResult(); - if (GlobalHotkey.Instance.CheckModifiers().ShiftPressed) - { - ShowContextMenuFromResult(activeResult); - } - else - { - SelectResult(activeResult); - } - e.Handled = true; - break; - - case Key.D1: - SelectItem(1); - break; - - case Key.D2: - SelectItem(2); - break; - - case Key.D3: - SelectItem(3); - break; - - case Key.D4: - SelectItem(4); - break; - - case Key.D5: - SelectItem(5); - break; - case Key.D6: - SelectItem(6); - break; - - } - } - - private void SelectItem(int index) - { - int zeroBasedIndex = index - 1; - SpecialKeyState keyState = GlobalHotkey.Instance.CheckModifiers(); - if (keyState.AltPressed || keyState.CtrlPressed) - { - List visibleResults = pnlResult.GetVisibleResults(); - if (zeroBasedIndex < visibleResults.Count) - { - SelectResult(visibleResults[zeroBasedIndex]); - } - } - } - - private bool IsInContextMenuMode - { - get { return pnlContextMenu.Visibility == Visibility.Visible; } - } - - private Result GetActiveResult() - { - if (IsInContextMenuMode) - { - return pnlContextMenu.GetActiveResult(); - } - else - { - return pnlResult.GetActiveResult(); - } - } - - private void SelectPrevItem() - { - if (IsInContextMenuMode) - { - pnlContextMenu.SelectPrev(); - } - else - { - pnlResult.SelectPrev(); - } - toolTip.IsOpen = false; - } - - private void SelectNextItem() - { - if (IsInContextMenuMode) - { - pnlContextMenu.SelectNext(); - } - else - { - pnlResult.SelectNext(); - } - toolTip.IsOpen = false; - } - - private void SelectResult(Result result) - { - if (result != null) - { - if (result.Action != null) - { - bool hideWindow = result.Action(new ActionContext() - { - SpecialKeyState = GlobalHotkey.Instance.CheckModifiers() - }); - if (hideWindow) - { - HideWox(); - } - UserSelectedRecordStorage.Instance.Add(result); - } - } - } - - private void UpdateResultView(List list) - { - queryHasReturn = true; - progressBar.Dispatcher.Invoke(new Action(StopProgress)); - if (list == null || list.Count == 0) return; - - if (list.Count > 0) - { - list.ForEach(o => - { - o.Score += UserSelectedRecordStorage.Instance.GetSelectedCount(o) * 5; - if (o.ContextMenu == null) - { - o.ContextMenu = new List(); - } - HanleTopMost(o); - }); - List l = list.Where(o => o.OriginQuery != null && o.OriginQuery.RawQuery == lastQuery).ToList(); - Dispatcher.Invoke(new Action(() => - { - pnlResult.AddResults(l); - })); - } - } - - private void HanleTopMost(Result result) - { - if (TopMostRecordStorage.Instance.IsTopMost(result)) - { - result.ContextMenu.Add(new Result("Remove top most in this query", "Images\\down.png") - { - PluginDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), - Action = _ => - { - TopMostRecordStorage.Instance.Remove(result); - ShowMsg("Succeed", "", ""); - return false; - } - }); - } - else - { - result.ContextMenu.Add(new Result("Set as top most in this query", "Images\\up.png") - { - PluginDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), - Action = _ => - { - TopMostRecordStorage.Instance.Add(result); - ShowMsg("Succeed", "", ""); - return false; - } - }); - } - } - - private void ShowContextMenuFromResult(Result result) - { - if (result.ContextMenu != null && result.ContextMenu.Count > 0) - { - pnlContextMenu.Clear(); - pnlContextMenu.AddResults(result.ContextMenu); - pnlContextMenu.Visibility = Visibility.Visible; - pnlResult.Visibility = Visibility.Collapsed; - } - } - - public bool ShellRun(string cmd, bool runAsAdministrator = false) - { - try - { - if (string.IsNullOrEmpty(cmd)) - throw new ArgumentNullException(); - - WindowsShellRun.Start(cmd, runAsAdministrator); - return true; - } - catch (Exception ex) - { - string errorMsg = string.Format(InternationalizationManager.Instance.GetTranslation("couldnotStartCmd"), cmd); - ShowMsg(errorMsg, ex.Message, null); - } - return false; - } - - private void MainWindow_OnDrop(object sender, DragEventArgs e) - { - if (e.Data.GetDataPresent(DataFormats.FileDrop)) - { - // Note that you can have more than one file. - string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); - if (files[0].ToLower().EndsWith(".wox")) - { - PluginManager.InstallPlugin(files[0]); - } - else - { - MessageBox.Show(InternationalizationManager.Instance.GetTranslation("invalidWoxPluginFileFormat")); - } - } - } - - private void TbQuery_OnPreviewDragOver(object sender, DragEventArgs e) - { - e.Handled = true; - } - } -} \ No newline at end of file From e40c1ff09ed0d938f5ebf3741e0a792dfb286953 Mon Sep 17 00:00:00 2001 From: bao-qian Date: Mon, 14 Dec 2015 00:29:13 +0000 Subject: [PATCH 10/18] Fix leave open option for cmd plugin Add "Wait for a key press before closing" option. See #141 for more info. --- Plugins/Wox.Plugin.CMD/CMD.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Plugins/Wox.Plugin.CMD/CMD.cs b/Plugins/Wox.Plugin.CMD/CMD.cs index 99b18559d..6cd940396 100644 --- a/Plugins/Wox.Plugin.CMD/CMD.cs +++ b/Plugins/Wox.Plugin.CMD/CMD.cs @@ -143,8 +143,12 @@ namespace Wox.Plugin.CMD private void ExecuteCmd(string cmd, bool runAsAdministrator = false) { - if (context.API.ShellRun(cmd, runAsAdministrator)) + var fullCmd = CMDStorage.Instance.LeaveCmdOpen ? $"cmd /k \"{cmd}\" & pause & exit" : cmd; + var success = context.API.ShellRun(fullCmd, runAsAdministrator); + if (success) + { CMDStorage.Instance.AddCmdHistory(cmd); + } } public void Init(PluginInitContext context) From 35522ae77daeb32a017670fe1d9a096285763ad2 Mon Sep 17 00:00:00 2001 From: bao-qian Date: Mon, 14 Dec 2015 00:19:53 +0000 Subject: [PATCH 11/18] Update demo --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 82639722a..1f518ed8b 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,11 @@ Wox [![Build status](https://ci.appveyor.com/api/projects/status/bfktntbivg32e ========= [Wox](http://www.getwox.com/) is a launcher for Windows, an alternative to [Alfred](https://www.alfredapp.com/) or [Launchy](http://www.launchy.net/). You can launch everything with just a few keystrokes! -Screenshot +Demo ========= -More screenshots - +[More demo]("https://github.com/Wox-launcher/Wox/wiki/Screenshot") +![demo]("http://i.imgur.com/DtxNBJi.gifv") Features ========= From dccd240b66de3a8e85a33c5bacfdbfbda9d8fdc0 Mon Sep 17 00:00:00 2001 From: bao-qian Date: Mon, 14 Dec 2015 00:21:03 +0000 Subject: [PATCH 12/18] fixup --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1f518ed8b..c870ebe13 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ Wox [![Build status](https://ci.appveyor.com/api/projects/status/bfktntbivg32e Demo ========= -[More demo]("https://github.com/Wox-launcher/Wox/wiki/Screenshot") -![demo]("http://i.imgur.com/DtxNBJi.gifv") +[More demo](https://github.com/Wox-launcher/Wox/wiki/Screenshot) +![demo](http://i.imgur.com/DtxNBJi.gif) Features ========= From a860acaf0db3dd44f64e60c989a22399fe6ef6e9 Mon Sep 17 00:00:00 2001 From: bao-qian Date: Mon, 14 Dec 2015 10:32:45 +0000 Subject: [PATCH 13/18] Remove .net 4 compability --- Wox/App.config | 11 ----------- Wox/Wox.csproj | 3 --- 2 files changed, 14 deletions(-) delete mode 100644 Wox/App.config diff --git a/Wox/App.config b/Wox/App.config deleted file mode 100644 index e52b8a201..000000000 --- a/Wox/App.config +++ /dev/null @@ -1,11 +0,0 @@ - - - -
- - - - - - - \ No newline at end of file diff --git a/Wox/Wox.csproj b/Wox/Wox.csproj index 0452d92c3..998a8f21a 100644 --- a/Wox/Wox.csproj +++ b/Wox/Wox.csproj @@ -312,9 +312,6 @@ ResXFileCodeGenerator Resources.Designer.cs - - Designer - SettingsSingleFileGenerator Settings.Designer.cs From 35c819788110edefbd616c935511fed4b02fd0fc Mon Sep 17 00:00:00 2001 From: Bitdeli Chef Date: Tue, 15 Dec 2015 00:58:21 +0000 Subject: [PATCH 14/18] Add a Bitdeli badge to README --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index c870ebe13..e4006b0a1 100644 --- a/README.md +++ b/README.md @@ -43,3 +43,7 @@ Docs Full documentation can be found here [Wox doc](http://doc.getwox.com). This is a good place to start if you are installing Wox for the first time. In the future, all of the documentation will be moved back to Github wiki. + + +[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/Wox-launcher/wox/trend.png)](https://bitdeli.com/free "Bitdeli Badge") + From 3b50428f8274bc3293a3e2d918df79d29eea18cd Mon Sep 17 00:00:00 2001 From: bao-qian Date: Tue, 15 Dec 2015 00:55:06 +0000 Subject: [PATCH 15/18] Add downloads count --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e4006b0a1..103beea18 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Wox [![Build status](https://ci.appveyor.com/api/projects/status/bfktntbivg32e103)](https://ci.appveyor.com/project/qianlifeng/wox) [![Bountysource](https://www.bountysource.com/badge/team?team_id=39433&style=raised)](https://www.bountysource.com/teams/wox?utm_source=Wox&utm_medium=shield&utm_campaign=raised) [![Issue Stats](http://issuestats.com/github/Wox-launcher/Wox/badge/pr)](http://issuestats.com/github/Wox-launcher/Wox) +Wox [![Build status](https://ci.appveyor.com/api/projects/status/bfktntbivg32e103)](https://ci.appveyor.com/project/qianlifeng/wox) [![Bountysource](https://www.bountysource.com/badge/team?team_id=39433&style=raised)](https://www.bountysource.com/teams/wox?utm_source=Wox&utm_medium=shield&utm_campaign=raised) [![Issue Stats](http://issuestats.com/github/Wox-launcher/Wox/badge/pr)](http://issuestats.com/github/Wox-launcher/Wox) [![Github All Releases](https://img.shields.io/github/downloads/Wox-launcher/Wox/total.svg)]() ========= [Wox](http://www.getwox.com/) is a launcher for Windows, an alternative to [Alfred](https://www.alfredapp.com/) or [Launchy](http://www.launchy.net/). You can launch everything with just a few keystrokes! @@ -45,5 +45,8 @@ Full documentation can be found here [Wox doc](http://doc.getwox.com). This is a In the future, all of the documentation will be moved back to Github wiki. + +========= + [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/Wox-launcher/wox/trend.png)](https://bitdeli.com/free "Bitdeli Badge") From 6416fe1934c38a29535ec36b8c1243f8aadc1e12 Mon Sep 17 00:00:00 2001 From: bao-qian Date: Tue, 15 Dec 2015 00:57:38 +0000 Subject: [PATCH 16/18] Update link for badges --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 103beea18..b396cf7e9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Wox [![Build status](https://ci.appveyor.com/api/projects/status/bfktntbivg32e103)](https://ci.appveyor.com/project/qianlifeng/wox) [![Bountysource](https://www.bountysource.com/badge/team?team_id=39433&style=raised)](https://www.bountysource.com/teams/wox?utm_source=Wox&utm_medium=shield&utm_campaign=raised) [![Issue Stats](http://issuestats.com/github/Wox-launcher/Wox/badge/pr)](http://issuestats.com/github/Wox-launcher/Wox) [![Github All Releases](https://img.shields.io/github/downloads/Wox-launcher/Wox/total.svg)]() +Wox [![Build status](https://ci.appveyor.com/api/projects/status/bfktntbivg32e103)](https://ci.appveyor.com/project/qianlifeng/wox) [![Bountysource](https://www.bountysource.com/badge/team?team_id=39433&style=raised)](https://www.bountysource.com/teams/wox?utm_source=Wox&utm_medium=shield&utm_campaign=raised) [![Issue Stats](http://issuestats.com/github/Wox-launcher/Wox/badge/pr)](http://issuestats.com/github/Wox-launcher/Wox) [![Github All Releases](https://img.shields.io/github/downloads/Wox-launcher/Wox/total.svg)](https://github.com/Wox-launcher/Wox/releases) ========= [Wox](http://www.getwox.com/) is a launcher for Windows, an alternative to [Alfred](https://www.alfredapp.com/) or [Launchy](http://www.launchy.net/). You can launch everything with just a few keystrokes! From 37f90e6f1c38a97b38a6dd4c7aef7ba071fa4f6e Mon Sep 17 00:00:00 2001 From: bao-qian Date: Tue, 15 Dec 2015 12:13:44 +0000 Subject: [PATCH 17/18] Update README.md download badges is not working. --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b396cf7e9..5ae22c8b6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ -Wox [![Build status](https://ci.appveyor.com/api/projects/status/bfktntbivg32e103)](https://ci.appveyor.com/project/qianlifeng/wox) [![Bountysource](https://www.bountysource.com/badge/team?team_id=39433&style=raised)](https://www.bountysource.com/teams/wox?utm_source=Wox&utm_medium=shield&utm_campaign=raised) [![Issue Stats](http://issuestats.com/github/Wox-launcher/Wox/badge/pr)](http://issuestats.com/github/Wox-launcher/Wox) [![Github All Releases](https://img.shields.io/github/downloads/Wox-launcher/Wox/total.svg)](https://github.com/Wox-launcher/Wox/releases) +[![Build status](https://ci.appveyor.com/api/projects/status/bfktntbivg32e103)](https://ci.appveyor.com/project/qianlifeng/wox) +[![Bountysource](https://www.bountysource.com/badge/team?team_id=39433&style=raised)](https://www.bountysource.com/teams/wox?utm_source=Wox&utm_medium=shield&utm_campaign=raised) +[![Issue Stats](http://issuestats.com/github/Wox-launcher/Wox/badge/pr)](http://issuestats.com/github/Wox-launcher/Wox) + ========= -[Wox](http://www.getwox.com/) is a launcher for Windows, an alternative to [Alfred](https://www.alfredapp.com/) or [Launchy](http://www.launchy.net/). You can launch everything with just a few keystrokes! + +Wox is a launcher for Windows, an alternative to [Alfred](https://www.alfredapp.com/) and [Launchy](http://www.launchy.net/). You can launch everything with just a few keystrokes! Demo ========= From e5c6136950b82b2a0af032116622009c318bdf94 Mon Sep 17 00:00:00 2001 From: bao-qian Date: Tue, 15 Dec 2015 12:14:56 +0000 Subject: [PATCH 18/18] The bitdeli badge is useless --- README.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/README.md b/README.md index 5ae22c8b6..3f68a71a7 100644 --- a/README.md +++ b/README.md @@ -47,10 +47,3 @@ Docs Full documentation can be found here [Wox doc](http://doc.getwox.com). This is a good place to start if you are installing Wox for the first time. In the future, all of the documentation will be moved back to Github wiki. - - - -========= - -[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/Wox-launcher/wox/trend.png)](https://bitdeli.com/free "Bitdeli Badge") -