Better exception report.

This commit is contained in:
qianlifeng
2015-01-16 23:42:12 +08:00
parent 32e0074f26
commit 9d39b616f9
12 changed files with 98 additions and 80 deletions

View File

@@ -353,28 +353,38 @@ namespace Wox
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 30ms, if there still no results added, we
// 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;
var q = new Query(lastQuery);
PluginManager.Query(q);
Query(q);
BackToResultMode();
if (PluginManager.IsUserPluginQuery(q))
Dispatcher.DelayInvoke("ShowProgressbar", originQuery =>
{
Dispatcher.DelayInvoke("ShowProgressbar", originQuery =>
if (!queryHasReturn && originQuery == lastQuery)
{
if (!queryHasReturn && originQuery == lastQuery)
{
StartProgress();
}
}, TimeSpan.FromSeconds(0), lastQuery);
}
StartProgress();
}
}, TimeSpan.FromMilliseconds(150), lastQuery);
}, TimeSpan.FromMilliseconds(ShouldNotDelayQuery ? 0 : 200));
}
private void Query(Query q)
{
try
{
PluginManager.Query(q);
}
catch (Exception e)
{
StopProgress();
ErrorReporting.Report(e);
}
}
private void BackToResultMode()
{
pnlResult.Visibility = Visibility.Visible;