From a30f60c2bac2b53a50551fc2c6273c2c88ca6f78 Mon Sep 17 00:00:00 2001 From: qianlifeng Date: Wed, 20 Aug 2014 22:12:45 +0800 Subject: [PATCH 1/3] Fix a clipboard crash issues & don't default exit Wox when exception happens. --- Wox.Plugin.SystemPlugins/Calculator.cs | 12 ++++++++++-- Wox/Helper/ErrorReporting/ErrorReporting.cs | 12 ++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Wox.Plugin.SystemPlugins/Calculator.cs b/Wox.Plugin.SystemPlugins/Calculator.cs index c1f135482e..67602cc47b 100644 --- a/Wox.Plugin.SystemPlugins/Calculator.cs +++ b/Wox.Plugin.SystemPlugins/Calculator.cs @@ -49,8 +49,16 @@ namespace Wox.Plugin.SystemPlugins SubTitle = "Copy this number to the clipboard", Action = (c) => { - Clipboard.SetText(result.Result); - return true; + try + { + Clipboard.SetText(result.Result); + return true; + } + catch (System.Runtime.InteropServices.ExternalException e) + { + MessageBox.Show("Copy failed, please try later"); + return false; + } } } }; } diff --git a/Wox/Helper/ErrorReporting/ErrorReporting.cs b/Wox/Helper/ErrorReporting/ErrorReporting.cs index 2134fa42cf..8b572a530c 100644 --- a/Wox/Helper/ErrorReporting/ErrorReporting.cs +++ b/Wox/Helper/ErrorReporting/ErrorReporting.cs @@ -27,26 +27,22 @@ namespace Wox.Helper.ErrorReporting public static void DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) { - if (System.Diagnostics.Debugger.IsAttached) return; + if (Debugger.IsAttached) return; e.Handled = true; string error = CreateExceptionReport("System.Windows.Application.DispatcherUnhandledException", e.Exception); Log.Error(error); - if (TryShowErrorMessageBox(error, e.Exception)) - { - Environment.Exit(0); - } + TryShowErrorMessageBox(error, e.Exception); } public static void ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e) { - if (System.Diagnostics.Debugger.IsAttached) return; + if (Debugger.IsAttached) return; string error = CreateExceptionReport("System.Windows.Forms.Application.ThreadException", e.Exception); Log.Fatal(error); TryShowErrorMessageBox(error, e.Exception); - Environment.Exit(0); } private static string CreateExceptionReport(string ev, object exceptionObject) @@ -97,7 +93,7 @@ namespace Wox.Helper.ErrorReporting else { sb.AppendLine(exceptionObject.GetType().FullName); - sb.AppendLine(new System.Diagnostics.StackTrace().ToString()); + sb.AppendLine(new StackTrace().ToString()); sb.AppendLine("```"); sb.AppendLine(); } From db0f228f4d112e4d01f9953c4a3d309769c871f9 Mon Sep 17 00:00:00 2001 From: zlsun Date: Mon, 25 Aug 2014 16:20:08 +0800 Subject: [PATCH 2/3] WebSearch: convert search word to url encoding before opening the url --- Wox.Plugin.SystemPlugins/WebSearch/WebSearchPlugin.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Wox.Plugin.SystemPlugins/WebSearch/WebSearchPlugin.cs b/Wox.Plugin.SystemPlugins/WebSearch/WebSearchPlugin.cs index 97fe4e505e..67e1687055 100644 --- a/Wox.Plugin.SystemPlugins/WebSearch/WebSearchPlugin.cs +++ b/Wox.Plugin.SystemPlugins/WebSearch/WebSearchPlugin.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; @@ -42,7 +42,7 @@ namespace Wox.Plugin.SystemPlugins IcoPath = webSearch.IconPath, Action = (c) => { - Process.Start(webSearch.Url.Replace("{q}", keyword)); + Process.Start(webSearch.Url.Replace("{q}", Uri.EscapeDataString(keyword))); return true; } } @@ -66,7 +66,7 @@ namespace Wox.Plugin.SystemPlugins IcoPath = webSearch.IconPath, Action = (c) => { - Process.Start(webSearch.Url.Replace("{q}", o)); + Process.Start(webSearch.Url.Replace("{q}", Uri.EscapeDataString(o))); return true; } }).ToList()); From d929205becd7abb42e49bead3c53334273e86922 Mon Sep 17 00:00:00 2001 From: qianlifeng Date: Fri, 19 Sep 2014 11:02:28 +0800 Subject: [PATCH 3/3] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 23788ea537..e7ea29e58e 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,4 @@ Wox [![Build status](https://ci.appveyor.com/api/projects/status/bfktntbivg32e ========= This is Wox Dev branch. We will develop new feature here and merge to master when we want to release a new version. -**Please send pull request to this branch if you wanto to contribute codes** +**Please send pull request to this branch if you want to contribute codes**