mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 12:46:47 +02:00
Merge branch 'dev' of https://github.com/qianlifeng/Wox into dev
This commit is contained in:
@@ -2,4 +2,4 @@ Wox [ =>
|
Action = (c) =>
|
||||||
{
|
{
|
||||||
Clipboard.SetText(result.Result);
|
try
|
||||||
return true;
|
{
|
||||||
|
Clipboard.SetText(result.Result);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (System.Runtime.InteropServices.ExternalException e)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Copy failed, please try later");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} };
|
} };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
@@ -42,7 +42,7 @@ namespace Wox.Plugin.SystemPlugins
|
|||||||
IcoPath = webSearch.IconPath,
|
IcoPath = webSearch.IconPath,
|
||||||
Action = (c) =>
|
Action = (c) =>
|
||||||
{
|
{
|
||||||
Process.Start(webSearch.Url.Replace("{q}", keyword));
|
Process.Start(webSearch.Url.Replace("{q}", Uri.EscapeDataString(keyword)));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -66,7 +66,7 @@ namespace Wox.Plugin.SystemPlugins
|
|||||||
IcoPath = webSearch.IconPath,
|
IcoPath = webSearch.IconPath,
|
||||||
Action = (c) =>
|
Action = (c) =>
|
||||||
{
|
{
|
||||||
Process.Start(webSearch.Url.Replace("{q}", o));
|
Process.Start(webSearch.Url.Replace("{q}", Uri.EscapeDataString(o)));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}).ToList());
|
}).ToList());
|
||||||
|
|||||||
@@ -28,26 +28,22 @@ namespace Wox.Helper.ErrorReporting
|
|||||||
|
|
||||||
public static void DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
|
public static void DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
|
||||||
{
|
{
|
||||||
if (System.Diagnostics.Debugger.IsAttached) return;
|
if (Debugger.IsAttached) return;
|
||||||
|
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
string error = CreateExceptionReport("System.Windows.Application.DispatcherUnhandledException", e.Exception);
|
string error = CreateExceptionReport("System.Windows.Application.DispatcherUnhandledException", e.Exception);
|
||||||
|
|
||||||
Log.Error(error);
|
Log.Error(error);
|
||||||
if (TryShowErrorMessageBox(error, e.Exception))
|
TryShowErrorMessageBox(error, e.Exception);
|
||||||
{
|
|
||||||
Environment.Exit(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public static void ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
|
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);
|
string error = CreateExceptionReport("System.Windows.Forms.Application.ThreadException", e.Exception);
|
||||||
|
|
||||||
Log.Fatal(error);
|
Log.Fatal(error);
|
||||||
TryShowErrorMessageBox(error, e.Exception);
|
TryShowErrorMessageBox(error, e.Exception);
|
||||||
Environment.Exit(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string CreateExceptionReport(string ev, object exceptionObject)
|
private static string CreateExceptionReport(string ev, object exceptionObject)
|
||||||
@@ -98,7 +94,7 @@ namespace Wox.Helper.ErrorReporting
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
sb.AppendLine(exceptionObject.GetType().FullName);
|
sb.AppendLine(exceptionObject.GetType().FullName);
|
||||||
sb.AppendLine(new System.Diagnostics.StackTrace().ToString());
|
sb.AppendLine(new StackTrace().ToString());
|
||||||
sb.AppendLine("```");
|
sb.AppendLine("```");
|
||||||
sb.AppendLine();
|
sb.AppendLine();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user