mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-10 13:35:31 +02:00
Using new thread to check upgrade
This commit is contained in:
@@ -8,7 +8,7 @@ using Wox.Infrastructure;
|
|||||||
|
|
||||||
namespace Wox.Plugin.Sys
|
namespace Wox.Plugin.Sys
|
||||||
{
|
{
|
||||||
public class Sys : IPlugin, ISettingProvider ,IPluginI18n
|
public class Sys : IPlugin, ISettingProvider, IPluginI18n
|
||||||
{
|
{
|
||||||
List<Result> availableResults = new List<Result>();
|
List<Result> availableResults = new List<Result>();
|
||||||
private PluginInitContext context;
|
private PluginInitContext context;
|
||||||
@@ -35,11 +35,6 @@ namespace Wox.Plugin.Sys
|
|||||||
|
|
||||||
public List<Result> Query(Query query)
|
public List<Result> Query(Query query)
|
||||||
{
|
{
|
||||||
if (availableResults.Count == 0)
|
|
||||||
{
|
|
||||||
LoadCommands();
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Result> results = new List<Result>();
|
List<Result> results = new List<Result>();
|
||||||
foreach (Result availableResult in availableResults)
|
foreach (Result availableResult in availableResults)
|
||||||
{
|
{
|
||||||
@@ -54,6 +49,7 @@ namespace Wox.Plugin.Sys
|
|||||||
public void Init(PluginInitContext context)
|
public void Init(PluginInitContext context)
|
||||||
{
|
{
|
||||||
this.context = context;
|
this.context = context;
|
||||||
|
LoadCommands();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LoadCommands()
|
private void LoadCommands()
|
||||||
|
|||||||
@@ -3,9 +3,6 @@ using System.Windows.Controls;
|
|||||||
|
|
||||||
namespace Wox.Plugin.Sys
|
namespace Wox.Plugin.Sys
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for SysSettings.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class SysSettings : UserControl
|
public partial class SysSettings : UserControl
|
||||||
{
|
{
|
||||||
public SysSettings(List<Result> Results)
|
public SysSettings(List<Result> Results)
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ using Wox.Core.i18n;
|
|||||||
using Wox.Core.UserSettings;
|
using Wox.Core.UserSettings;
|
||||||
using Wox.Infrastructure.Http;
|
using Wox.Infrastructure.Http;
|
||||||
using Wox.Infrastructure.Logger;
|
using Wox.Infrastructure.Logger;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
namespace Wox.Core.Updater
|
namespace Wox.Core.Updater
|
||||||
{
|
{
|
||||||
@@ -81,6 +82,8 @@ namespace Wox.Core.Updater
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void CheckUpdate()
|
public void CheckUpdate()
|
||||||
|
{
|
||||||
|
ThreadPool.QueueUserWorkItem(o =>
|
||||||
{
|
{
|
||||||
string json = HttpRequest.Get(VersionCheckURL, HttpProxy.Instance);
|
string json = HttpRequest.Get(VersionCheckURL, HttpProxy.Instance);
|
||||||
if (!string.IsNullOrEmpty(json))
|
if (!string.IsNullOrEmpty(json))
|
||||||
@@ -98,6 +101,7 @@ namespace Wox.Core.Updater
|
|||||||
Log.Error(e);
|
Log.Error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void StartUpdate()
|
private void StartUpdate()
|
||||||
|
|||||||
Reference in New Issue
Block a user