From 4ea5dd5ad2ad6d4869d57c8aed1e187d81662135 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Tue, 13 Oct 2020 20:54:00 +0800
Subject: [PATCH 01/95] Move Old HttpWebRequest to HttpClient Instance (solve
connection timeout)
---
Flow.Launcher.Core/Updater.cs | 2 +-
Flow.Launcher.Infrastructure/Http/Http.cs | 77 ++++++++++++++---------
2 files changed, 48 insertions(+), 31 deletions(-)
diff --git a/Flow.Launcher.Core/Updater.cs b/Flow.Launcher.Core/Updater.cs
index 99d48275a..4ad8b19be 100644
--- a/Flow.Launcher.Core/Updater.cs
+++ b/Flow.Launcher.Core/Updater.cs
@@ -139,7 +139,7 @@ namespace Flow.Launcher.Core
var latest = releases.Where(r => !r.Prerelease).OrderByDescending(r => r.PublishedAt).First();
var latestUrl = latest.HtmlUrl.Replace("/tag/", "/download/");
- var client = new WebClient { Proxy = Http.WebProxy() };
+ var client = new WebClient { Proxy = Http.WebProxy };
var downloader = new FileDownloader(client);
var manager = new UpdateManager(latestUrl, urlDownloader: downloader);
diff --git a/Flow.Launcher.Infrastructure/Http/Http.cs b/Flow.Launcher.Infrastructure/Http/Http.cs
index b7d274205..038362a0d 100644
--- a/Flow.Launcher.Infrastructure/Http/Http.cs
+++ b/Flow.Launcher.Infrastructure/Http/Http.cs
@@ -13,6 +13,13 @@ namespace Flow.Launcher.Infrastructure.Http
{
private const string UserAgent = @"Mozilla/5.0 (Trident/7.0; rv:11.0) like Gecko";
+ private static HttpClient client;
+ private static SocketsHttpHandler socketsHttpHandler = new SocketsHttpHandler()
+ {
+ UseProxy = true,
+ Proxy = WebProxy
+ };
+
static Http()
{
// need to be added so it would work on a win10 machine
@@ -20,36 +27,55 @@ namespace Flow.Launcher.Infrastructure.Http
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12;
+
+ client.DefaultRequestHeaders.Add("User-Agent", UserAgent);
+
+ }
+ private static HttpProxy proxy;
+ public static HttpProxy Proxy
+ {
+ private get
+ {
+ return proxy;
+ }
+ set
+ {
+ proxy = value;
+ UpdateProxy();
+ }
}
- public static HttpProxy Proxy { private get; set; }
- public static IWebProxy WebProxy()
+ public static WebProxy WebProxy { get; private set; }
+
+ ///
+ /// Update the Address of the Proxy to modify the client Proxy
+ ///
+ public static void UpdateProxy()
+ // TODO: need test with a proxy
{
if (Proxy != null && Proxy.Enabled && !string.IsNullOrEmpty(Proxy.Server))
{
if (string.IsNullOrEmpty(Proxy.UserName) || string.IsNullOrEmpty(Proxy.Password))
{
- var webProxy = new WebProxy(Proxy.Server, Proxy.Port);
- return webProxy;
+ WebProxy.Address = new Uri($"http://{Proxy.Server}:{Proxy.Port}");
+ WebProxy.Credentials = null;
}
else
{
- var webProxy = new WebProxy(Proxy.Server, Proxy.Port)
- {
- Credentials = new NetworkCredential(Proxy.UserName, Proxy.Password)
- };
- return webProxy;
+ WebProxy.Address = new Uri($"http://{Proxy.Server}:{Proxy.Port}");
+ WebProxy.Credentials = new NetworkCredential(Proxy.UserName, Proxy.Password);
}
}
else
{
- return WebRequest.GetSystemWebProxy();
+ WebProxy.Address = new WebProxy().Address;
+ WebProxy.Credentials = null;
}
}
public static void Download([NotNull] string url, [NotNull] string filePath)
{
- var client = new WebClient { Proxy = WebProxy() };
+ var client = new WebClient { Proxy = WebProxy };
client.Headers.Add("user-agent", UserAgent);
client.DownloadFile(url, filePath);
}
@@ -57,26 +83,17 @@ namespace Flow.Launcher.Infrastructure.Http
public static async Task Get([NotNull] string url, string encoding = "UTF-8")
{
Log.Debug($"|Http.Get|Url <{url}>");
- var request = WebRequest.CreateHttp(url);
- request.Method = "GET";
- request.Timeout = 1000;
- request.Proxy = WebProxy();
- request.UserAgent = UserAgent;
- var response = await request.GetResponseAsync() as HttpWebResponse;
- response = response.NonNull();
- var stream = response.GetResponseStream().NonNull();
-
- using (var reader = new StreamReader(stream, Encoding.GetEncoding(encoding)))
+ var response = await client.GetAsync(url);
+ using var stream = await response.Content.ReadAsStreamAsync();
+ using var reader = new StreamReader(stream, Encoding.GetEncoding(encoding));
+ var content = await reader.ReadToEndAsync();
+ if (response.StatusCode == HttpStatusCode.OK)
{
- var content = await reader.ReadToEndAsync();
- if (response.StatusCode == HttpStatusCode.OK)
- {
- return content;
- }
- else
- {
- throw new HttpRequestException($"Error code <{response.StatusCode}> with content <{content}> returned from <{url}>");
- }
+ return content;
+ }
+ else
+ {
+ throw new HttpRequestException($"Error code <{response.StatusCode}> with content <{content}> returned from <{url}>");
}
}
}
From a16cc5be8db3b5d52acf12565b029439c8d1a921 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Tue, 13 Oct 2020 20:54:00 +0800
Subject: [PATCH 02/95] Move Old HttpWebRequest to HttpClient Instance (solve
connection timeout)
---
Flow.Launcher.Core/Updater.cs | 2 +-
Flow.Launcher.Infrastructure/Http/Http.cs | 78 ++++++++++++++---------
2 files changed, 49 insertions(+), 31 deletions(-)
diff --git a/Flow.Launcher.Core/Updater.cs b/Flow.Launcher.Core/Updater.cs
index 99d48275a..4ad8b19be 100644
--- a/Flow.Launcher.Core/Updater.cs
+++ b/Flow.Launcher.Core/Updater.cs
@@ -139,7 +139,7 @@ namespace Flow.Launcher.Core
var latest = releases.Where(r => !r.Prerelease).OrderByDescending(r => r.PublishedAt).First();
var latestUrl = latest.HtmlUrl.Replace("/tag/", "/download/");
- var client = new WebClient { Proxy = Http.WebProxy() };
+ var client = new WebClient { Proxy = Http.WebProxy };
var downloader = new FileDownloader(client);
var manager = new UpdateManager(latestUrl, urlDownloader: downloader);
diff --git a/Flow.Launcher.Infrastructure/Http/Http.cs b/Flow.Launcher.Infrastructure/Http/Http.cs
index b7d274205..81c07eff7 100644
--- a/Flow.Launcher.Infrastructure/Http/Http.cs
+++ b/Flow.Launcher.Infrastructure/Http/Http.cs
@@ -6,6 +6,7 @@ using System.Threading.Tasks;
using JetBrains.Annotations;
using Flow.Launcher.Infrastructure.Logger;
using Flow.Launcher.Infrastructure.UserSettings;
+using System;
namespace Flow.Launcher.Infrastructure.Http
{
@@ -13,6 +14,13 @@ namespace Flow.Launcher.Infrastructure.Http
{
private const string UserAgent = @"Mozilla/5.0 (Trident/7.0; rv:11.0) like Gecko";
+ private static HttpClient client;
+ private static SocketsHttpHandler socketsHttpHandler = new SocketsHttpHandler()
+ {
+ UseProxy = true,
+ Proxy = WebProxy
+ };
+
static Http()
{
// need to be added so it would work on a win10 machine
@@ -20,36 +28,55 @@ namespace Flow.Launcher.Infrastructure.Http
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12;
+
+ client.DefaultRequestHeaders.Add("User-Agent", UserAgent);
+
+ }
+ private static HttpProxy proxy;
+ public static HttpProxy Proxy
+ {
+ private get
+ {
+ return proxy;
+ }
+ set
+ {
+ proxy = value;
+ UpdateProxy();
+ }
}
- public static HttpProxy Proxy { private get; set; }
- public static IWebProxy WebProxy()
+ public static WebProxy WebProxy { get; private set; }
+
+ ///
+ /// Update the Address of the Proxy to modify the client Proxy
+ ///
+ public static void UpdateProxy()
+ // TODO: need test with a proxy
{
if (Proxy != null && Proxy.Enabled && !string.IsNullOrEmpty(Proxy.Server))
{
if (string.IsNullOrEmpty(Proxy.UserName) || string.IsNullOrEmpty(Proxy.Password))
{
- var webProxy = new WebProxy(Proxy.Server, Proxy.Port);
- return webProxy;
+ WebProxy.Address = new Uri($"http://{Proxy.Server}:{Proxy.Port}");
+ WebProxy.Credentials = null;
}
else
{
- var webProxy = new WebProxy(Proxy.Server, Proxy.Port)
- {
- Credentials = new NetworkCredential(Proxy.UserName, Proxy.Password)
- };
- return webProxy;
+ WebProxy.Address = new Uri($"http://{Proxy.Server}:{Proxy.Port}");
+ WebProxy.Credentials = new NetworkCredential(Proxy.UserName, Proxy.Password);
}
}
else
{
- return WebRequest.GetSystemWebProxy();
+ WebProxy.Address = new WebProxy().Address;
+ WebProxy.Credentials = null;
}
}
public static void Download([NotNull] string url, [NotNull] string filePath)
{
- var client = new WebClient { Proxy = WebProxy() };
+ var client = new WebClient { Proxy = WebProxy };
client.Headers.Add("user-agent", UserAgent);
client.DownloadFile(url, filePath);
}
@@ -57,26 +84,17 @@ namespace Flow.Launcher.Infrastructure.Http
public static async Task Get([NotNull] string url, string encoding = "UTF-8")
{
Log.Debug($"|Http.Get|Url <{url}>");
- var request = WebRequest.CreateHttp(url);
- request.Method = "GET";
- request.Timeout = 1000;
- request.Proxy = WebProxy();
- request.UserAgent = UserAgent;
- var response = await request.GetResponseAsync() as HttpWebResponse;
- response = response.NonNull();
- var stream = response.GetResponseStream().NonNull();
-
- using (var reader = new StreamReader(stream, Encoding.GetEncoding(encoding)))
+ var response = await client.GetAsync(url);
+ using var stream = await response.Content.ReadAsStreamAsync();
+ using var reader = new StreamReader(stream, Encoding.GetEncoding(encoding));
+ var content = await reader.ReadToEndAsync();
+ if (response.StatusCode == HttpStatusCode.OK)
{
- var content = await reader.ReadToEndAsync();
- if (response.StatusCode == HttpStatusCode.OK)
- {
- return content;
- }
- else
- {
- throw new HttpRequestException($"Error code <{response.StatusCode}> with content <{content}> returned from <{url}>");
- }
+ return content;
+ }
+ else
+ {
+ throw new HttpRequestException($"Error code <{response.StatusCode}> with content <{content}> returned from <{url}>");
}
}
}
From c55e889f4fb37aa2624eec4523cbcd94cadc3293 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Wed, 14 Oct 2020 11:29:12 +0800
Subject: [PATCH 03/95] Change Download to HttpClient as well (which change it
to async as well)
---
Flow.Launcher.Infrastructure/Http/Http.cs | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/Flow.Launcher.Infrastructure/Http/Http.cs b/Flow.Launcher.Infrastructure/Http/Http.cs
index 81c07eff7..34665217c 100644
--- a/Flow.Launcher.Infrastructure/Http/Http.cs
+++ b/Flow.Launcher.Infrastructure/Http/Http.cs
@@ -29,6 +29,7 @@ namespace Flow.Launcher.Infrastructure.Http
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12;
+ client = new HttpClient(socketsHttpHandler, false);
client.DefaultRequestHeaders.Add("User-Agent", UserAgent);
}
@@ -46,7 +47,7 @@ namespace Flow.Launcher.Infrastructure.Http
}
}
- public static WebProxy WebProxy { get; private set; }
+ public static WebProxy WebProxy { get; private set; } = new WebProxy();
///
/// Update the Address of the Proxy to modify the client Proxy
@@ -74,11 +75,18 @@ namespace Flow.Launcher.Infrastructure.Http
}
}
- public static void Download([NotNull] string url, [NotNull] string filePath)
+ public async static Task Download([NotNull] string url, [NotNull] string filePath)
{
- var client = new WebClient { Proxy = WebProxy };
- client.Headers.Add("user-agent", UserAgent);
- client.DownloadFile(url, filePath);
+ using var response = await client.GetAsync(url);
+ if (response.StatusCode == HttpStatusCode.OK)
+ {
+ using var fileStream = new FileStream(filePath, FileMode.CreateNew);
+ await response.Content.CopyToAsync(fileStream);
+ }
+ else
+ {
+ throw new WebException($"Error code <{response.StatusCode}> returned from <{url}>");
+ }
}
public static async Task Get([NotNull] string url, string encoding = "UTF-8")
From 424d757add58ccb38b50332b8a7597e8768b84bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Wed, 14 Oct 2020 11:29:38 +0800
Subject: [PATCH 04/95] Add Task.Run due to the change of async download
---
.../Main.cs | 24 ++++++++++---------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginManagement/Main.cs b/Plugins/Flow.Launcher.Plugin.PluginManagement/Main.cs
index e1b631517..0255216a0 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginManagement/Main.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginManagement/Main.cs
@@ -144,7 +144,7 @@ namespace Flow.Launcher.Plugin.PluginManagement
IcoPath = "Images\\plugin.png",
TitleHighlightData = StringMatcher.FuzzySearch(query.SecondSearch, r.name).MatchData,
SubTitleHighlightData = StringMatcher.FuzzySearch(query.SecondSearch, r.description).MatchData,
- Action = c =>
+ Action = _ =>
{
MessageBoxResult result = MessageBox.Show("Are you sure you wish to install the \'" + r.name + "\' plugin",
"Install plugin", MessageBoxButton.YesNo);
@@ -157,17 +157,19 @@ namespace Flow.Launcher.Plugin.PluginManagement
string pluginUrl = APIBASE + "/media/" + r1.plugin_file;
- try
+ Task.Run(async () =>
{
- Http.Download(pluginUrl, filePath);
- }
- catch (WebException e)
- {
- context.API.ShowMsg($"PluginManagement.ResultForInstallPlugin: download failed for <{r.name}>");
- Log.Exception($"|PluginManagement.ResultForInstallPlugin|download failed for <{r.name}>", e);
- return false;
- }
- context.API.InstallPlugin(filePath);
+ try
+ {
+ await Http.Download(pluginUrl, filePath);
+ context.API.InstallPlugin(filePath);
+ }
+ catch (WebException e)
+ {
+ context.API.ShowMsg($"PluginManagement.ResultForInstallPlugin: download failed for <{r.name}>");
+ Log.Exception($"|PluginManagement.ResultForInstallPlugin|download failed for <{r.name}>", e);
+ }
+ });
}
return false;
}
From cbfa3f354dc5c19cd84d1573853792db0b93cb41 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Sun, 20 Dec 2020 17:44:46 +0800
Subject: [PATCH 05/95] Inform user when checking update fail or update fail,
and wrap all code in one try catch instead of catch each exception seperately
since they are all same kind of exception. Use using instead of manually
dispose.
---
Flow.Launcher.Core/Updater.cs | 110 ++++++++++++++--------------------
1 file changed, 45 insertions(+), 65 deletions(-)
diff --git a/Flow.Launcher.Core/Updater.cs b/Flow.Launcher.Core/Updater.cs
index 20df23e40..3369526e0 100644
--- a/Flow.Launcher.Core/Updater.cs
+++ b/Flow.Launcher.Core/Updater.cs
@@ -29,89 +29,69 @@ namespace Flow.Launcher.Core
GitHubRepository = gitHubRepository;
}
- public async Task UpdateApp(IPublicAPI api , bool silentUpdate = true)
+ public async Task UpdateApp(IPublicAPI api, bool silentUpdate = true)
{
- UpdateManager updateManager;
- UpdateInfo newUpdateInfo;
-
- if (!silentUpdate)
- api.ShowMsg("Please wait...", "Checking for new update");
-
try
{
- updateManager = await GitHubUpdateManager(GitHubRepository);
- }
- catch (Exception e) when (e is HttpRequestException || e is WebException || e is SocketException)
- {
- Log.Exception($"|Updater.UpdateApp|Please check your connection and proxy settings to api.github.com.", e);
- return;
- }
+ UpdateInfo newUpdateInfo;
+
+ if (!silentUpdate)
+ api.ShowMsg("Please wait...", "Checking for new update");
+
+ using var updateManager = await GitHubUpdateManager(GitHubRepository);
+
- try
- {
// UpdateApp CheckForUpdate will return value only if the app is squirrel installed
newUpdateInfo = await updateManager.CheckForUpdate().NonNull();
- }
- catch (Exception e) when (e is HttpRequestException || e is WebException || e is SocketException)
- {
- Log.Exception($"|Updater.UpdateApp|Check your connection and proxy settings to api.github.com.", e);
- updateManager.Dispose();
- return;
- }
- var newReleaseVersion = Version.Parse(newUpdateInfo.FutureReleaseEntry.Version.ToString());
- var currentVersion = Version.Parse(Constant.Version);
+ var newReleaseVersion = Version.Parse(newUpdateInfo.FutureReleaseEntry.Version.ToString());
+ var currentVersion = Version.Parse(Constant.Version);
- Log.Info($"|Updater.UpdateApp|Future Release <{newUpdateInfo.FutureReleaseEntry.Formatted()}>");
+ Log.Info($"|Updater.UpdateApp|Future Release <{newUpdateInfo.FutureReleaseEntry.Formatted()}>");
+
+ if (newReleaseVersion <= currentVersion)
+ {
+ if (!silentUpdate)
+ MessageBox.Show("You already have the latest Flow Launcher version");
+ updateManager.Dispose();
+ return;
+ }
- if (newReleaseVersion <= currentVersion)
- {
if (!silentUpdate)
- MessageBox.Show("You already have the latest Flow Launcher version");
- updateManager.Dispose();
- return;
- }
+ api.ShowMsg("Update found", "Updating...");
- if (!silentUpdate)
- api.ShowMsg("Update found", "Updating...");
-
- try
- {
await updateManager.DownloadReleases(newUpdateInfo.ReleasesToApply);
+
+ await updateManager.ApplyReleases(newUpdateInfo);
+
+ if (DataLocation.PortableDataLocationInUse())
+ {
+ var targetDestination = updateManager.RootAppDirectory + $"\\app-{newReleaseVersion.ToString()}\\{DataLocation.PortableFolderName}";
+ FilesFolders.CopyAll(DataLocation.PortableDataPath, targetDestination);
+ if (!FilesFolders.VerifyBothFolderFilesEqual(DataLocation.PortableDataPath, targetDestination))
+ MessageBox.Show("Flow Launcher was not able to move your user profile data to the new update version. Please manually " +
+ $"move your profile data folder from {DataLocation.PortableDataPath} to {targetDestination}");
+ }
+ else
+ {
+ await updateManager.CreateUninstallerRegistryEntry();
+ }
+
+ var newVersionTips = NewVersinoTips(newReleaseVersion.ToString());
+
+ Log.Info($"|Updater.UpdateApp|Update success:{newVersionTips}");
+
+ if (MessageBox.Show(newVersionTips, "New Update", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
+ {
+ UpdateManager.RestartApp(Constant.ApplicationFileName);
+ }
}
catch (Exception e) when (e is HttpRequestException || e is WebException || e is SocketException)
{
Log.Exception($"|Updater.UpdateApp|Check your connection and proxy settings to github-cloud.s3.amazonaws.com.", e);
- updateManager.Dispose();
+ api.ShowMsg("Update Fail!", "Check your connection and proxy settings to github-cloud.s3.amazonaws.com.");
return;
}
-
- await updateManager.ApplyReleases(newUpdateInfo);
-
- if (DataLocation.PortableDataLocationInUse())
- {
- var targetDestination = updateManager.RootAppDirectory + $"\\app-{newReleaseVersion.ToString()}\\{DataLocation.PortableFolderName}";
- FilesFolders.CopyAll(DataLocation.PortableDataPath, targetDestination);
- if (!FilesFolders.VerifyBothFolderFilesEqual(DataLocation.PortableDataPath, targetDestination))
- MessageBox.Show("Flow Launcher was not able to move your user profile data to the new update version. Please manually " +
- $"move your profile data folder from {DataLocation.PortableDataPath} to {targetDestination}");
- }
- else
- {
- await updateManager.CreateUninstallerRegistryEntry();
- }
-
- var newVersionTips = NewVersinoTips(newReleaseVersion.ToString());
-
- Log.Info($"|Updater.UpdateApp|Update success:{newVersionTips}");
-
- // always dispose UpdateManager
- updateManager.Dispose();
-
- if (MessageBox.Show(newVersionTips, "New Update", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
- {
- UpdateManager.RestartApp(Constant.ApplicationFileName);
- }
}
[UsedImplicitly]
From adad5ae83bd8e036bcf93e2df174d4dbe7d2380e Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Sun, 20 Dec 2020 21:10:55 +1100
Subject: [PATCH 06/95] add url website in Settings
---
Flow.Launcher.Infrastructure/Constant.cs | 2 ++
Flow.Launcher/SettingWindow.xaml | 4 ++--
Flow.Launcher/ViewModel/SettingWindowViewModel.cs | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/Flow.Launcher.Infrastructure/Constant.cs b/Flow.Launcher.Infrastructure/Constant.cs
index df1464048..3dba35f8d 100644
--- a/Flow.Launcher.Infrastructure/Constant.cs
+++ b/Flow.Launcher.Infrastructure/Constant.cs
@@ -35,5 +35,7 @@ namespace Flow.Launcher.Infrastructure
public const string DefaultTheme = "Darker";
public const string Themes = "Themes";
+
+ public const string Website = "https://flow-launcher.github.io";
}
}
diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml
index 32f9e9a6e..e47f0e779 100644
--- a/Flow.Launcher/SettingWindow.xaml
+++ b/Flow.Launcher/SettingWindow.xaml
@@ -429,8 +429,8 @@
-
-
+
+
diff --git a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs
index 853925852..96ee5a052 100644
--- a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs
+++ b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs
@@ -450,7 +450,7 @@ namespace Flow.Launcher.ViewModel
#region about
- public string Github => _updater.GitHubRepository;
+ public string Website => Constant.Website;
public string ReleaseNotes => _updater.GitHubRepository + @"/releases/latest";
public static string Version => Constant.Version;
public string ActivatedTimes => string.Format(_translater.GetTranslation("about_activate_times"), Settings.ActivateTimes);
From acd631be081c2fd044672c997eeb8998246b773d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=A0=E5=BC=98=E9=9F=AC?=
Date: Mon, 21 Dec 2020 19:09:18 +0800
Subject: [PATCH 07/95] Change wording
---
Flow.Launcher.Core/Updater.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Flow.Launcher.Core/Updater.cs b/Flow.Launcher.Core/Updater.cs
index 3369526e0..4e211c3ac 100644
--- a/Flow.Launcher.Core/Updater.cs
+++ b/Flow.Launcher.Core/Updater.cs
@@ -89,7 +89,7 @@ namespace Flow.Launcher.Core
catch (Exception e) when (e is HttpRequestException || e is WebException || e is SocketException)
{
Log.Exception($"|Updater.UpdateApp|Check your connection and proxy settings to github-cloud.s3.amazonaws.com.", e);
- api.ShowMsg("Update Fail!", "Check your connection and proxy settings to github-cloud.s3.amazonaws.com.");
+ api.ShowMsg("Update Failed", "Check your connection and try updating proxy settings to github-cloud.s3.amazonaws.com.");
return;
}
}
From 85f5766022ec2282dd7cf2595c48785964e3433f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=A0=E5=BC=98=E9=9F=AC?=
Date: Mon, 21 Dec 2020 19:30:18 +0800
Subject: [PATCH 08/95] Optimize a few code
---
Flow.Launcher.Infrastructure/Http/Http.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Flow.Launcher.Infrastructure/Http/Http.cs b/Flow.Launcher.Infrastructure/Http/Http.cs
index 34665217c..4ec4f887f 100644
--- a/Flow.Launcher.Infrastructure/Http/Http.cs
+++ b/Flow.Launcher.Infrastructure/Http/Http.cs
@@ -75,12 +75,12 @@ namespace Flow.Launcher.Infrastructure.Http
}
}
- public async static Task Download([NotNull] string url, [NotNull] string filePath)
+ public static async Task Download([NotNull] string url, [NotNull] string filePath)
{
using var response = await client.GetAsync(url);
if (response.StatusCode == HttpStatusCode.OK)
{
- using var fileStream = new FileStream(filePath, FileMode.CreateNew);
+ await using var fileStream = new FileStream(filePath, FileMode.CreateNew);
await response.Content.CopyToAsync(fileStream);
}
else
@@ -93,7 +93,7 @@ namespace Flow.Launcher.Infrastructure.Http
{
Log.Debug($"|Http.Get|Url <{url}>");
var response = await client.GetAsync(url);
- using var stream = await response.Content.ReadAsStreamAsync();
+ await using var stream = await response.Content.ReadAsStreamAsync();
using var reader = new StreamReader(stream, Encoding.GetEncoding(encoding));
var content = await reader.ReadToEndAsync();
if (response.StatusCode == HttpStatusCode.OK)
From 96609f797e672021664c788f1d0acde1afec40ba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=A0=E5=BC=98=E9=9F=AC?=
Date: Mon, 21 Dec 2020 19:42:50 +0800
Subject: [PATCH 09/95] Change the place of Wait in PluginManifest to make code
more elegent
---
.../Models/PluginsManifest.cs | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs
index 290221710..13a5ae2ca 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs
@@ -10,21 +10,19 @@ namespace Flow.Launcher.Plugin.PluginsManager.Models
internal class PluginsManifest
{
internal List UserPlugins { get; private set; }
+
internal PluginsManifest()
{
- DownloadManifest();
+ DownloadManifest().Wait();
}
- private void DownloadManifest()
+ private async Task DownloadManifest()
{
var json = string.Empty;
try
{
- var t = Task.Run(
- async () =>
- json = await Http.Get("https://raw.githubusercontent.com/Flow-Launcher/Flow.Launcher.PluginsManifest/main/plugins.json"));
-
- t.Wait();
+ json = await Http.Get(
+ "https://raw.githubusercontent.com/Flow-Launcher/Flow.Launcher.PluginsManifest/main/plugins.json");
UserPlugins = JsonConvert.DeserializeObject>(json);
}
@@ -34,7 +32,6 @@ namespace Flow.Launcher.Plugin.PluginsManager.Models
UserPlugins = new List();
}
-
}
}
-}
+}
\ No newline at end of file
From 5ab8c4faa3bc858af489096e3b8f4e9f9e290d09 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=A0=E5=BC=98=E9=9F=AC?=
Date: Mon, 21 Dec 2020 20:55:28 +0800
Subject: [PATCH 10/95] Update Proxy every time calling a http request method
since the proxy setting won't update automatically without action
---
Flow.Launcher.Infrastructure/Http/Http.cs | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/Flow.Launcher.Infrastructure/Http/Http.cs b/Flow.Launcher.Infrastructure/Http/Http.cs
index 4ec4f887f..a88d868a6 100644
--- a/Flow.Launcher.Infrastructure/Http/Http.cs
+++ b/Flow.Launcher.Infrastructure/Http/Http.cs
@@ -47,7 +47,14 @@ namespace Flow.Launcher.Infrastructure.Http
}
}
- public static WebProxy WebProxy { get; private set; } = new WebProxy();
+ private static WebProxy _proxy = new WebProxy();
+ public static WebProxy WebProxy {
+ get
+ {
+ UpdateProxy();
+ return _proxy;
+ }
+ }
///
/// Update the Address of the Proxy to modify the client Proxy
@@ -77,6 +84,7 @@ namespace Flow.Launcher.Infrastructure.Http
public static async Task Download([NotNull] string url, [NotNull] string filePath)
{
+ UpdateProxy();
using var response = await client.GetAsync(url);
if (response.StatusCode == HttpStatusCode.OK)
{
@@ -91,6 +99,7 @@ namespace Flow.Launcher.Infrastructure.Http
public static async Task Get([NotNull] string url, string encoding = "UTF-8")
{
+ UpdateProxy();
Log.Debug($"|Http.Get|Url <{url}>");
var response = await client.GetAsync(url);
await using var stream = await response.Content.ReadAsStreamAsync();
From 88fa862277eeff5a49058e72f3ec157ec817aa0a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=A0=E5=BC=98=E9=9F=AC?=
Date: Tue, 22 Dec 2020 00:31:00 +0800
Subject: [PATCH 11/95] Use event triggered update method instead of checking
Proxy every time doing Http request
---
Flow.Launcher.Infrastructure/Http/Http.cs | 64 +++++++--------
.../UserSettings/HttpProxy.cs | 81 +++++++++++++++++--
2 files changed, 105 insertions(+), 40 deletions(-)
diff --git a/Flow.Launcher.Infrastructure/Http/Http.cs b/Flow.Launcher.Infrastructure/Http/Http.cs
index a88d868a6..8fe910c0c 100644
--- a/Flow.Launcher.Infrastructure/Http/Http.cs
+++ b/Flow.Launcher.Infrastructure/Http/Http.cs
@@ -7,6 +7,7 @@ using JetBrains.Annotations;
using Flow.Launcher.Infrastructure.Logger;
using Flow.Launcher.Infrastructure.UserSettings;
using System;
+using System.ComponentModel;
namespace Flow.Launcher.Infrastructure.Http
{
@@ -15,6 +16,7 @@ namespace Flow.Launcher.Infrastructure.Http
private const string UserAgent = @"Mozilla/5.0 (Trident/7.0; rv:11.0) like Gecko";
private static HttpClient client;
+
private static SocketsHttpHandler socketsHttpHandler = new SocketsHttpHandler()
{
UseProxy = true,
@@ -31,60 +33,54 @@ namespace Flow.Launcher.Infrastructure.Http
client = new HttpClient(socketsHttpHandler, false);
client.DefaultRequestHeaders.Add("User-Agent", UserAgent);
-
}
+
private static HttpProxy proxy;
+
public static HttpProxy Proxy
{
- private get
- {
- return proxy;
- }
+ private get { return proxy; }
set
{
proxy = value;
- UpdateProxy();
+ proxy.PropertyChanged += UpdateProxy;
}
}
- private static WebProxy _proxy = new WebProxy();
- public static WebProxy WebProxy {
- get
- {
- UpdateProxy();
- return _proxy;
- }
+ private static readonly WebProxy _proxy = new WebProxy();
+
+ public static WebProxy WebProxy
+ {
+ get { return _proxy; }
}
///
/// Update the Address of the Proxy to modify the client Proxy
///
- public static void UpdateProxy()
- // TODO: need test with a proxy
+ public static void UpdateProxy(ProxyProperty property)
{
- if (Proxy != null && Proxy.Enabled && !string.IsNullOrEmpty(Proxy.Server))
+ (_proxy.Address, _proxy.Credentials) = property switch
{
- if (string.IsNullOrEmpty(Proxy.UserName) || string.IsNullOrEmpty(Proxy.Password))
+ ProxyProperty.Enabled => (Proxy.Enabled) switch
{
- WebProxy.Address = new Uri($"http://{Proxy.Server}:{Proxy.Port}");
- WebProxy.Credentials = null;
- }
- else
- {
- WebProxy.Address = new Uri($"http://{Proxy.Server}:{Proxy.Port}");
- WebProxy.Credentials = new NetworkCredential(Proxy.UserName, Proxy.Password);
- }
- }
- else
- {
- WebProxy.Address = new WebProxy().Address;
- WebProxy.Credentials = null;
- }
+ true => Proxy.UserName switch
+ {
+ var userName when !string.IsNullOrEmpty(userName) =>
+ (new Uri($"http://{Proxy.Server}:{Proxy.Port}"), null),
+ _ => (new Uri($"http://{Proxy.Server}:{Proxy.Port}"),
+ new NetworkCredential(Proxy.UserName, Proxy.Password))
+ },
+ false => (null, null)
+ },
+ ProxyProperty.Server => (new Uri($"http://{Proxy.Server}:{Proxy.Port}"), _proxy.Credentials),
+ ProxyProperty.Port => (new Uri($"http://{Proxy.Server}:{Proxy.Port}"), _proxy.Credentials),
+ ProxyProperty.UserName => (_proxy.Address, new NetworkCredential(Proxy.UserName, Proxy.Password)),
+ ProxyProperty.Password => (_proxy.Address, new NetworkCredential(Proxy.UserName, Proxy.Password))
+ };
}
public static async Task Download([NotNull] string url, [NotNull] string filePath)
{
- UpdateProxy();
using var response = await client.GetAsync(url);
if (response.StatusCode == HttpStatusCode.OK)
{
@@ -99,7 +95,6 @@ namespace Flow.Launcher.Infrastructure.Http
public static async Task Get([NotNull] string url, string encoding = "UTF-8")
{
- UpdateProxy();
Log.Debug($"|Http.Get|Url <{url}>");
var response = await client.GetAsync(url);
await using var stream = await response.Content.ReadAsStreamAsync();
@@ -111,7 +106,8 @@ namespace Flow.Launcher.Infrastructure.Http
}
else
{
- throw new HttpRequestException($"Error code <{response.StatusCode}> with content <{content}> returned from <{url}>");
+ throw new HttpRequestException(
+ $"Error code <{response.StatusCode}> with content <{content}> returned from <{url}>");
}
}
}
diff --git a/Flow.Launcher.Infrastructure/UserSettings/HttpProxy.cs b/Flow.Launcher.Infrastructure/UserSettings/HttpProxy.cs
index c1b0c1dd7..213193526 100644
--- a/Flow.Launcher.Infrastructure/UserSettings/HttpProxy.cs
+++ b/Flow.Launcher.Infrastructure/UserSettings/HttpProxy.cs
@@ -1,11 +1,80 @@
-namespace Flow.Launcher.Infrastructure.UserSettings
+using System.ComponentModel;
+
+namespace Flow.Launcher.Infrastructure.UserSettings
{
+ public enum ProxyProperty
+ {
+ Enabled,
+ Server,
+ Port,
+ UserName,
+ Password
+ }
+
public class HttpProxy
{
- public bool Enabled { get; set; } = false;
- public string Server { get; set; }
- public int Port { get; set; }
- public string UserName { get; set; }
- public string Password { get; set; }
+ private bool _enabled = false;
+ private string _server;
+ private int _port;
+ private string _userName;
+ private string _password;
+
+ public bool Enabled
+ {
+ get => _enabled;
+ set
+ {
+ _enabled = value;
+ OnPropertyChanged(ProxyProperty.Enabled);
+ }
+ }
+
+ public string Server
+ {
+ get => _server;
+ set
+ {
+ _server = value;
+ OnPropertyChanged(ProxyProperty.Server);
+ }
+ }
+
+ public int Port
+ {
+ get => _port;
+ set
+ {
+ _port = value;
+ OnPropertyChanged(ProxyProperty.Port);
+ }
+ }
+
+ public string UserName
+ {
+ get => _userName;
+ set
+ {
+ _userName = value;
+ OnPropertyChanged(ProxyProperty.UserName);
+ }
+ }
+
+ public string Password
+ {
+ get => _password;
+ set
+ {
+ _password = value;
+ OnPropertyChanged(ProxyProperty.Password);
+ }
+ }
+
+ public delegate void ProxyPropertyChangedHandler(ProxyProperty property);
+ public event ProxyPropertyChangedHandler PropertyChanged;
+
+ private void OnPropertyChanged(ProxyProperty property)
+ {
+ PropertyChanged?.Invoke(property);
+ }
}
}
\ No newline at end of file
From 93486783e5fdb5f5e14abc1df1b4c5e8adccb1eb Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Wed, 23 Dec 2020 06:28:59 +1100
Subject: [PATCH 12/95] update plugin repo url
---
Flow.Launcher/ViewModel/SettingWindowViewModel.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs
index 96ee5a052..c122f8037 100644
--- a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs
+++ b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs
@@ -213,7 +213,7 @@ namespace Flow.Launcher.ViewModel
#region plugin
- public static string Plugin => "http://www.wox.one/plugin";
+ public static string Plugin => @"https://github.com/Flow-Launcher/Flow.Launcher.PluginsManifest";
public PluginViewModel SelectedPlugin { get; set; }
public IList PluginViewModels
From 34f51927cf5955d49174a45cbb0eee60802b7466 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=A0=E5=BC=98=E9=9F=AC?=
Date: Sun, 27 Dec 2020 21:13:25 +0800
Subject: [PATCH 13/95] 1. Move PluginsManager constuction to Init(). 2. Return
HotKeys list when query is like "pm *"
---
Flow.Launcher.Infrastructure/Http/Http.cs | 2 +-
.../Main.cs | 34 ++-
.../PluginsManager.cs | 250 ++++++++++--------
.../Settings.cs | 46 +++-
4 files changed, 201 insertions(+), 131 deletions(-)
diff --git a/Flow.Launcher.Infrastructure/Http/Http.cs b/Flow.Launcher.Infrastructure/Http/Http.cs
index 1d5f240e1..2d798ec11 100644
--- a/Flow.Launcher.Infrastructure/Http/Http.cs
+++ b/Flow.Launcher.Infrastructure/Http/Http.cs
@@ -59,7 +59,7 @@ namespace Flow.Launcher.Infrastructure.Http
Log.Debug($"|Http.Get|Url <{url}>");
var request = WebRequest.CreateHttp(url);
request.Method = "GET";
- request.Timeout = 1000;
+ request.Timeout = 6000;
request.Proxy = WebProxy();
request.UserAgent = UserAgent;
var response = await request.GetResponseAsync() as HttpWebResponse;
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
index 43f92e7b9..6cf9e1608 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
@@ -3,13 +3,15 @@ using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin.PluginsManager.ViewModels;
using Flow.Launcher.Plugin.PluginsManager.Views;
using System.Collections.Generic;
+using System.Linq;
using System.Windows.Controls;
+using Flow.Launcher.Infrastructure;
namespace Flow.Launcher.Plugin.PluginsManager
{
public class Main : ISettingProvider, IPlugin, ISavable, IContextMenu, IPluginI18n
{
- internal PluginInitContext Context { get; set; }
+ internal static PluginInitContext Context { get; set; }
internal Settings Settings;
@@ -17,6 +19,8 @@ namespace Flow.Launcher.Plugin.PluginsManager
private IContextMenu contextMenu;
+ internal PluginsManager pluginManager;
+
public Control CreateSettingPanel()
{
return new PluginsManagerSettings(viewModel);
@@ -28,6 +32,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
viewModel = new SettingsViewModel(context);
Settings = viewModel.Settings;
contextMenu = new ContextMenu(Context, Settings);
+ pluginManager = new PluginsManager(Context, Settings);
}
public List LoadContextMenus(Result selectedResult)
@@ -38,18 +43,21 @@ namespace Flow.Launcher.Plugin.PluginsManager
public List Query(Query query)
{
var search = query.Search.ToLower();
+
+ if (string.IsNullOrWhiteSpace(search))
+ return Settings.HotKeys;
- var pluginManager = new PluginsManager(Context, Settings);
-
- if (!string.IsNullOrEmpty(search)
- && ($"{Settings.HotkeyUninstall} ".StartsWith(search) || search.StartsWith($"{Settings.HotkeyUninstall} ")))
- return pluginManager.RequestUninstall(search);
-
- if (!string.IsNullOrEmpty(search)
- && ($"{Settings.HotkeyUpdate} ".StartsWith(search) || search.StartsWith($"{Settings.HotkeyUpdate} ")))
- return pluginManager.RequestUpdate(search);
-
- return pluginManager.RequestInstallOrUpdate(search);
+ return search switch
+ {
+ var s when s.StartsWith(Settings.HotKeyInstall) => pluginManager.RequestInstallOrUpdate(s),
+ var s when s.StartsWith(Settings.HotkeyUninstall) => pluginManager.RequestUninstall(s),
+ var s when s.StartsWith(Settings.HotkeyUpdate) => pluginManager.RequestUpdate(s),
+ _ => Settings.HotKeys.Where(hotkey =>
+ {
+ hotkey.Score = StringMatcher.FuzzySearch(search, hotkey.Title).Score;
+ return hotkey.Score > 0;
+ }).ToList()
+ };
}
public void Save()
@@ -67,4 +75,4 @@ namespace Flow.Launcher.Plugin.PluginsManager
return Context.API.GetTranslation("plugin_pluginsmanager_plugin_description");
}
}
-}
+}
\ No newline at end of file
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
index 90f3277fb..23d2756ae 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
@@ -20,7 +20,8 @@ namespace Flow.Launcher.Plugin.PluginsManager
private Settings Settings { get; set; }
private bool shouldHideWindow = true;
- private bool ShouldHideWindow
+
+ private bool ShouldHideWindow
{
set { shouldHideWindow = value; }
get
@@ -42,18 +43,21 @@ namespace Flow.Launcher.Plugin.PluginsManager
Context = context;
Settings = settings;
}
+
internal void InstallOrUpdate(UserPlugin plugin)
{
if (PluginExists(plugin.ID))
{
- if (Context.API.GetAllPlugins().Any(x => x.Metadata.ID == plugin.ID && x.Metadata.Version != plugin.Version))
+ if (Context.API.GetAllPlugins()
+ .Any(x => x.Metadata.ID == plugin.ID && x.Metadata.Version != plugin.Version))
{
if (MessageBox.Show(Context.API.GetTranslation("plugin_pluginsmanager_update_exists"),
- Context.API.GetTranslation("plugin_pluginsmanager_update_title"),
- MessageBoxButton.YesNo) == MessageBoxResult.Yes)
- Context
- .API
- .ChangeQuery($"{Context.CurrentPluginMetadata.ActionKeywords.FirstOrDefault()} {Settings.HotkeyUpdate} {plugin.Name}");
+ Context.API.GetTranslation("plugin_pluginsmanager_update_title"),
+ MessageBoxButton.YesNo) == MessageBoxResult.Yes)
+ Context
+ .API
+ .ChangeQuery(
+ $"{Context.CurrentPluginMetadata.ActionKeywords.FirstOrDefault()} {Settings.HotkeyUpdate} {plugin.Name}");
Application.Current.MainWindow.Show();
shouldHideWindow = false;
@@ -66,10 +70,11 @@ namespace Flow.Launcher.Plugin.PluginsManager
}
var message = string.Format(Context.API.GetTranslation("plugin_pluginsmanager_install_prompt"),
- plugin.Name, plugin.Author,
- Environment.NewLine, Environment.NewLine);
+ plugin.Name, plugin.Author,
+ Environment.NewLine, Environment.NewLine);
- if (MessageBox.Show(message, Context.API.GetTranslation("plugin_pluginsmanager_install_title"), MessageBoxButton.YesNo) == MessageBoxResult.No)
+ if (MessageBox.Show(message, Context.API.GetTranslation("plugin_pluginsmanager_install_title"),
+ MessageBoxButton.YesNo) == MessageBoxResult.No)
return;
var filePath = Path.Combine(DataLocation.PluginsDirectory, $"{plugin.Name}-{plugin.Version}.zip");
@@ -77,30 +82,34 @@ namespace Flow.Launcher.Plugin.PluginsManager
try
{
Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_downloading_plugin"),
- Context.API.GetTranslation("plugin_pluginsmanager_please_wait"));
+ Context.API.GetTranslation("plugin_pluginsmanager_please_wait"));
Http.Download(plugin.UrlDownload, filePath);
Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_downloading_plugin"),
- Context.API.GetTranslation("plugin_pluginsmanager_download_success"));
+ Context.API.GetTranslation("plugin_pluginsmanager_download_success"));
}
catch (Exception e)
{
Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_downloading_plugin"),
- Context.API.GetTranslation("plugin_pluginsmanager_download_success"));
+ Context.API.GetTranslation("plugin_pluginsmanager_download_success"));
Log.Exception("PluginsManager", "An error occured while downloading plugin", e, "PluginDownload");
}
- Application.Current.Dispatcher.Invoke(() => { Install(plugin, filePath); Context.API.RestartApp(); });
+ Application.Current.Dispatcher.Invoke(() =>
+ {
+ Install(plugin, filePath);
+ Context.API.RestartApp();
+ });
}
internal List RequestUpdate(string search)
{
var autocompletedResults = AutoCompleteReturnAllResults(search,
- Settings.HotkeyUpdate,
- "Update",
- "Select a plugin to update");
+ Settings.HotkeyUpdate,
+ "Update",
+ "Select a plugin to update");
if (autocompletedResults.Any())
return autocompletedResults;
@@ -108,63 +117,68 @@ namespace Flow.Launcher.Plugin.PluginsManager
var uninstallSearch = search.Replace(Settings.HotkeyUpdate, string.Empty).TrimStart();
- var resultsForUpdate =
- from existingPlugin in Context.API.GetAllPlugins()
- join pluginFromManifest in pluginsManifest.UserPlugins
- on existingPlugin.Metadata.ID equals pluginFromManifest.ID
- where existingPlugin.Metadata.Version != pluginFromManifest.Version
- select
- new
- {
- pluginFromManifest.Name,
- pluginFromManifest.Author,
- CurrentVersion = existingPlugin.Metadata.Version,
- NewVersion = pluginFromManifest.Version,
- existingPlugin.Metadata.IcoPath,
- PluginExistingMetadata = existingPlugin.Metadata,
- PluginNewUserPlugin = pluginFromManifest
- };
+ var resultsForUpdate =
+ from existingPlugin in Context.API.GetAllPlugins()
+ join pluginFromManifest in pluginsManifest.UserPlugins
+ on existingPlugin.Metadata.ID equals pluginFromManifest.ID
+ where existingPlugin.Metadata.Version != pluginFromManifest.Version
+ select
+ new
+ {
+ pluginFromManifest.Name,
+ pluginFromManifest.Author,
+ CurrentVersion = existingPlugin.Metadata.Version,
+ NewVersion = pluginFromManifest.Version,
+ existingPlugin.Metadata.IcoPath,
+ PluginExistingMetadata = existingPlugin.Metadata,
+ PluginNewUserPlugin = pluginFromManifest
+ };
if (!resultsForUpdate.Any())
- return new List {
- new Result
- {
- Title = Context.API.GetTranslation("plugin_pluginsmanager_update_noresult_title"),
- SubTitle = Context.API.GetTranslation("plugin_pluginsmanager_update_noresult_subtitle"),
- IcoPath = icoPath
- }};
+ return new List
+ {
+ new Result
+ {
+ Title = Context.API.GetTranslation("plugin_pluginsmanager_update_noresult_title"),
+ SubTitle = Context.API.GetTranslation("plugin_pluginsmanager_update_noresult_subtitle"),
+ IcoPath = icoPath
+ }
+ };
var results = resultsForUpdate
- .Select(x =>
- new Result
- {
- Title = $"{x.Name} by {x.Author}",
- SubTitle = $"Update from version {x.CurrentVersion} to {x.NewVersion}",
- IcoPath = x.IcoPath,
- Action = e =>
- {
- string message = string.Format(Context.API.GetTranslation("plugin_pluginsmanager_update_prompt"),
- x.Name, x.Author,
- Environment.NewLine, Environment.NewLine);
+ .Select(x =>
+ new Result
+ {
+ Title = $"{x.Name} by {x.Author}",
+ SubTitle = $"Update from version {x.CurrentVersion} to {x.NewVersion}",
+ IcoPath = x.IcoPath,
+ Action = e =>
+ {
+ string message = string.Format(
+ Context.API.GetTranslation("plugin_pluginsmanager_update_prompt"),
+ x.Name, x.Author,
+ Environment.NewLine, Environment.NewLine);
- if (MessageBox.Show(message, Context.API.GetTranslation("plugin_pluginsmanager_update_title"),
- MessageBoxButton.YesNo) == MessageBoxResult.Yes)
- {
- Uninstall(x.PluginExistingMetadata);
+ if (MessageBox.Show(message,
+ Context.API.GetTranslation("plugin_pluginsmanager_update_title"),
+ MessageBoxButton.YesNo) == MessageBoxResult.Yes)
+ {
+ Uninstall(x.PluginExistingMetadata);
- var downloadToFilePath = Path.Combine(DataLocation.PluginsDirectory, $"{x.Name}-{x.NewVersion}.zip");
- Http.Download(x.PluginNewUserPlugin.UrlDownload, downloadToFilePath);
- Install(x.PluginNewUserPlugin, downloadToFilePath);
+ var downloadToFilePath = Path.Combine(DataLocation.PluginsDirectory,
+ $"{x.Name}-{x.NewVersion}.zip");
+ Http.Download(x.PluginNewUserPlugin.UrlDownload, downloadToFilePath);
+ Install(x.PluginNewUserPlugin, downloadToFilePath);
- Context.API.RestartApp();
+ Context.API.RestartApp();
- return true;
- }
+ return true;
+ }
- return false;
- }
- });
+ return false;
+ }
+ });
return Search(results, uninstallSearch);
}
@@ -180,37 +194,37 @@ namespace Flow.Launcher.Plugin.PluginsManager
return results.ToList();
return results
- .Where(x =>
- {
- var matchResult = StringMatcher.FuzzySearch(searchName, x.Title);
- if (matchResult.IsSearchPrecisionScoreMet())
- x.Score = matchResult.Score;
+ .Where(x =>
+ {
+ var matchResult = StringMatcher.FuzzySearch(searchName, x.Title);
+ if (matchResult.IsSearchPrecisionScoreMet())
+ x.Score = matchResult.Score;
- return matchResult.IsSearchPrecisionScoreMet();
- })
- .ToList();
+ return matchResult.IsSearchPrecisionScoreMet();
+ })
+ .ToList();
}
internal List RequestInstallOrUpdate(string searchName)
{
var results =
pluginsManifest
- .UserPlugins
- .Select(x =>
- new Result
- {
- Title = $"{x.Name} by {x.Author}",
- SubTitle = x.Description,
- IcoPath = icoPath,
- Action = e =>
+ .UserPlugins
+ .Select(x =>
+ new Result
{
- Application.Current.MainWindow.Hide();
- InstallOrUpdate(x);
+ Title = $"{x.Name} by {x.Author}",
+ SubTitle = x.Description,
+ IcoPath = icoPath,
+ Action = e =>
+ {
+ Application.Current.MainWindow.Hide();
+ InstallOrUpdate(x);
- return ShouldHideWindow;
- },
- ContextData = x
- });
+ return ShouldHideWindow;
+ },
+ ContextData = x
+ });
return Search(results, searchName);
}
@@ -253,10 +267,10 @@ namespace Flow.Launcher.Plugin.PluginsManager
internal List RequestUninstall(string search)
{
- var autocompletedResults = AutoCompleteReturnAllResults(search,
- Settings.HotkeyUninstall,
- "Uninstall",
- "Select a plugin to uninstall");
+ var autocompletedResults = AutoCompleteReturnAllResults(search,
+ Settings.HotkeyUninstall,
+ "Uninstall",
+ "Select a plugin to uninstall");
if (autocompletedResults.Any())
return autocompletedResults;
@@ -264,32 +278,34 @@ namespace Flow.Launcher.Plugin.PluginsManager
var uninstallSearch = search.Replace(Settings.HotkeyUninstall, string.Empty).TrimStart();
var results = Context.API
- .GetAllPlugins()
- .Select(x =>
- new Result
- {
- Title = $"{x.Metadata.Name} by {x.Metadata.Author}",
- SubTitle = x.Metadata.Description,
- IcoPath = x.Metadata.IcoPath,
- Action = e =>
- {
- string message = string.Format(Context.API.GetTranslation("plugin_pluginsmanager_uninstall_prompt"),
- x.Metadata.Name, x.Metadata.Author,
- Environment.NewLine, Environment.NewLine);
+ .GetAllPlugins()
+ .Select(x =>
+ new Result
+ {
+ Title = $"{x.Metadata.Name} by {x.Metadata.Author}",
+ SubTitle = x.Metadata.Description,
+ IcoPath = x.Metadata.IcoPath,
+ Action = e =>
+ {
+ string message = string.Format(
+ Context.API.GetTranslation("plugin_pluginsmanager_uninstall_prompt"),
+ x.Metadata.Name, x.Metadata.Author,
+ Environment.NewLine, Environment.NewLine);
- if (MessageBox.Show(message, Context.API.GetTranslation("plugin_pluginsmanager_uninstall_title"),
- MessageBoxButton.YesNo) == MessageBoxResult.Yes)
- {
- Application.Current.MainWindow.Hide();
- Uninstall(x.Metadata);
- Context.API.RestartApp();
+ if (MessageBox.Show(message,
+ Context.API.GetTranslation("plugin_pluginsmanager_uninstall_title"),
+ MessageBoxButton.YesNo) == MessageBoxResult.Yes)
+ {
+ Application.Current.MainWindow.Hide();
+ Uninstall(x.Metadata);
+ Context.API.RestartApp();
- return true;
- }
+ return true;
+ }
- return false;
- }
- });
+ return false;
+ }
+ });
return Search(results, uninstallSearch);
}
@@ -300,6 +316,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
using var _ = File.CreateText(Path.Combine(plugin.PluginDirectory, "NeedDelete.txt"));
}
+
private List AutoCompleteReturnAllResults(string search, string hotkey, string title, string subtitle)
{
if (!string.IsNullOrEmpty(search)
@@ -317,8 +334,9 @@ namespace Flow.Launcher.Plugin.PluginsManager
Action = e =>
{
Context
- .API
- .ChangeQuery($"{Context.CurrentPluginMetadata.ActionKeywords.FirstOrDefault()} {hotkey} ");
+ .API
+ .ChangeQuery(
+ $"{Context.CurrentPluginMetadata.ActionKeywords.FirstOrDefault()} {hotkey} ");
return false;
}
@@ -329,4 +347,4 @@ namespace Flow.Launcher.Plugin.PluginsManager
return new List();
}
}
-}
+}
\ No newline at end of file
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Settings.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Settings.cs
index e2e8d22e5..5fc3916c0 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Settings.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Settings.cs
@@ -6,8 +6,52 @@ namespace Flow.Launcher.Plugin.PluginsManager
{
internal class Settings
{
+ internal string HotKeyInstall { get; set; } = "install";
internal string HotkeyUninstall { get; set; } = "uninstall";
internal string HotkeyUpdate { get; set; } = "update";
+
+ internal readonly string icoPath = "Images\\pluginsmanager.png";
+
+
+ internal List HotKeys
+ {
+ get
+ {
+ return new List()
+ {
+ new Result()
+ {
+ Title = HotKeyInstall,
+ IcoPath = icoPath,
+ Action = _ =>
+ {
+ Main.Context.API.ChangeQuery("pm install ");
+ return false;
+ }
+ },
+ new Result()
+ {
+ Title = HotkeyUninstall,
+ IcoPath = icoPath,
+ Action = _ =>
+ {
+ Main.Context.API.ChangeQuery("pm uninstall ");
+ return false;
+ }
+ },
+ new Result()
+ {
+ Title = HotkeyUpdate,
+ IcoPath = icoPath,
+ Action = _ =>
+ {
+ Main.Context.API.ChangeQuery("pm update ");
+ return false;
+ }
+ }
+ };
+ }
+ }
}
-}
+}
\ No newline at end of file
From deaac1c7e48ff6ef370a4127247fc22cb94a8f26 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Sun, 27 Dec 2020 22:33:12 +0800
Subject: [PATCH 14/95] replace install from search keyword
---
Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
index 23d2756ae..bd998514a 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
@@ -207,6 +207,8 @@ namespace Flow.Launcher.Plugin.PluginsManager
internal List RequestInstallOrUpdate(string searchName)
{
+ var searchNameWithoutKeyword = searchName.Replace(Settings.HotKeyInstall, string.Empty).Trim();
+
var results =
pluginsManifest
.UserPlugins
@@ -226,7 +228,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
ContextData = x
});
- return Search(results, searchName);
+ return Search(results, searchNameWithoutKeyword);
}
private void Install(UserPlugin plugin, string downloadedFilePath)
From 5a0358718cd9b76b71da0c885c853f39e7e09b60 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Mon, 28 Dec 2020 23:06:47 +0800
Subject: [PATCH 15/95] Update PluginManifest if last update time is 12 hours
ago
---
.../Flow.Launcher.Plugin.PluginsManager/Main.cs | 16 +++++++++++++++-
.../Models/PluginsManifest.cs | 10 +++-------
.../PluginsManager.cs | 8 +++++++-
3 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
index 6cf9e1608..9aa024fc8 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
@@ -6,6 +6,8 @@ using System.Collections.Generic;
using System.Linq;
using System.Windows.Controls;
using Flow.Launcher.Infrastructure;
+using System;
+using System.Threading.Tasks;
namespace Flow.Launcher.Plugin.PluginsManager
{
@@ -21,6 +23,8 @@ namespace Flow.Launcher.Plugin.PluginsManager
internal PluginsManager pluginManager;
+ internal DateTime _lastUpdateTime;
+
public Control CreateSettingPanel()
{
return new PluginsManagerSettings(viewModel);
@@ -33,6 +37,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
Settings = viewModel.Settings;
contextMenu = new ContextMenu(Context, Settings);
pluginManager = new PluginsManager(Context, Settings);
+ _lastUpdateTime = DateTime.Now;
}
public List LoadContextMenus(Result selectedResult)
@@ -43,10 +48,19 @@ namespace Flow.Launcher.Plugin.PluginsManager
public List Query(Query query)
{
var search = query.Search.ToLower();
-
+
if (string.IsNullOrWhiteSpace(search))
return Settings.HotKeys;
+ if ((DateTime.Now - _lastUpdateTime).TotalSeconds > 43200) // 12 hours
+ {
+ Task.Run(async () =>
+ {
+ await pluginManager.UpdateManifest();
+ _lastUpdateTime = DateTime.Now;
+ });
+ }
+
return search switch
{
var s when s.StartsWith(Settings.HotKeyInstall) => pluginManager.RequestInstallOrUpdate(s),
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs
index 290221710..1c31432b2 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs
@@ -12,19 +12,15 @@ namespace Flow.Launcher.Plugin.PluginsManager.Models
internal List UserPlugins { get; private set; }
internal PluginsManifest()
{
- DownloadManifest();
+ Task.Run(() => DownloadManifest()).Wait();
}
- private void DownloadManifest()
+ internal async Task DownloadManifest()
{
var json = string.Empty;
try
{
- var t = Task.Run(
- async () =>
- json = await Http.Get("https://raw.githubusercontent.com/Flow-Launcher/Flow.Launcher.PluginsManifest/main/plugins.json"));
-
- t.Wait();
+ json = await Http.Get("https://raw.githubusercontent.com/Flow-Launcher/Flow.Launcher.PluginsManifest/main/plugins.json");
UserPlugins = JsonConvert.DeserializeObject>(json);
}
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
index bd998514a..c6f127387 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
@@ -7,13 +7,14 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
+using System.Threading.Tasks;
using System.Windows;
namespace Flow.Launcher.Plugin.PluginsManager
{
internal class PluginsManager
{
- private readonly PluginsManifest pluginsManifest;
+ private PluginsManifest pluginsManifest;
private PluginInitContext Context { get; set; }
@@ -44,6 +45,11 @@ namespace Flow.Launcher.Plugin.PluginsManager
Settings = settings;
}
+ internal async Task UpdateManifest()
+ {
+ await pluginsManifest.DownloadManifest();
+ }
+
internal void InstallOrUpdate(UserPlugin plugin)
{
if (PluginExists(plugin.ID))
From 00457ddc29aad8088eac5439d0be10f2368a82f0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Tue, 29 Dec 2020 12:08:41 +0800
Subject: [PATCH 16/95] change totalSeconds to Hours
---
Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
index 9aa024fc8..fe11b619e 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
@@ -52,7 +52,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
if (string.IsNullOrWhiteSpace(search))
return Settings.HotKeys;
- if ((DateTime.Now - _lastUpdateTime).TotalSeconds > 43200) // 12 hours
+ if ((DateTime.Now - _lastUpdateTime).TotalHours > 12) // 12 hours
{
Task.Run(async () =>
{
From bb9682f7918ec6afa8ef0441dbe09fa8306a3b4c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Tue, 29 Dec 2020 12:14:59 +0800
Subject: [PATCH 17/95] Move get default hotkeys to pluginmanger and make
Main.Context non-static
---
.../Main.cs | 2 +-
.../PluginsManager.cs | 37 +++++++++++++++++
.../Settings.cs | 40 -------------------
3 files changed, 38 insertions(+), 41 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
index fe11b619e..8d99bf37d 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
@@ -13,7 +13,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
{
public class Main : ISettingProvider, IPlugin, ISavable, IContextMenu, IPluginI18n
{
- internal static PluginInitContext Context { get; set; }
+ internal PluginInitContext Context { get; set; }
internal Settings Settings;
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
index c6f127387..29ff9cb54 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
@@ -50,6 +50,43 @@ namespace Flow.Launcher.Plugin.PluginsManager
await pluginsManifest.DownloadManifest();
}
+ internal List GetDefaultHotKeys()
+ {
+ return new List()
+ {
+ new Result()
+ {
+ Title = Settings.HotKeyInstall,
+ IcoPath = icoPath,
+ Action = _ =>
+ {
+ Context.API.ChangeQuery("pm install ");
+ return false;
+ }
+ },
+ new Result()
+ {
+ Title = Settings.HotkeyUninstall,
+ IcoPath = icoPath,
+ Action = _ =>
+ {
+ Context.API.ChangeQuery("pm uninstall ");
+ return false;
+ }
+ },
+ new Result()
+ {
+ Title = Settings.HotkeyUpdate,
+ IcoPath = icoPath,
+ Action = _ =>
+ {
+ Context.API.ChangeQuery("pm update ");
+ return false;
+ }
+ }
+ };
+ }
+
internal void InstallOrUpdate(UserPlugin plugin)
{
if (PluginExists(plugin.ID))
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Settings.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Settings.cs
index 5fc3916c0..3753056f7 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Settings.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Settings.cs
@@ -12,46 +12,6 @@ namespace Flow.Launcher.Plugin.PluginsManager
internal string HotkeyUpdate { get; set; } = "update";
internal readonly string icoPath = "Images\\pluginsmanager.png";
-
-
- internal List HotKeys
- {
- get
- {
- return new List()
- {
- new Result()
- {
- Title = HotKeyInstall,
- IcoPath = icoPath,
- Action = _ =>
- {
- Main.Context.API.ChangeQuery("pm install ");
- return false;
- }
- },
- new Result()
- {
- Title = HotkeyUninstall,
- IcoPath = icoPath,
- Action = _ =>
- {
- Main.Context.API.ChangeQuery("pm uninstall ");
- return false;
- }
- },
- new Result()
- {
- Title = HotkeyUpdate,
- IcoPath = icoPath,
- Action = _ =>
- {
- Main.Context.API.ChangeQuery("pm update ");
- return false;
- }
- }
- };
- }
}
}
}
\ No newline at end of file
From f32e202746397e6542f5a831b8b675ce5e1878c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Tue, 29 Dec 2020 12:20:13 +0800
Subject: [PATCH 18/95] Use System.Text.JsonSerializer.DeserializeAsync instead
of Newtonsoft.Json since our plugins.json can be large, so no need to create
an extra string to store it.
---
Flow.Launcher.Infrastructure/Http/Http.cs | 13 +++++++++++++
.../Models/PluginsManifest.cs | 8 ++++----
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/Flow.Launcher.Infrastructure/Http/Http.cs b/Flow.Launcher.Infrastructure/Http/Http.cs
index 2d798ec11..62cacc18f 100644
--- a/Flow.Launcher.Infrastructure/Http/Http.cs
+++ b/Flow.Launcher.Infrastructure/Http/Http.cs
@@ -73,5 +73,18 @@ namespace Flow.Launcher.Infrastructure.Http
return content;
}
+
+ public static async Task GetStreamAsync([NotNull] string url, string encoding = "UTF-8")
+ {
+ Log.Debug($"|Http.Get|Url <{url}>");
+ var request = WebRequest.CreateHttp(url);
+ request.Method = "GET";
+ request.Timeout = 6000;
+ request.Proxy = WebProxy();
+ request.UserAgent = UserAgent;
+ var response = await request.GetResponseAsync() as HttpWebResponse;
+ response = response.NonNull();
+ return response.GetResponseStream().NonNull();
+ }
}
}
\ No newline at end of file
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs
index 1c31432b2..2ab8806bc 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs
@@ -1,8 +1,8 @@
using Flow.Launcher.Infrastructure.Http;
using Flow.Launcher.Infrastructure.Logger;
-using Newtonsoft.Json;
using System;
using System.Collections.Generic;
+using System.Text.Json;
using System.Threading.Tasks;
namespace Flow.Launcher.Plugin.PluginsManager.Models
@@ -17,12 +17,12 @@ namespace Flow.Launcher.Plugin.PluginsManager.Models
internal async Task DownloadManifest()
{
- var json = string.Empty;
try
{
- json = await Http.Get("https://raw.githubusercontent.com/Flow-Launcher/Flow.Launcher.PluginsManifest/main/plugins.json");
+ var jsonStream = await Http.GetStreamAsync("https://raw.githubusercontent.com/Flow-Launcher/Flow.Launcher.PluginsManifest/main/plugins.json")
+ .ConfigureAwait(false);
- UserPlugins = JsonConvert.DeserializeObject>(json);
+ UserPlugins = await JsonSerializer.DeserializeAsync>(jsonStream).ConfigureAwait(false);
}
catch (Exception e)
{
From f0267475f520f9bd53981201dabc72e22877e2c8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Tue, 29 Dec 2020 12:23:15 +0800
Subject: [PATCH 19/95] Change call method for default hotkeys. Remove extra
whitespace add await using for stream
---
Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs | 4 ++--
.../Models/PluginsManifest.cs | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
index 8d99bf37d..607b2e3f5 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
@@ -50,7 +50,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
var search = query.Search.ToLower();
if (string.IsNullOrWhiteSpace(search))
- return Settings.HotKeys;
+ return pluginManager.GetDefaultHotKeys();
if ((DateTime.Now - _lastUpdateTime).TotalHours > 12) // 12 hours
{
@@ -66,7 +66,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
var s when s.StartsWith(Settings.HotKeyInstall) => pluginManager.RequestInstallOrUpdate(s),
var s when s.StartsWith(Settings.HotkeyUninstall) => pluginManager.RequestUninstall(s),
var s when s.StartsWith(Settings.HotkeyUpdate) => pluginManager.RequestUpdate(s),
- _ => Settings.HotKeys.Where(hotkey =>
+ _ => pluginManager.GetDefaultHotKeys().Where(hotkey =>
{
hotkey.Score = StringMatcher.FuzzySearch(search, hotkey.Title).Score;
return hotkey.Score > 0;
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs
index 2ab8806bc..c854b213d 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs
@@ -19,7 +19,7 @@ namespace Flow.Launcher.Plugin.PluginsManager.Models
{
try
{
- var jsonStream = await Http.GetStreamAsync("https://raw.githubusercontent.com/Flow-Launcher/Flow.Launcher.PluginsManifest/main/plugins.json")
+ await using var jsonStream = await Http.GetStreamAsync("https://raw.githubusercontent.com/Flow-Launcher/Flow.Launcher.PluginsManifest/main/plugins.json")
.ConfigureAwait(false);
UserPlugins = await JsonSerializer.DeserializeAsync>(jsonStream).ConfigureAwait(false);
@@ -33,4 +33,4 @@ namespace Flow.Launcher.Plugin.PluginsManager.Models
}
}
-}
+}
\ No newline at end of file
From 5da8259228120ccbfed0662de1131bd3a95fed85 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Tue, 29 Dec 2020 13:03:38 +0800
Subject: [PATCH 20/95] fix an unintended text error add async await to
download manifest task remove unused encoding name for new GetStreamAsync in
Http fix unintened text error
---
Flow.Launcher.Infrastructure/Http/Http.cs | 2 +-
.../Models/PluginsManifest.cs | 2 +-
Plugins/Flow.Launcher.Plugin.PluginsManager/Settings.cs | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Flow.Launcher.Infrastructure/Http/Http.cs b/Flow.Launcher.Infrastructure/Http/Http.cs
index 62cacc18f..ea412759e 100644
--- a/Flow.Launcher.Infrastructure/Http/Http.cs
+++ b/Flow.Launcher.Infrastructure/Http/Http.cs
@@ -74,7 +74,7 @@ namespace Flow.Launcher.Infrastructure.Http
return content;
}
- public static async Task GetStreamAsync([NotNull] string url, string encoding = "UTF-8")
+ public static async Task GetStreamAsync([NotNull] string url)
{
Log.Debug($"|Http.Get|Url <{url}>");
var request = WebRequest.CreateHttp(url);
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs
index c854b213d..7b2f8e372 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs
@@ -12,7 +12,7 @@ namespace Flow.Launcher.Plugin.PluginsManager.Models
internal List UserPlugins { get; private set; }
internal PluginsManifest()
{
- Task.Run(() => DownloadManifest()).Wait();
+ Task.Run(async () => await DownloadManifest()).Wait();
}
internal async Task DownloadManifest()
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Settings.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Settings.cs
index 3753056f7..d5d78d28a 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Settings.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Settings.cs
@@ -12,6 +12,6 @@ namespace Flow.Launcher.Plugin.PluginsManager
internal string HotkeyUpdate { get; set; } = "update";
internal readonly string icoPath = "Images\\pluginsmanager.png";
- }
+
}
}
\ No newline at end of file
From c94a2f4c9599c49ad00b3e524b28ec044eb22868 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Tue, 29 Dec 2020 13:06:08 +0800
Subject: [PATCH 21/95] Use string.CompareTo instead of equal to check for
update
---
Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
index 29ff9cb54..2931afe30 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
@@ -164,7 +164,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
from existingPlugin in Context.API.GetAllPlugins()
join pluginFromManifest in pluginsManifest.UserPlugins
on existingPlugin.Metadata.ID equals pluginFromManifest.ID
- where existingPlugin.Metadata.Version != pluginFromManifest.Version
+ where existingPlugin.Metadata.Version.CompareTo(pluginFromManifest.Version) > 0
select
new
{
From a1a45a49890001150b8d4c78f8f8b3c763402565 Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Tue, 29 Dec 2020 17:49:11 +1100
Subject: [PATCH 22/95] add eof
---
Flow.Launcher.Infrastructure/Http/Http.cs | 2 +-
Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs | 2 +-
.../Models/PluginsManifest.cs | 2 +-
Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs | 3 +--
Plugins/Flow.Launcher.Plugin.PluginsManager/Settings.cs | 2 +-
5 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/Flow.Launcher.Infrastructure/Http/Http.cs b/Flow.Launcher.Infrastructure/Http/Http.cs
index ea412759e..9d2fe7860 100644
--- a/Flow.Launcher.Infrastructure/Http/Http.cs
+++ b/Flow.Launcher.Infrastructure/Http/Http.cs
@@ -87,4 +87,4 @@ namespace Flow.Launcher.Infrastructure.Http
return response.GetResponseStream().NonNull();
}
}
-}
\ No newline at end of file
+}
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
index 607b2e3f5..2d9a29a2f 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
@@ -89,4 +89,4 @@ namespace Flow.Launcher.Plugin.PluginsManager
return Context.API.GetTranslation("plugin_pluginsmanager_plugin_description");
}
}
-}
\ No newline at end of file
+}
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs
index 7b2f8e372..ad8185620 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Models/PluginsManifest.cs
@@ -33,4 +33,4 @@ namespace Flow.Launcher.Plugin.PluginsManager.Models
}
}
-}
\ No newline at end of file
+}
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
index 2931afe30..d06bbf1f9 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
@@ -361,7 +361,6 @@ namespace Flow.Launcher.Plugin.PluginsManager
using var _ = File.CreateText(Path.Combine(plugin.PluginDirectory, "NeedDelete.txt"));
}
-
private List AutoCompleteReturnAllResults(string search, string hotkey, string title, string subtitle)
{
if (!string.IsNullOrEmpty(search)
@@ -392,4 +391,4 @@ namespace Flow.Launcher.Plugin.PluginsManager
return new List();
}
}
-}
\ No newline at end of file
+}
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Settings.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Settings.cs
index d5d78d28a..a885bfd15 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Settings.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Settings.cs
@@ -14,4 +14,4 @@ namespace Flow.Launcher.Plugin.PluginsManager
internal readonly string icoPath = "Images\\pluginsmanager.png";
}
-}
\ No newline at end of file
+}
From f9349a64e96226b725500752755834ff1d493dea Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Tue, 29 Dec 2020 17:49:37 +1100
Subject: [PATCH 23/95] fix condition of version compare
---
Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
index d06bbf1f9..9635648d4 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
@@ -164,7 +164,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
from existingPlugin in Context.API.GetAllPlugins()
join pluginFromManifest in pluginsManifest.UserPlugins
on existingPlugin.Metadata.ID equals pluginFromManifest.ID
- where existingPlugin.Metadata.Version.CompareTo(pluginFromManifest.Version) > 0
+ where existingPlugin.Metadata.Version.CompareTo(pluginFromManifest.Version) < 0 // if current version precedes manifest version
select
new
{
From e5b67ea10a43527c99e62317f466e2b14c467995 Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Tue, 29 Dec 2020 18:04:23 +1100
Subject: [PATCH 24/95] remove obsolete icoPath from settings
---
Plugins/Flow.Launcher.Plugin.PluginsManager/Settings.cs | 3 ---
1 file changed, 3 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Settings.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Settings.cs
index a885bfd15..9c5b0d29f 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Settings.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Settings.cs
@@ -10,8 +10,5 @@ namespace Flow.Launcher.Plugin.PluginsManager
internal string HotkeyUninstall { get; set; } = "uninstall";
internal string HotkeyUpdate { get; set; } = "update";
-
- internal readonly string icoPath = "Images\\pluginsmanager.png";
-
}
}
From 0a47636bc9e0427341d97aa471a67a94fef38b3c Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Tue, 29 Dec 2020 18:13:52 +1100
Subject: [PATCH 25/95] remove obsolete settings property in context menu class
---
Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs | 7 ++-----
Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs | 3 +--
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs
index 76cb0f86b..b9bf5ee85 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs
@@ -1,4 +1,4 @@
-using Flow.Launcher.Infrastructure.UserSettings;
+using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin.PluginsManager.Models;
using System;
using System.Collections.Generic;
@@ -10,12 +10,9 @@ namespace Flow.Launcher.Plugin.PluginsManager
{
private PluginInitContext Context { get; set; }
- private Settings Settings { get; set; }
-
- public ContextMenu(PluginInitContext context, Settings settings)
+ public ContextMenu(PluginInitContext context)
{
Context = context;
- Settings = settings;
}
public List LoadContextMenus(Result selectedResult)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
index 2d9a29a2f..a333b3862 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
@@ -1,5 +1,4 @@
using Flow.Launcher.Infrastructure.Storage;
-using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin.PluginsManager.ViewModels;
using Flow.Launcher.Plugin.PluginsManager.Views;
using System.Collections.Generic;
@@ -35,7 +34,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
Context = context;
viewModel = new SettingsViewModel(context);
Settings = viewModel.Settings;
- contextMenu = new ContextMenu(Context, Settings);
+ contextMenu = new ContextMenu(Context);
pluginManager = new PluginsManager(Context, Settings);
_lastUpdateTime = DateTime.Now;
}
From a1d1c95eebb83867c4581759076b6167c7c0f65b Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Tue, 29 Dec 2020 18:14:22 +1100
Subject: [PATCH 26/95] change to tab in browser
---
Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs
index b9bf5ee85..7bc357be4 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs
@@ -1,4 +1,4 @@
-using Flow.Launcher.Infrastructure.UserSettings;
+using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin.PluginsManager.Models;
using System;
using System.Collections.Generic;
@@ -55,7 +55,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
? pluginManifestInfo.UrlSourceCode.Replace("/tree/master", "/issues/new/choose")
: pluginManifestInfo.UrlSourceCode;
- SharedCommands.SearchWeb.NewBrowserWindow(link);
+ SharedCommands.SearchWeb.NewTabInBrowser(link);
return true;
}
},
@@ -66,7 +66,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
IcoPath = selectedResult.IcoPath,
Action = _ =>
{
- SharedCommands.SearchWeb.NewBrowserWindow("https://github.com/Flow-Launcher/Flow.Launcher.PluginsManifest");
+ SharedCommands.SearchWeb.NewTabInBrowser("https://github.com/Flow-Launcher/Flow.Launcher.PluginsManifest");
return true;
}
}
From b106688513f4d463656bd61c43034bcf71288acd Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Tue, 29 Dec 2020 18:14:33 +1100
Subject: [PATCH 27/95] version bump
---
Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json b/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json
index e970e5a8e..d94af71a1 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json
@@ -6,7 +6,7 @@
"Name": "Plugins Manager",
"Description": "Management of installing, uninstalling or updating Flow Launcher plugins",
"Author": "Jeremy Wu",
- "Version": "1.3.0",
+ "Version": "1.3.1",
"Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.PluginsManager.dll",
From 000bafd116910a5e8fcb919640be35f9ccfa2495 Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Tue, 29 Dec 2020 18:56:51 +1100
Subject: [PATCH 28/95] use camelCase and make last update time variable
private
---
Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
index a333b3862..716a424ff 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
@@ -22,7 +22,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
internal PluginsManager pluginManager;
- internal DateTime _lastUpdateTime;
+ private DateTime lastUpdateTime;
public Control CreateSettingPanel()
{
@@ -36,7 +36,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
Settings = viewModel.Settings;
contextMenu = new ContextMenu(Context);
pluginManager = new PluginsManager(Context, Settings);
- _lastUpdateTime = DateTime.Now;
+ lastUpdateTime = DateTime.Now;
}
public List LoadContextMenus(Result selectedResult)
@@ -51,12 +51,12 @@ namespace Flow.Launcher.Plugin.PluginsManager
if (string.IsNullOrWhiteSpace(search))
return pluginManager.GetDefaultHotKeys();
- if ((DateTime.Now - _lastUpdateTime).TotalHours > 12) // 12 hours
+ if ((DateTime.Now - lastUpdateTime).TotalHours > 12) // 12 hours
{
Task.Run(async () =>
{
await pluginManager.UpdateManifest();
- _lastUpdateTime = DateTime.Now;
+ lastUpdateTime = DateTime.Now;
});
}
From a47f8b318510db0fe7e5edfacd91c1894e33221b Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Tue, 29 Dec 2020 19:06:17 +1100
Subject: [PATCH 29/95] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 5f3f7e1a7..02f488758 100644
--- a/README.md
+++ b/README.md
@@ -45,7 +45,7 @@ Windows may complain about security due to code not being signed, this will be c
- Open flow's search window: Alt+Space is the default hotkey.
- Open context menu: Ctrl+O/Shift+Enter.
- Cancel/Return to previous screen: Esc.
-- Install/Uninstall/Update plugins: in the search window, type `pm`/`pm uninstall`/`pm update` + the plugin name.
+- Install/Uninstall/Update plugins: in the search window, type `pm install`/`pm uninstall`/`pm update` + the plugin name.
- Saved user settings are located:
- If using roaming: `%APPDATA%\FlowLauncher`
- If using portable, by default: `%localappdata%\FlowLauncher\app-\UserData`
From cfa93a2cc60808b84a131852a82f3e26ce1a4339 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Tue, 29 Dec 2020 17:13:31 +0800
Subject: [PATCH 30/95] Add GetStreamAsync method
---
Flow.Launcher.Infrastructure/Http/Http.cs | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/Flow.Launcher.Infrastructure/Http/Http.cs b/Flow.Launcher.Infrastructure/Http/Http.cs
index 74e335d32..11d922aa1 100644
--- a/Flow.Launcher.Infrastructure/Http/Http.cs
+++ b/Flow.Launcher.Infrastructure/Http/Http.cs
@@ -110,5 +110,12 @@ namespace Flow.Launcher.Infrastructure.Http
$"Error code <{response.StatusCode}> with content <{content}> returned from <{url}>");
}
}
+
+ public static async Task GetStreamAsync([NotNull] string url)
+ {
+ Log.Debug($"|Http.Get|Url <{url}>");
+ var response = await client.GetAsync(url);
+ return await response.Content.ReadAsStreamAsync();
+ }
}
}
From a806f7d05adc9beb7419e555921192e094c10539 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Tue, 29 Dec 2020 17:14:13 +0800
Subject: [PATCH 31/95] Change exception type
---
Flow.Launcher.Infrastructure/Http/Http.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Flow.Launcher.Infrastructure/Http/Http.cs b/Flow.Launcher.Infrastructure/Http/Http.cs
index 11d922aa1..a98ead687 100644
--- a/Flow.Launcher.Infrastructure/Http/Http.cs
+++ b/Flow.Launcher.Infrastructure/Http/Http.cs
@@ -89,7 +89,7 @@ namespace Flow.Launcher.Infrastructure.Http
}
else
{
- throw new WebException($"Error code <{response.StatusCode}> returned from <{url}>");
+ throw new HttpRequestException($"Error code <{response.StatusCode}> returned from <{url}>");
}
}
From 4d5119f17d2f5b307dd7eb33384e63ee31b48c27 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Tue, 29 Dec 2020 17:15:34 +0800
Subject: [PATCH 32/95] Add out of bound exception for pattern matching
---
Flow.Launcher.Infrastructure/Http/Http.cs | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/Flow.Launcher.Infrastructure/Http/Http.cs b/Flow.Launcher.Infrastructure/Http/Http.cs
index a98ead687..040939e72 100644
--- a/Flow.Launcher.Infrastructure/Http/Http.cs
+++ b/Flow.Launcher.Infrastructure/Http/Http.cs
@@ -61,7 +61,7 @@ namespace Flow.Launcher.Infrastructure.Http
{
(_proxy.Address, _proxy.Credentials) = property switch
{
- ProxyProperty.Enabled => (Proxy.Enabled) switch
+ ProxyProperty.Enabled => Proxy.Enabled switch
{
true => Proxy.UserName switch
{
@@ -75,7 +75,8 @@ namespace Flow.Launcher.Infrastructure.Http
ProxyProperty.Server => (new Uri($"http://{Proxy.Server}:{Proxy.Port}"), _proxy.Credentials),
ProxyProperty.Port => (new Uri($"http://{Proxy.Server}:{Proxy.Port}"), _proxy.Credentials),
ProxyProperty.UserName => (_proxy.Address, new NetworkCredential(Proxy.UserName, Proxy.Password)),
- ProxyProperty.Password => (_proxy.Address, new NetworkCredential(Proxy.UserName, Proxy.Password))
+ ProxyProperty.Password => (_proxy.Address, new NetworkCredential(Proxy.UserName, Proxy.Password)),
+ _ => throw new ArgumentOutOfRangeException()
};
}
From e364b84b8458aa8df058fa9cf4507b2699d3224a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Tue, 29 Dec 2020 17:16:44 +0800
Subject: [PATCH 33/95] Use auto property
---
Flow.Launcher.Infrastructure/Http/Http.cs | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/Flow.Launcher.Infrastructure/Http/Http.cs b/Flow.Launcher.Infrastructure/Http/Http.cs
index 040939e72..3d056b28b 100644
--- a/Flow.Launcher.Infrastructure/Http/Http.cs
+++ b/Flow.Launcher.Infrastructure/Http/Http.cs
@@ -47,19 +47,14 @@ namespace Flow.Launcher.Infrastructure.Http
}
}
- private static readonly WebProxy _proxy = new WebProxy();
-
- public static WebProxy WebProxy
- {
- get { return _proxy; }
- }
+ public static WebProxy WebProxy { get; } = new WebProxy();
///
/// Update the Address of the Proxy to modify the client Proxy
///
public static void UpdateProxy(ProxyProperty property)
{
- (_proxy.Address, _proxy.Credentials) = property switch
+ (WebProxy.Address, WebProxy.Credentials) = property switch
{
ProxyProperty.Enabled => Proxy.Enabled switch
{
@@ -72,10 +67,10 @@ namespace Flow.Launcher.Infrastructure.Http
},
false => (null, null)
},
- ProxyProperty.Server => (new Uri($"http://{Proxy.Server}:{Proxy.Port}"), _proxy.Credentials),
- ProxyProperty.Port => (new Uri($"http://{Proxy.Server}:{Proxy.Port}"), _proxy.Credentials),
- ProxyProperty.UserName => (_proxy.Address, new NetworkCredential(Proxy.UserName, Proxy.Password)),
- ProxyProperty.Password => (_proxy.Address, new NetworkCredential(Proxy.UserName, Proxy.Password)),
+ ProxyProperty.Server => (new Uri($"http://{Proxy.Server}:{Proxy.Port}"), WebProxy.Credentials),
+ ProxyProperty.Port => (new Uri($"http://{Proxy.Server}:{Proxy.Port}"), WebProxy.Credentials),
+ ProxyProperty.UserName => (WebProxy.Address, new NetworkCredential(Proxy.UserName, Proxy.Password)),
+ ProxyProperty.Password => (WebProxy.Address, new NetworkCredential(Proxy.UserName, Proxy.Password)),
_ => throw new ArgumentOutOfRangeException()
};
}
From 0c97db04d4b89d345ddb7908c5a6d361c11c0ee4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Tue, 29 Dec 2020 17:50:56 +0800
Subject: [PATCH 34/95] 1. Change Get method Name to GetAsync 2. Manually
replace "#" with "%23" to solve the similar issue in Explorer plugin 3. Add
GetAsync method with Uri as argument 4. Remove unused encoding argument 5.
Change exception type for WebSearch Plguin 6. Update Comment
---
Flow.Launcher.Core/Updater.cs | 2 +-
Flow.Launcher.Infrastructure/Http/Http.cs | 25 +++++++++++++++----
.../SuggestionSources/Baidu.cs | 5 ++--
.../SuggestionSources/Google.cs | 6 ++---
4 files changed, 27 insertions(+), 11 deletions(-)
diff --git a/Flow.Launcher.Core/Updater.cs b/Flow.Launcher.Core/Updater.cs
index d8bc2b6dc..46fb6d977 100644
--- a/Flow.Launcher.Core/Updater.cs
+++ b/Flow.Launcher.Core/Updater.cs
@@ -133,7 +133,7 @@ namespace Flow.Launcher.Core
var uri = new Uri(repository);
var api = $"https://api.github.com/repos{uri.AbsolutePath}/releases";
- var json = await Http.Get(api);
+ var json = await Http.GetAsync(api);
var releases = JsonConvert.DeserializeObject>(json);
var latest = releases.Where(r => !r.Prerelease).OrderByDescending(r => r.PublishedAt).First();
diff --git a/Flow.Launcher.Infrastructure/Http/Http.cs b/Flow.Launcher.Infrastructure/Http/Http.cs
index 3d056b28b..8e2832690 100644
--- a/Flow.Launcher.Infrastructure/Http/Http.cs
+++ b/Flow.Launcher.Infrastructure/Http/Http.cs
@@ -89,13 +89,23 @@ namespace Flow.Launcher.Infrastructure.Http
}
}
- public static async Task Get([NotNull] string url, string encoding = "UTF-8")
+ ///
+ /// Asynchrously get the result as string from url.
+ /// When supposing the result is long and large, try using GetStreamAsync to avoid reading as string
+ ///
+ ///
+ ///
+ public static Task GetAsync([NotNull] string url)
{
Log.Debug($"|Http.Get|Url <{url}>");
- var response = await client.GetAsync(url);
- await using var stream = await response.Content.ReadAsStreamAsync();
- using var reader = new StreamReader(stream, Encoding.GetEncoding(encoding));
- var content = await reader.ReadToEndAsync();
+ return GetAsync(new Uri(url.Replace("#", "%23")));
+ }
+
+ public static async Task GetAsync([NotNull] Uri url)
+ {
+ Log.Debug($"|Http.Get|Url <{url}>");
+ using var response = await client.GetAsync(url);
+ var content = await response.Content.ReadAsStringAsync();
if (response.StatusCode == HttpStatusCode.OK)
{
return content;
@@ -107,6 +117,11 @@ namespace Flow.Launcher.Infrastructure.Http
}
}
+ ///
+ /// Asynchrously get the result as stream from url.
+ ///
+ ///
+ ///
public static async Task GetStreamAsync([NotNull] string url)
{
Log.Debug($"|Http.Get|Url <{url}>");
diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Baidu.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Baidu.cs
index 57db223bc..6772acf82 100644
--- a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Baidu.cs
+++ b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Baidu.cs
@@ -8,6 +8,7 @@ using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Flow.Launcher.Infrastructure.Http;
using Flow.Launcher.Infrastructure.Logger;
+using System.Net.Http;
namespace Flow.Launcher.Plugin.WebSearch.SuggestionSources
{
@@ -22,9 +23,9 @@ namespace Flow.Launcher.Plugin.WebSearch.SuggestionSources
try
{
const string api = "http://suggestion.baidu.com/su?json=1&wd=";
- result = await Http.Get(api + Uri.EscapeUriString(query), "GB2312");
+ result = await Http.GetAsync(api + Uri.EscapeUriString(query)).ConfigureAwait(false);
}
- catch (WebException e)
+ catch (HttpRequestException e)
{
Log.Exception("|Baidu.Suggestions|Can't get suggestion from baidu", e);
return new List();
diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Google.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Google.cs
index 81878bd8b..5b9538091 100644
--- a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Google.cs
+++ b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Google.cs
@@ -7,6 +7,7 @@ using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Flow.Launcher.Infrastructure.Http;
using Flow.Launcher.Infrastructure.Logger;
+using System.Net.Http;
namespace Flow.Launcher.Plugin.WebSearch.SuggestionSources
{
@@ -18,13 +19,12 @@ namespace Flow.Launcher.Plugin.WebSearch.SuggestionSources
try
{
const string api = "https://www.google.com/complete/search?output=chrome&q=";
- result = await Http.Get(api + Uri.EscapeUriString(query));
+ result = await Http.GetAsync(api + Uri.EscapeUriString(query)).ConfigureAwait(false);
}
- catch (WebException e)
+ catch (HttpRequestException e)
{
Log.Exception("|Google.Suggestions|Can't get suggestion from google", e);
return new List();
- ;
}
if (string.IsNullOrEmpty(result)) return new List();
JContainer json;
From efa4908f37636f3fe6122d241a5821d14a4bf6b4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Tue, 29 Dec 2020 17:54:39 +0800
Subject: [PATCH 35/95] Change usage of Http in Updater.cs and adding
ConfigureAwait(false) for await in checking update
---
Flow.Launcher.Core/Updater.cs | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/Flow.Launcher.Core/Updater.cs b/Flow.Launcher.Core/Updater.cs
index 46fb6d977..05397e906 100644
--- a/Flow.Launcher.Core/Updater.cs
+++ b/Flow.Launcher.Core/Updater.cs
@@ -29,7 +29,7 @@ namespace Flow.Launcher.Core
GitHubRepository = gitHubRepository;
}
- public async Task UpdateApp(IPublicAPI api , bool silentUpdate = true)
+ public async Task UpdateApp(IPublicAPI api, bool silentUpdate = true)
{
UpdateManager updateManager;
UpdateInfo newUpdateInfo;
@@ -39,7 +39,7 @@ namespace Flow.Launcher.Core
try
{
- updateManager = await GitHubUpdateManager(GitHubRepository);
+ updateManager = await GitHubUpdateManager(GitHubRepository).ConfigureAwait(false);
}
catch (Exception e) when (e is HttpRequestException || e is WebException || e is SocketException)
{
@@ -50,7 +50,7 @@ namespace Flow.Launcher.Core
try
{
// UpdateApp CheckForUpdate will return value only if the app is squirrel installed
- newUpdateInfo = await updateManager.CheckForUpdate().NonNull();
+ newUpdateInfo = await updateManager.CheckForUpdate().NonNull().ConfigureAwait(false);
}
catch (Exception e) when (e is HttpRequestException || e is WebException || e is SocketException)
{
@@ -85,8 +85,8 @@ namespace Flow.Launcher.Core
updateManager.Dispose();
return;
}
-
- await updateManager.ApplyReleases(newUpdateInfo);
+
+ await updateManager.ApplyReleases(newUpdateInfo).ConfigureAwait(false);
if (DataLocation.PortableDataLocationInUse())
{
@@ -98,11 +98,11 @@ namespace Flow.Launcher.Core
}
else
{
- await updateManager.CreateUninstallerRegistryEntry();
+ await updateManager.CreateUninstallerRegistryEntry().ConfigureAwait(false);
}
var newVersionTips = NewVersinoTips(newReleaseVersion.ToString());
-
+
Log.Info($"|Updater.UpdateApp|Update success:{newVersionTips}");
// always dispose UpdateManager
@@ -133,9 +133,9 @@ namespace Flow.Launcher.Core
var uri = new Uri(repository);
var api = $"https://api.github.com/repos{uri.AbsolutePath}/releases";
- var json = await Http.GetAsync(api);
+ var jsonStream = await Http.GetStreamAsync(api).ConfigureAwait(false);
- var releases = JsonConvert.DeserializeObject>(json);
+ var releases = await System.Text.Json.JsonSerializer.DeserializeAsync>(jsonStream).ConfigureAwait(false);
var latest = releases.Where(r => !r.Prerelease).OrderByDescending(r => r.PublishedAt).First();
var latestUrl = latest.HtmlUrl.Replace("/tag/", "/download/");
From d4f94c66acfba5dddf0110b857519feed03eb99c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Tue, 29 Dec 2020 18:33:53 +0800
Subject: [PATCH 36/95] Make InstallOrUpdate to async
---
Flow.Launcher.Core/Updater.cs | 8 ++++----
Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs | 2 +-
.../Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs | 7 +++----
3 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/Flow.Launcher.Core/Updater.cs b/Flow.Launcher.Core/Updater.cs
index 05397e906..1e4b0453c 100644
--- a/Flow.Launcher.Core/Updater.cs
+++ b/Flow.Launcher.Core/Updater.cs
@@ -8,7 +8,6 @@ using System.Threading.Tasks;
using System.Windows;
using JetBrains.Annotations;
using Squirrel;
-using Newtonsoft.Json;
using Flow.Launcher.Core.Resource;
using Flow.Launcher.Plugin.SharedCommands;
using Flow.Launcher.Infrastructure;
@@ -17,6 +16,7 @@ using Flow.Launcher.Infrastructure.Logger;
using System.IO;
using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin;
+using System.Text.Json.Serialization;
namespace Flow.Launcher.Core
{
@@ -117,13 +117,13 @@ namespace Flow.Launcher.Core
[UsedImplicitly]
private class GithubRelease
{
- [JsonProperty("prerelease")]
+ [JsonPropertyName("prerelease")]
public bool Prerelease { get; [UsedImplicitly] set; }
- [JsonProperty("published_at")]
+ [JsonPropertyName("published_at")]
public DateTime PublishedAt { get; [UsedImplicitly] set; }
- [JsonProperty("html_url")]
+ [JsonPropertyName("html_url")]
public string HtmlUrl { get; [UsedImplicitly] set; }
}
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
index 716a424ff..d700b9dfd 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
@@ -22,7 +22,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
internal PluginsManager pluginManager;
- private DateTime lastUpdateTime;
+ private DateTime lastUpdateTime = DateTime.MinValue;
public Control CreateSettingPanel()
{
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
index 9635648d4..428610f43 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
@@ -87,7 +87,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
};
}
- internal void InstallOrUpdate(UserPlugin plugin)
+ internal async Task InstallOrUpdate(UserPlugin plugin)
{
if (PluginExists(plugin.ID))
{
@@ -127,7 +127,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_downloading_plugin"),
Context.API.GetTranslation("plugin_pluginsmanager_please_wait"));
- Http.Download(plugin.UrlDownload, filePath);
+ await Http.Download(plugin.UrlDownload, filePath).ConfigureAwait(false);
Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_downloading_plugin"),
Context.API.GetTranslation("plugin_pluginsmanager_download_success"));
@@ -264,8 +264,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
Action = e =>
{
Application.Current.MainWindow.Hide();
- InstallOrUpdate(x);
-
+ _ = InstallOrUpdate(x); // No need to wait
return ShouldHideWindow;
},
ContextData = x
From d0743f627668fa5bbd55a3daef37f82064fc3a23 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Tue, 29 Dec 2020 18:48:00 +0800
Subject: [PATCH 37/95] Await Http.Download in Update method
---
.../PluginsManager.cs | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
index 428610f43..f12112382 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
@@ -140,11 +140,8 @@ namespace Flow.Launcher.Plugin.PluginsManager
Log.Exception("PluginsManager", "An error occured while downloading plugin", e, "PluginDownload");
}
- Application.Current.Dispatcher.Invoke(() =>
- {
- Install(plugin, filePath);
- Context.API.RestartApp();
- });
+ Install(plugin, filePath);
+ Context.API.RestartApp();
}
internal List RequestUpdate(string search)
@@ -211,10 +208,14 @@ namespace Flow.Launcher.Plugin.PluginsManager
var downloadToFilePath = Path.Combine(DataLocation.PluginsDirectory,
$"{x.Name}-{x.NewVersion}.zip");
- Http.Download(x.PluginNewUserPlugin.UrlDownload, downloadToFilePath);
- Install(x.PluginNewUserPlugin, downloadToFilePath);
- Context.API.RestartApp();
+ Task.Run(async delegate
+ {
+ await Http.Download(x.PluginNewUserPlugin.UrlDownload, downloadToFilePath).ConfigureAwait(false);
+ Install(x.PluginNewUserPlugin, downloadToFilePath);
+
+ Context.API.RestartApp();
+ });
return true;
}
From c485578cff927a1714344c0eca1ab82870673fe1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Tue, 29 Dec 2020 18:48:55 +0800
Subject: [PATCH 38/95] Use CompareTo to check update for InstallOrUpdate
method
---
Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
index f12112382..ac15618ca 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
@@ -92,7 +92,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
if (PluginExists(plugin.ID))
{
if (Context.API.GetAllPlugins()
- .Any(x => x.Metadata.ID == plugin.ID && x.Metadata.Version != plugin.Version))
+ .Any(x => x.Metadata.ID == plugin.ID && x.Metadata.Version.CompareTo(plugin.Version) < 0))
{
if (MessageBox.Show(Context.API.GetTranslation("plugin_pluginsmanager_update_exists"),
Context.API.GetTranslation("plugin_pluginsmanager_update_title"),
From e2b0386818dca21d0ce9aba69cbb5331d524e676 Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Tue, 29 Dec 2020 22:32:14 +1100
Subject: [PATCH 39/95] remove Color plugin from Flow as a default plugin
---
Flow.Launcher.sln | 16 ---
.../Flow.Launcher.Plugin.Color.csproj | 101 ---------------
.../Images/color.png | Bin 1856 -> 0 bytes
.../Languages/de.xaml | 8 --
.../Languages/en.xaml | 8 --
.../Languages/pl.xaml | 8 --
.../Languages/sk.xaml | 8 --
.../Languages/tr.xaml | 8 --
.../Languages/zh-cn.xaml | 8 --
.../Languages/zh-tw.xaml | 7 -
Plugins/Flow.Launcher.Plugin.Color/Main.cs | 121 ------------------
.../Flow.Launcher.Plugin.Color/plugin.json | 12 --
12 files changed, 305 deletions(-)
delete mode 100644 Plugins/Flow.Launcher.Plugin.Color/Flow.Launcher.Plugin.Color.csproj
delete mode 100644 Plugins/Flow.Launcher.Plugin.Color/Images/color.png
delete mode 100644 Plugins/Flow.Launcher.Plugin.Color/Languages/de.xaml
delete mode 100644 Plugins/Flow.Launcher.Plugin.Color/Languages/en.xaml
delete mode 100644 Plugins/Flow.Launcher.Plugin.Color/Languages/pl.xaml
delete mode 100644 Plugins/Flow.Launcher.Plugin.Color/Languages/sk.xaml
delete mode 100644 Plugins/Flow.Launcher.Plugin.Color/Languages/tr.xaml
delete mode 100644 Plugins/Flow.Launcher.Plugin.Color/Languages/zh-cn.xaml
delete mode 100644 Plugins/Flow.Launcher.Plugin.Color/Languages/zh-tw.xaml
delete mode 100644 Plugins/Flow.Launcher.Plugin.Color/Main.cs
delete mode 100644 Plugins/Flow.Launcher.Plugin.Color/plugin.json
diff --git a/Flow.Launcher.sln b/Flow.Launcher.sln
index 4d8997177..21c3b47dc 100644
--- a/Flow.Launcher.sln
+++ b/Flow.Launcher.sln
@@ -20,7 +20,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher", "Flow.Launc
{F9C4C081-4CC3-4146-95F1-E102B4E10A5F} = {F9C4C081-4CC3-4146-95F1-E102B4E10A5F}
{59BD9891-3837-438A-958D-ADC7F91F6F7E} = {59BD9891-3837-438A-958D-ADC7F91F6F7E}
{C21BFF9C-2C99-4B5F-B7C9-A5E6DDDB37B0} = {C21BFF9C-2C99-4B5F-B7C9-A5E6DDDB37B0}
- {F35190AA-4758-4D9E-A193-E3BDF6AD3567} = {F35190AA-4758-4D9E-A193-E3BDF6AD3567}
{9B130CC5-14FB-41FF-B310-0A95B6894C37} = {9B130CC5-14FB-41FF-B310-0A95B6894C37}
{FDED22C8-B637-42E8-824A-63B5B6E05A3A} = {FDED22C8-B637-42E8-824A-63B5B6E05A3A}
{A3DCCBCA-ACC1-421D-B16E-210896234C26} = {A3DCCBCA-ACC1-421D-B16E-210896234C26}
@@ -44,8 +43,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.Sys",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.Url", "Plugins\Flow.Launcher.Plugin.Url\Flow.Launcher.Plugin.Url.csproj", "{A3DCCBCA-ACC1-421D-B16E-210896234C26}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.Color", "Plugins\Flow.Launcher.Plugin.Color\Flow.Launcher.Plugin.Color.csproj", "{F35190AA-4758-4D9E-A193-E3BDF6AD3567}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{FFD651C7-0546-441F-BC8C-D4EE8FD01EA7}"
ProjectSection(SolutionItems) = preProject
.gitattributes = .gitattributes
@@ -214,18 +211,6 @@ Global
{A3DCCBCA-ACC1-421D-B16E-210896234C26}.Release|x64.Build.0 = Release|Any CPU
{A3DCCBCA-ACC1-421D-B16E-210896234C26}.Release|x86.ActiveCfg = Release|Any CPU
{A3DCCBCA-ACC1-421D-B16E-210896234C26}.Release|x86.Build.0 = Release|Any CPU
- {F35190AA-4758-4D9E-A193-E3BDF6AD3567}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F35190AA-4758-4D9E-A193-E3BDF6AD3567}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F35190AA-4758-4D9E-A193-E3BDF6AD3567}.Debug|x64.ActiveCfg = Debug|Any CPU
- {F35190AA-4758-4D9E-A193-E3BDF6AD3567}.Debug|x64.Build.0 = Debug|Any CPU
- {F35190AA-4758-4D9E-A193-E3BDF6AD3567}.Debug|x86.ActiveCfg = Debug|Any CPU
- {F35190AA-4758-4D9E-A193-E3BDF6AD3567}.Debug|x86.Build.0 = Debug|Any CPU
- {F35190AA-4758-4D9E-A193-E3BDF6AD3567}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F35190AA-4758-4D9E-A193-E3BDF6AD3567}.Release|Any CPU.Build.0 = Release|Any CPU
- {F35190AA-4758-4D9E-A193-E3BDF6AD3567}.Release|x64.ActiveCfg = Release|Any CPU
- {F35190AA-4758-4D9E-A193-E3BDF6AD3567}.Release|x64.Build.0 = Release|Any CPU
- {F35190AA-4758-4D9E-A193-E3BDF6AD3567}.Release|x86.ActiveCfg = Release|Any CPU
- {F35190AA-4758-4D9E-A193-E3BDF6AD3567}.Release|x86.Build.0 = Release|Any CPU
{C21BFF9C-2C99-4B5F-B7C9-A5E6DDDB37B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C21BFF9C-2C99-4B5F-B7C9-A5E6DDDB37B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C21BFF9C-2C99-4B5F-B7C9-A5E6DDDB37B0}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -309,7 +294,6 @@ Global
{FDED22C8-B637-42E8-824A-63B5B6E05A3A} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
{0B9DE348-9361-4940-ADB6-F5953BFFCCEC} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
{A3DCCBCA-ACC1-421D-B16E-210896234C26} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
- {F35190AA-4758-4D9E-A193-E3BDF6AD3567} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
{C21BFF9C-2C99-4B5F-B7C9-A5E6DDDB37B0} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
{9B130CC5-14FB-41FF-B310-0A95B6894C37} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
{59BD9891-3837-438A-958D-ADC7F91F6F7E} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
diff --git a/Plugins/Flow.Launcher.Plugin.Color/Flow.Launcher.Plugin.Color.csproj b/Plugins/Flow.Launcher.Plugin.Color/Flow.Launcher.Plugin.Color.csproj
deleted file mode 100644
index c7fe8271a..000000000
--- a/Plugins/Flow.Launcher.Plugin.Color/Flow.Launcher.Plugin.Color.csproj
+++ /dev/null
@@ -1,101 +0,0 @@
-
-
-
- Library
- netcoreapp3.1
- {F35190AA-4758-4D9E-A193-E3BDF6AD3567}
- Properties
- Flow.Launcher.Plugin.Color
- Flow.Launcher.Plugin.Color
- true
- false
- false
-
-
-
- true
- full
- false
- ..\..\Output\Debug\Plugins\Flow.Launcher.Plugin.Color\
- DEBUG;TRACE
- prompt
- 4
- false
-
-
-
- pdbonly
- true
- ..\..\Output\Release\Plugins\Flow.Launcher.Plugin.Color\
- TRACE
- prompt
- 4
- false
-
-
-
-
- PreserveNewest
-
-
-
-
-
- PreserveNewest
-
-
-
-
-
-
-
-
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
-
\ No newline at end of file
diff --git a/Plugins/Flow.Launcher.Plugin.Color/Images/color.png b/Plugins/Flow.Launcher.Plugin.Color/Images/color.png
deleted file mode 100644
index da28583b1c9f174367acef0205f0c47f0a839ecd..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 1856
zcmV-G2fz4e%OapHR~QiSv}$
z`|SPw_WIV^7ZZNx5B<*d;}3xUcLaZx2=LHTUNG+g(Z&oQa{$CW^yENaxq-_Hz{8y`
zB+|nR!VA?35U15cp8n}_fs_|uXnO#l4JE}f2Wac@mfsuz4{qxQDF;jmV{I>O9q2LD
zR?=um5#Y|w4k*g=V0Hs=foL4e{dD9=9}hm|1EJlND8>kFJ=QUN>K-pK?EpdaHx2MO
zlh)_CKj1Uf4`8m0a%ZOtN@jMwx*aq7cvt)$ve|1)4b15oU;X3{L`HVwUbbm_JuLxg
zu9%7dcXjoEXiq6|kv09Hn$25QNg+5rlbrcJJi4~Jxm14)KIqx>MYn81qySml49hy2
zUj05uQO0UEZ)q@u$chKJd33EjSWK!%W+yp-iP;x$0zf>55P9N7J5vBAqF@Ff07I`{
zi%Skb7otG?5&%X#o4)8M6@4=RJ`hQ(OFqCN2&)3&d10G;AtobG7Jyz5J#Qul3fl-f
zIUin605=tWXAS^;o=vCqD_^!lc?9Nbzo{fH6q%Za-{!7E#hvx7zX+flNh}8Dt}dyK
z3N0kwOI$(_HU;%v>x#A)vIsC(YM+c%OIag&;Dc^J+ri013qF2zlC)Hj6>{%ST?q`?
zS0}5TZak9vEOBxEuli?hTNuV4p7nor6^U~o53Ns+qKeaRn9P|e}CKHL8G?1
z0DRzxD+U?{vfE)1g=9QZ3L+Z4;E%;FwSq9_dI$}Q9X0s?iL^TN+E>xA%G5klU+a&q
zs4KEnCfW<)Ewwq(3@tYSiO)kIZW0i6?P!i)LCd`5Rz30g5c}H(i*~U^0Q0tC!(C-52vto*rY;921%%@k
z_${?a+Z$^s&{$(RIgxD5h+o_2hSj<-yVnHfY;$eq3vI)UUHcy$?9KnY7{Flm^Iwuh
zB6jt{$t3+RR(;>B+ws6!92ifX|F6^Oh%T>N$d5(+>DWfk^TJAnQP7FNQI^&Gj90Tc
z@#9ZZmoH5xD$}Z#IX)72tiH+_zHL=qL#=D|v%Z(dap;Wg-7mkp8lIS%ZD0+V1}wlbr1=*EsPVa(@V`!kr&FQJ5xP*NQELADt5K+i8pAHE
zTX}Kop64Fh5`*>hJMUIce;sxvep*e?GL=k&Ef}qGU!AR6x8fh3^9_}DmhbKW$N@}P
zC?_6iRd-AL?Ofddoo!j-RHygm_bM6MmHz*rB2|qltFDD?7In-dL~vi*;QT~oAH5{@
z0{pg-jY^46soKm?EE3iT%@cP&=pS0KK0WSKXzouxS`hoX6~tp$Zf}59DVl9F5T=q?
z2sbLDvY9_Nb0wq_no@R0aO|0vHXJ*9PW;dD4QraU$-^NC`v{0t4&BH}Ac|&xKIe3v
z%tFSBIO8tVYngaqn{ShItwQ|S9lPAB!%=(m?72+uv5jk>X>$==?w`y+RFNOmcHM={
z03v8j$2&|fWH~0WCNOiSmY8c132Wqe(f*jGetdD=9ge9D4=(sTA0XGK7X9)h(&I7I
zr5-o3X%3>ouAL!5|Gr0t3~w-`yHPR7hr368KOiTgfXHDZq){
zqrC+AfkqDi3WW|=sZh1z1C1#FpbtCSukS!(#y%o8MF0wgmi=Yp$~gdsPo17DgfIob
z7{Sx+*LNm9@#3ce(%G378fpyd=9h_
z!V~~-5IfsTUT#TqU`a`AAYKo`6hJwWI8#PVMB$KaF5~%}ZH#JGE)uDGEr!R_?7Pz0
zH(ZGe2OsvHaU~tIJ;v3DM-D%6dkfiYrgoG9;+=FrocfIJoBCkUy3yq+&*g3oNZ3gO
zyac$J$pv7Xi2EOV{h{6$2I8V#OE18(eT}@at)c_(ed2}2ogj9DX&Quau+l55{rM9t
z%>mg0mizvND!5
diff --git a/Plugins/Flow.Launcher.Plugin.Color/Languages/de.xaml b/Plugins/Flow.Launcher.Plugin.Color/Languages/de.xaml
deleted file mode 100644
index 3244dee14..000000000
--- a/Plugins/Flow.Launcher.Plugin.Color/Languages/de.xaml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
- Farben
- Stellt eine HEX-Farben Vorschau bereit. (Versuche #000 in Flow Launcher)
-
-
\ No newline at end of file
diff --git a/Plugins/Flow.Launcher.Plugin.Color/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Color/Languages/en.xaml
deleted file mode 100644
index 85e2830db..000000000
--- a/Plugins/Flow.Launcher.Plugin.Color/Languages/en.xaml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
- Colors
- Allows to preview colors using hex values.(Try #000 in Flow Launcher)
-
-
\ No newline at end of file
diff --git a/Plugins/Flow.Launcher.Plugin.Color/Languages/pl.xaml b/Plugins/Flow.Launcher.Plugin.Color/Languages/pl.xaml
deleted file mode 100644
index 15525cfe9..000000000
--- a/Plugins/Flow.Launcher.Plugin.Color/Languages/pl.xaml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
- Kolory
- Podgląd kolorów po wpisaniu ich kodu szesnastkowego. (Spróbuj wpisać #000 w oknie Flow Launchera)
-
-
\ No newline at end of file
diff --git a/Plugins/Flow.Launcher.Plugin.Color/Languages/sk.xaml b/Plugins/Flow.Launcher.Plugin.Color/Languages/sk.xaml
deleted file mode 100644
index 4b208691a..000000000
--- a/Plugins/Flow.Launcher.Plugin.Color/Languages/sk.xaml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
- Farby
- Zobrazuje náhľad farieb v HEX formáte. (Skúste #000 vo Flow Launcheri)
-
-
\ No newline at end of file
diff --git a/Plugins/Flow.Launcher.Plugin.Color/Languages/tr.xaml b/Plugins/Flow.Launcher.Plugin.Color/Languages/tr.xaml
deleted file mode 100644
index f56e73526..000000000
--- a/Plugins/Flow.Launcher.Plugin.Color/Languages/tr.xaml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
- Renkler
- Hex kodunu girdiğiniz renkleri görüntülemeye yarar.(#000 yazmayı deneyin)
-
-
\ No newline at end of file
diff --git a/Plugins/Flow.Launcher.Plugin.Color/Languages/zh-cn.xaml b/Plugins/Flow.Launcher.Plugin.Color/Languages/zh-cn.xaml
deleted file mode 100644
index 39ede4844..000000000
--- a/Plugins/Flow.Launcher.Plugin.Color/Languages/zh-cn.xaml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
- 颜色
- 提供在Flow Launcher查询hex颜色。(尝试在Flow Launcher中输入#000)
-
-
\ No newline at end of file
diff --git a/Plugins/Flow.Launcher.Plugin.Color/Languages/zh-tw.xaml b/Plugins/Flow.Launcher.Plugin.Color/Languages/zh-tw.xaml
deleted file mode 100644
index 4e7062a22..000000000
--- a/Plugins/Flow.Launcher.Plugin.Color/Languages/zh-tw.xaml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
- 顏色
- 提供在 Flow Launcher 查詢 hex 顏色。(試著在 Flow Launcher 中輸入 #000)
-
diff --git a/Plugins/Flow.Launcher.Plugin.Color/Main.cs b/Plugins/Flow.Launcher.Plugin.Color/Main.cs
deleted file mode 100644
index a15483ebc..000000000
--- a/Plugins/Flow.Launcher.Plugin.Color/Main.cs
+++ /dev/null
@@ -1,121 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Drawing.Imaging;
-using System.IO;
-using System.Linq;
-using System.Windows;
-
-namespace Flow.Launcher.Plugin.Color
-{
- public sealed class ColorsPlugin : IPlugin, IPluginI18n
- {
- private string DIR_PATH = Path.Combine(Path.GetTempPath(), @"Plugins\Colors\");
- private PluginInitContext context;
- private const int IMG_SIZE = 32;
-
- private DirectoryInfo ColorsDirectory { get; set; }
-
- public ColorsPlugin()
- {
- if (!Directory.Exists(DIR_PATH))
- {
- ColorsDirectory = Directory.CreateDirectory(DIR_PATH);
- }
- else
- {
- ColorsDirectory = new DirectoryInfo(DIR_PATH);
- }
- }
-
- public List Query(Query query)
- {
- var raw = query.Search;
- if (!IsAvailable(raw)) return new List(0);
- try
- {
- var cached = Find(raw);
- if (cached.Length == 0)
- {
- var path = CreateImage(raw);
- return new List
- {
- new Result
- {
- Title = raw,
- IcoPath = path,
- Action = _ =>
- {
- Clipboard.SetText(raw);
- return true;
- }
- }
- };
- }
- return cached.Select(x => new Result
- {
- Title = raw,
- IcoPath = x.FullName,
- Action = _ =>
- {
- Clipboard.SetText(raw);
- return true;
- }
- }).ToList();
- }
- catch (Exception exception)
- {
- // todo: log
- return new List(0);
- }
- }
-
- private bool IsAvailable(string query)
- {
- // todo: rgb, names
- var length = query.Length - 1; // minus `#` sign
- return query.StartsWith("#") && (length == 3 || length == 6);
- }
-
- public FileInfo[] Find(string name)
- {
- var file = string.Format("{0}.png", name.Substring(1));
- return ColorsDirectory.GetFiles(file, SearchOption.TopDirectoryOnly);
- }
-
- private string CreateImage(string name)
- {
- using (var bitmap = new Bitmap(IMG_SIZE, IMG_SIZE))
- using (var graphics = Graphics.FromImage(bitmap))
- {
- var color = ColorTranslator.FromHtml(name);
- graphics.Clear(color);
-
- var path = CreateFileName(name);
- bitmap.Save(path, ImageFormat.Png);
- return path;
- }
- }
-
- private string CreateFileName(string name)
- {
- return string.Format("{0}{1}.png", ColorsDirectory.FullName, name.Substring(1));
- }
-
- public void Init(PluginInitContext context)
- {
- this.context = context;
- }
-
-
- public string GetTranslatedPluginTitle()
- {
- return context.API.GetTranslation("flowlauncher_plugin_color_plugin_name");
- }
-
- public string GetTranslatedPluginDescription()
- {
- return context.API.GetTranslation("flowlauncher_plugin_color_plugin_description");
- }
- }
-}
\ No newline at end of file
diff --git a/Plugins/Flow.Launcher.Plugin.Color/plugin.json b/Plugins/Flow.Launcher.Plugin.Color/plugin.json
deleted file mode 100644
index 8c0c483ba..000000000
--- a/Plugins/Flow.Launcher.Plugin.Color/plugin.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "ID": "9B36CE6181FC47FBB597AA2C29CD9B0A",
- "ActionKeyword": "*",
- "Name": "Colors",
- "Description": "Provide hex color preview.(Try #000 in Flow Launcher)",
- "Author": "qianlifeng",
- "Version": "1.1.1",
- "Language": "csharp",
- "Website": "https://github.com/Flow-Launcher/Flow.Launcher",
- "ExecuteFileName": "Flow.Launcher.Plugin.Color.dll",
- "IcoPath": "Images\\color.png"
-}
From 85584f40ee51d23e185ee67e4579859017dd1011 Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Tue, 29 Dec 2020 22:41:21 +1100
Subject: [PATCH 40/95] remove post build script target of JsonRPC folder copy
---
Scripts/post_build.ps1 | 1 -
1 file changed, 1 deletion(-)
diff --git a/Scripts/post_build.ps1 b/Scripts/post_build.ps1
index 18ce33c4f..59036842a 100644
--- a/Scripts/post_build.ps1
+++ b/Scripts/post_build.ps1
@@ -36,7 +36,6 @@ function Copy-Resources ($path, $config) {
$output = "$path\Output"
$target = "$output\$config"
Copy-Item -Recurse -Force $project\Images\* $target\Images\
- Copy-Item -Recurse -Force $path\JsonRPC $target\JsonRPC
# making version static as multiple versions can exist in the nuget folder and in the case a breaking change is introduced.
Copy-Item -Force $env:USERPROFILE\.nuget\packages\squirrel.windows\1.5.2\tools\Squirrel.exe $output\Update.exe
}
From d28b14ff2d4cb9a8d58d926f9d2542fd22941758 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Wed, 30 Dec 2020 13:40:42 +0800
Subject: [PATCH 41/95] Replace All use of Json.Net with System.Text.Json
---
Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs | 6 ++--
Flow.Launcher.Core/Plugin/PluginConfig.cs | 4 +--
Flow.Launcher.Core/Updater.cs | 1 -
Flow.Launcher.Infrastructure/Helper.cs | 28 +++++++++++++------
Flow.Launcher.Infrastructure/Logger/Log.cs | 2 +-
.../Storage/JsonStorage.cs | 16 +++++------
.../UserSettings/Settings.cs | 16 ++++++-----
Flow.Launcher.Plugin/PluginMetadata.cs | 3 +-
Flow.Launcher/Storage/QueryHistory.cs | 1 -
Flow.Launcher/Storage/TopMostRecord.cs | 3 +-
Flow.Launcher/Storage/UserSelectedRecord.cs | 2 --
.../Search/FolderLinks/FolderLink.cs | 8 +++---
.../Flow.Launcher.Plugin.Explorer/Settings.cs | 8 +-----
.../SearchSource.cs | 2 +-
.../Settings.cs | 2 +-
.../SuggestionSources/Baidu.cs | 20 +++++--------
.../SuggestionSources/Google.cs | 22 ++++++---------
17 files changed, 67 insertions(+), 77 deletions(-)
diff --git a/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs b/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs
index 31bf04286..3d4522498 100644
--- a/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs
+++ b/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs
@@ -3,10 +3,10 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
+using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
-using Newtonsoft.Json;
using Flow.Launcher.Infrastructure.Exception;
using Flow.Launcher.Infrastructure.Logger;
using Flow.Launcher.Plugin;
@@ -65,7 +65,7 @@ namespace Flow.Launcher.Core.Plugin
{
List results = new List();
- JsonRPCQueryResponseModel queryResponseModel = JsonConvert.DeserializeObject(output);
+ JsonRPCQueryResponseModel queryResponseModel = JsonSerializer.Deserialize(output);
if (queryResponseModel.Result == null) return null;
foreach (JsonRPCResult result in queryResponseModel.Result)
@@ -84,7 +84,7 @@ namespace Flow.Launcher.Core.Plugin
else
{
string actionReponse = ExecuteCallback(result1.JsonRPCAction);
- JsonRPCRequestModel jsonRpcRequestModel = JsonConvert.DeserializeObject(actionReponse);
+ JsonRPCRequestModel jsonRpcRequestModel = JsonSerializer.Deserialize(actionReponse);
if (jsonRpcRequestModel != null
&& !String.IsNullOrEmpty(jsonRpcRequestModel.Method)
&& jsonRpcRequestModel.Method.StartsWith("Flow.Launcher."))
diff --git a/Flow.Launcher.Core/Plugin/PluginConfig.cs b/Flow.Launcher.Core/Plugin/PluginConfig.cs
index b946fa44d..46f79c60c 100644
--- a/Flow.Launcher.Core/Plugin/PluginConfig.cs
+++ b/Flow.Launcher.Core/Plugin/PluginConfig.cs
@@ -2,10 +2,10 @@
using System.Collections.Generic;
using System.Linq;
using System.IO;
-using Newtonsoft.Json;
using Flow.Launcher.Infrastructure;
using Flow.Launcher.Infrastructure.Logger;
using Flow.Launcher.Plugin;
+using System.Text.Json;
namespace Flow.Launcher.Core.Plugin
{
@@ -61,7 +61,7 @@ namespace Flow.Launcher.Core.Plugin
PluginMetadata metadata;
try
{
- metadata = JsonConvert.DeserializeObject(File.ReadAllText(configPath));
+ metadata = JsonSerializer.Deserialize(File.ReadAllText(configPath));
metadata.PluginDirectory = pluginDirectory;
// for plugins which doesn't has ActionKeywords key
metadata.ActionKeywords = metadata.ActionKeywords ?? new List { metadata.ActionKeyword };
diff --git a/Flow.Launcher.Core/Updater.cs b/Flow.Launcher.Core/Updater.cs
index 1e4b0453c..e1aa42730 100644
--- a/Flow.Launcher.Core/Updater.cs
+++ b/Flow.Launcher.Core/Updater.cs
@@ -13,7 +13,6 @@ using Flow.Launcher.Plugin.SharedCommands;
using Flow.Launcher.Infrastructure;
using Flow.Launcher.Infrastructure.Http;
using Flow.Launcher.Infrastructure.Logger;
-using System.IO;
using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin;
using System.Text.Json.Serialization;
diff --git a/Flow.Launcher.Infrastructure/Helper.cs b/Flow.Launcher.Infrastructure/Helper.cs
index fa7e18533..331b3a823 100644
--- a/Flow.Launcher.Infrastructure/Helper.cs
+++ b/Flow.Launcher.Infrastructure/Helper.cs
@@ -1,12 +1,19 @@
-using System;
+using Newtonsoft.Json.Converters;
+using System;
using System.IO;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Converters;
+using System.Runtime.CompilerServices;
+using System.Text.Json;
+using System.Text.Json.Serialization;
namespace Flow.Launcher.Infrastructure
{
public static class Helper
{
+ static Helper()
+ {
+ jsonFormattedSerializerOptions.Converters.Add(new JsonStringEnumConverter());
+ }
+
///
/// http://www.yinwang.org/blog-cn/2015/11/21/programming-philosophy
///
@@ -65,13 +72,18 @@ namespace Flow.Launcher.Infrastructure
}
}
+ private static readonly JsonSerializerOptions jsonFormattedSerializerOptions = new JsonSerializerOptions
+ {
+ WriteIndented = true
+ };
+
public static string Formatted(this T t)
{
- var formatted = JsonConvert.SerializeObject(
- t,
- Formatting.Indented,
- new StringEnumConverter()
- );
+ var formatted = JsonSerializer.Serialize(t, new JsonSerializerOptions
+ {
+ WriteIndented = true
+ });
+
return formatted;
}
}
diff --git a/Flow.Launcher.Infrastructure/Logger/Log.cs b/Flow.Launcher.Infrastructure/Logger/Log.cs
index 289ec5d68..91eeb183d 100644
--- a/Flow.Launcher.Infrastructure/Logger/Log.cs
+++ b/Flow.Launcher.Infrastructure/Logger/Log.cs
@@ -128,7 +128,7 @@ namespace Flow.Launcher.Infrastructure.Logger
public static void Exception(string message, System.Exception e)
{
#if DEBUG
- throw e;
+ throw e;
#else
if (FormatValid(message))
{
diff --git a/Flow.Launcher.Infrastructure/Storage/JsonStorage.cs b/Flow.Launcher.Infrastructure/Storage/JsonStorage.cs
index 784c11110..268dc20b8 100644
--- a/Flow.Launcher.Infrastructure/Storage/JsonStorage.cs
+++ b/Flow.Launcher.Infrastructure/Storage/JsonStorage.cs
@@ -1,7 +1,7 @@
using System;
using System.Globalization;
using System.IO;
-using Newtonsoft.Json;
+using System.Text.Json;
using Flow.Launcher.Infrastructure.Logger;
namespace Flow.Launcher.Infrastructure.Storage
@@ -11,7 +11,7 @@ namespace Flow.Launcher.Infrastructure.Storage
///
public class JsonStrorage
{
- private readonly JsonSerializerSettings _serializerSettings;
+ private readonly JsonSerializerOptions _serializerSettings;
private T _data;
// need a new directory name
public const string DirectoryName = "Settings";
@@ -24,10 +24,9 @@ namespace Flow.Launcher.Infrastructure.Storage
{
// use property initialization instead of DefaultValueAttribute
// easier and flexible for default value of object
- _serializerSettings = new JsonSerializerSettings
+ _serializerSettings = new JsonSerializerOptions
{
- ObjectCreationHandling = ObjectCreationHandling.Replace,
- NullValueHandling = NullValueHandling.Ignore
+ IgnoreNullValues = false
};
}
@@ -56,7 +55,7 @@ namespace Flow.Launcher.Infrastructure.Storage
{
try
{
- _data = JsonConvert.DeserializeObject(searlized, _serializerSettings);
+ _data = JsonSerializer.Deserialize(searlized, _serializerSettings);
}
catch (JsonException e)
{
@@ -77,7 +76,7 @@ namespace Flow.Launcher.Infrastructure.Storage
BackupOriginFile();
}
- _data = JsonConvert.DeserializeObject("{}", _serializerSettings);
+ _data = JsonSerializer.Deserialize("{}", _serializerSettings);
Save();
}
@@ -94,7 +93,8 @@ namespace Flow.Launcher.Infrastructure.Storage
public void Save()
{
- string serialized = JsonConvert.SerializeObject(_data, Formatting.Indented);
+ string serialized = JsonSerializer.Serialize(_data, new JsonSerializerOptions() { WriteIndented = true });
+
File.WriteAllText(FilePath, serialized);
}
}
diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs
index 832b6fbfa..bcfe298a9 100644
--- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs
+++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs
@@ -1,8 +1,7 @@
using System;
using System.Collections.ObjectModel;
using System.Drawing;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Converters;
+using System.Text.Json.Serialization;
using Flow.Launcher.Plugin;
namespace Flow.Launcher.Infrastructure.UserSettings
@@ -16,7 +15,8 @@ namespace Flow.Launcher.Infrastructure.UserSettings
public bool ShowOpenResultHotkey { get; set; } = true;
public string Language
{
- get => language; set {
+ get => language; set
+ {
language = value;
OnPropertyChanged();
}
@@ -73,9 +73,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings
public int MaxResultsToShow { get; set; } = 5;
public int ActivateTimes { get; set; }
- // Order defaults to 0 or -1, so 1 will let this property appear last
- [JsonProperty(Order = 1)]
- public PluginsSettings PluginSettings { get; set; } = new PluginsSettings();
+
public ObservableCollection CustomPluginHotkeys { get; set; } = new ObservableCollection();
public bool DontPromptUpdateMsg { get; set; }
@@ -100,8 +98,12 @@ namespace Flow.Launcher.Infrastructure.UserSettings
public HttpProxy Proxy { get; set; } = new HttpProxy();
- [JsonConverter(typeof(StringEnumConverter))]
+ [JsonConverter(typeof(JsonStringEnumConverter))]
public LastQueryMode LastQueryMode { get; set; } = LastQueryMode.Selected;
+
+
+ // Order defaults to 0 or -1, so 1 will let this property appear last
+ public PluginsSettings PluginSettings { get; set; } = new PluginsSettings();
}
public enum LastQueryMode
diff --git a/Flow.Launcher.Plugin/PluginMetadata.cs b/Flow.Launcher.Plugin/PluginMetadata.cs
index d81b442e2..4c40be53c 100644
--- a/Flow.Launcher.Plugin/PluginMetadata.cs
+++ b/Flow.Launcher.Plugin/PluginMetadata.cs
@@ -1,11 +1,10 @@
using System;
using System.Collections.Generic;
using System.IO;
-using Newtonsoft.Json;
+using System.Text.Json.Serialization;
namespace Flow.Launcher.Plugin
{
- [JsonObject(MemberSerialization.OptOut)]
public class PluginMetadata : BaseModel
{
private string _pluginDirectory;
diff --git a/Flow.Launcher/Storage/QueryHistory.cs b/Flow.Launcher/Storage/QueryHistory.cs
index de3bcaa22..2b2103605 100644
--- a/Flow.Launcher/Storage/QueryHistory.cs
+++ b/Flow.Launcher/Storage/QueryHistory.cs
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using Newtonsoft.Json;
using Flow.Launcher.Plugin;
namespace Flow.Launcher.Storage
diff --git a/Flow.Launcher/Storage/TopMostRecord.cs b/Flow.Launcher/Storage/TopMostRecord.cs
index c110bdf92..09e69f6d8 100644
--- a/Flow.Launcher/Storage/TopMostRecord.cs
+++ b/Flow.Launcher/Storage/TopMostRecord.cs
@@ -1,6 +1,6 @@
using System.Collections.Generic;
using System.Linq;
-using Newtonsoft.Json;
+using System.Text.Json;
using Flow.Launcher.Plugin;
namespace Flow.Launcher.Storage
@@ -8,7 +8,6 @@ namespace Flow.Launcher.Storage
// todo this class is not thread safe.... but used from multiple threads.
public class TopMostRecord
{
- [JsonProperty]
private Dictionary records = new Dictionary();
internal bool IsTopMost(Result result)
diff --git a/Flow.Launcher/Storage/UserSelectedRecord.cs b/Flow.Launcher/Storage/UserSelectedRecord.cs
index 1fda04e9b..c7ffe1a1d 100644
--- a/Flow.Launcher/Storage/UserSelectedRecord.cs
+++ b/Flow.Launcher/Storage/UserSelectedRecord.cs
@@ -1,5 +1,4 @@
using System.Collections.Generic;
-using Newtonsoft.Json;
using Flow.Launcher.Infrastructure.Storage;
using Flow.Launcher.Plugin;
@@ -7,7 +6,6 @@ namespace Flow.Launcher.Storage
{
public class UserSelectedRecord
{
- [JsonProperty]
private Dictionary records = new Dictionary();
public void Add(Result result)
diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/FolderLinks/FolderLink.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/FolderLinks/FolderLink.cs
index 379b5848f..43ecdad97 100644
--- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/FolderLinks/FolderLink.cs
+++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/FolderLinks/FolderLink.cs
@@ -1,15 +1,15 @@
-using Newtonsoft.Json;
-using System;
+using System;
using System.Linq;
+using System.Text.Json;
+using System.Text.Json.Serialization;
namespace Flow.Launcher.Plugin.Explorer.Search.FolderLinks
{
- [JsonObject(MemberSerialization.OptIn)]
public class FolderLink
{
- [JsonProperty]
public string Path { get; set; }
+ [JsonIgnore]
public string Nickname
{
get
diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs
index 5b12870c8..e62ea93fc 100644
--- a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs
+++ b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs
@@ -1,28 +1,22 @@
using Flow.Launcher.Plugin.Explorer.Search;
using Flow.Launcher.Plugin.Explorer.Search.FolderLinks;
-using Newtonsoft.Json;
using System.Collections.Generic;
+using System.Text.Json.Serialization;
namespace Flow.Launcher.Plugin.Explorer
{
public class Settings
{
- [JsonProperty]
public int MaxResult { get; set; } = 100;
- [JsonProperty]
public List QuickFolderAccessLinks { get; set; } = new List();
- [JsonProperty]
public bool UseWindowsIndexForDirectorySearch { get; set; } = true;
- [JsonProperty]
public List IndexSearchExcludedSubdirectoryPaths { get; set; } = new List();
- [JsonProperty]
public string SearchActionKeyword { get; set; } = Query.GlobalPluginWildcardSign;
- [JsonProperty]
public string FileContentSearchActionKeyword { get; set; } = Constants.DefaultContentSearchActionKeyword;
}
}
\ No newline at end of file
diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSource.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSource.cs
index c7ccb4d51..98e9376fb 100644
--- a/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSource.cs
+++ b/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSource.cs
@@ -1,10 +1,10 @@
using System.IO;
using System.Windows.Media;
using JetBrains.Annotations;
-using Newtonsoft.Json;
using Flow.Launcher.Infrastructure.Image;
using Flow.Launcher.Infrastructure;
using System.Reflection;
+using System.Text.Json.Serialization;
namespace Flow.Launcher.Plugin.WebSearch
{
diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Settings.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/Settings.cs
index 555ee4647..e8881aae9 100644
--- a/Plugins/Flow.Launcher.Plugin.WebSearch/Settings.cs
+++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Settings.cs
@@ -1,6 +1,6 @@
using System;
using System.Collections.ObjectModel;
-using Newtonsoft.Json;
+using System.Text.Json.Serialization;
using Flow.Launcher.Plugin.WebSearch.SuggestionSources;
namespace Flow.Launcher.Plugin.WebSearch
diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Baidu.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Baidu.cs
index 6772acf82..2e385510f 100644
--- a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Baidu.cs
+++ b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Baidu.cs
@@ -2,10 +2,9 @@
using System.Collections.Generic;
using System.Linq;
using System.Net;
+using System.Text.Json;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
using Flow.Launcher.Infrastructure.Http;
using Flow.Launcher.Infrastructure.Logger;
using System.Net.Http;
@@ -35,25 +34,20 @@ namespace Flow.Launcher.Plugin.WebSearch.SuggestionSources
Match match = _reg.Match(result);
if (match.Success)
{
- JContainer json;
+ JsonDocument json;
try
{
- json = JsonConvert.DeserializeObject(match.Groups[1].Value) as JContainer;
+ json = JsonDocument.Parse(match.Groups[1].Value);
}
- catch (JsonSerializationException e)
+ catch(JsonException e)
{
Log.Exception("|Baidu.Suggestions|can't parse suggestions", e);
return new List();
}
- if (json != null)
- {
- var results = json["s"] as JArray;
- if (results != null)
- {
- return results.OfType().Select(o => o.Value).OfType().ToList();
- }
- }
+ var results = json?.RootElement.GetProperty("s");
+
+ return results?.EnumerateArray().Select(o => o.GetString()).ToList() ?? new List();
}
return new List();
diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Google.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Google.cs
index 5b9538091..ff0906b87 100644
--- a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Google.cs
+++ b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Google.cs
@@ -3,11 +3,10 @@ using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
using Flow.Launcher.Infrastructure.Http;
using Flow.Launcher.Infrastructure.Logger;
using System.Net.Http;
+using System.Text.Json;
namespace Flow.Launcher.Plugin.WebSearch.SuggestionSources
{
@@ -27,25 +26,20 @@ namespace Flow.Launcher.Plugin.WebSearch.SuggestionSources
return new List();
}
if (string.IsNullOrEmpty(result)) return new List();
- JContainer json;
+ JsonDocument json;
try
{
- json = JsonConvert.DeserializeObject(result) as JContainer;
+ json = JsonDocument.Parse(result);
}
- catch (JsonSerializationException e)
+ catch (JsonException e)
{
Log.Exception("|Google.Suggestions|can't parse suggestions", e);
return new List();
}
- if (json != null)
- {
- var results = json[1] as JContainer;
- if (results != null)
- {
- return results.OfType().Select(o => o.Value).OfType().ToList();
- }
- }
- return new List();
+
+ var results = json?.RootElement.EnumerateArray().ElementAt(1);
+
+ return results?.EnumerateArray().Select(o => o.GetString()).ToList() ?? new List();
}
public override string ToString()
From 557842e8d797c3ca0146ed77d0a45906f5c6f3d1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Wed, 30 Dec 2020 13:48:06 +0800
Subject: [PATCH 42/95] remove dependency
---
Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj | 1 -
Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj | 1 -
2 files changed, 2 deletions(-)
diff --git a/Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj b/Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj
index 28d4c0e1f..8153de6c8 100644
--- a/Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj
+++ b/Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj
@@ -49,7 +49,6 @@
-
diff --git a/Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj b/Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj
index 70013c274..b7b52ac35 100644
--- a/Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj
+++ b/Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj
@@ -62,7 +62,6 @@
-
\ No newline at end of file
From 7bbd8c6069ef038186482b50d731cec90396b987 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Wed, 30 Dec 2020 19:05:02 +0800
Subject: [PATCH 43/95] remove using from Helper.cs
---
Flow.Launcher.Infrastructure/Helper.cs | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/Flow.Launcher.Infrastructure/Helper.cs b/Flow.Launcher.Infrastructure/Helper.cs
index 331b3a823..faa4c93b5 100644
--- a/Flow.Launcher.Infrastructure/Helper.cs
+++ b/Flow.Launcher.Infrastructure/Helper.cs
@@ -1,5 +1,4 @@
-using Newtonsoft.Json.Converters;
-using System;
+using System;
using System.IO;
using System.Runtime.CompilerServices;
using System.Text.Json;
From a0c4cc35756c42d7351bee37c795e063fd933dd3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Wed, 30 Dec 2020 19:09:52 +0800
Subject: [PATCH 44/95] use ParseAsync in Google
---
.../SuggestionSources/Google.cs | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Google.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Google.cs
index ff0906b87..f23cb66ff 100644
--- a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Google.cs
+++ b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Google.cs
@@ -7,6 +7,7 @@ using Flow.Launcher.Infrastructure.Http;
using Flow.Launcher.Infrastructure.Logger;
using System.Net.Http;
using System.Text.Json;
+using System.IO;
namespace Flow.Launcher.Plugin.WebSearch.SuggestionSources
{
@@ -14,22 +15,22 @@ namespace Flow.Launcher.Plugin.WebSearch.SuggestionSources
{
public override async Task> Suggestions(string query)
{
- string result;
+ Stream resultStream;
try
{
const string api = "https://www.google.com/complete/search?output=chrome&q=";
- result = await Http.GetAsync(api + Uri.EscapeUriString(query)).ConfigureAwait(false);
+ resultStream = await Http.GetStreamAsync(api + Uri.EscapeUriString(query)).ConfigureAwait(false);
}
catch (HttpRequestException e)
{
Log.Exception("|Google.Suggestions|Can't get suggestion from google", e);
return new List();
}
- if (string.IsNullOrEmpty(result)) return new List();
+ if (resultStream.Length == 0) return new List();
JsonDocument json;
try
{
- json = JsonDocument.Parse(result);
+ json = await JsonDocument.ParseAsync(resultStream);
}
catch (JsonException e)
{
From a139a040ecc3bca388b77c7c4ba39de35eccd638 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Wed, 30 Dec 2020 20:24:01 +0800
Subject: [PATCH 45/95] add bing search suggestion
---
.../Settings.cs | 3 +-
.../SuggestionSources/Bing.cs | 62 +++++++++++++++++++
2 files changed, 64 insertions(+), 1 deletion(-)
create mode 100644 Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Bing.cs
diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Settings.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/Settings.cs
index 555ee4647..1a3d9e5e5 100644
--- a/Plugins/Flow.Launcher.Plugin.WebSearch/Settings.cs
+++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Settings.cs
@@ -196,7 +196,8 @@ namespace Flow.Launcher.Plugin.WebSearch
[JsonIgnore]
public SuggestionSource[] Suggestions { get; set; } = {
new Google(),
- new Baidu()
+ new Baidu(),
+ new Bing()
};
[JsonIgnore]
diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Bing.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Bing.cs
new file mode 100644
index 000000000..9c4746711
--- /dev/null
+++ b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Bing.cs
@@ -0,0 +1,62 @@
+using Flow.Launcher.Infrastructure.Http;
+using Flow.Launcher.Infrastructure.Logger;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Net.Http;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+using System.Text.Json;
+using System.Linq;
+
+namespace Flow.Launcher.Plugin.WebSearch.SuggestionSources
+{
+ class Bing : SuggestionSource
+ {
+ public override async Task> Suggestions(string query)
+ {
+ Stream resultStream;
+
+ try
+ {
+ const string api = "https://api.bing.com/qsonhs.aspx?q=";
+ resultStream = await Http.GetStreamAsync(api + Uri.EscapeUriString(query)).ConfigureAwait(false);
+ }
+ catch (HttpRequestException e)
+ {
+ Log.Exception("|Bing.Suggestions|Can't get suggestion from Bing", e);
+ return new List();
+ }
+
+ if (resultStream.Length == 0) return new List();
+
+ JsonElement json;
+ try
+ {
+ json = (await JsonDocument.ParseAsync(resultStream)).RootElement.GetProperty("AS");
+ }
+ catch (JsonException e)
+ {
+ Log.Exception("|Bing.Suggestions|can't parse suggestions", e);
+ return new List();
+ }
+
+ if (json.GetProperty("FullResults").GetInt32() == 0)
+ return new List();
+
+ return json.GetProperty("Results")
+ .EnumerateArray()
+ .SelectMany(r => r.GetProperty("Suggests")
+ .EnumerateArray()
+ .Select(s => s.GetProperty("Txt").GetString()))
+ .ToList();
+
+ }
+
+ public override string ToString()
+ {
+ return "Bing";
+ }
+ }
+}
From 5c17cb6e9b823482784f7ef0dda0df35f65eb932 Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Thu, 31 Dec 2020 15:44:57 +1100
Subject: [PATCH 46/95] version bump WebSearch
---
Plugins/Flow.Launcher.Plugin.WebSearch/plugin.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/plugin.json b/Plugins/Flow.Launcher.Plugin.WebSearch/plugin.json
index 329f1c41d..99fd2210a 100644
--- a/Plugins/Flow.Launcher.Plugin.WebSearch/plugin.json
+++ b/Plugins/Flow.Launcher.Plugin.WebSearch/plugin.json
@@ -25,7 +25,7 @@
"Name": "Web Searches",
"Description": "Provide the web search ability",
"Author": "qianlifeng",
- "Version": "1.1.2",
+ "Version": "1.2.0",
"Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.WebSearch.dll",
From 27a0b934c612b8d3a482722c53910b7487a973d7 Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Fri, 1 Jan 2021 18:39:41 +1100
Subject: [PATCH 47/95] update maintenance badge
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 02f488758..654877f3a 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
-
+
[](https://ci.appveyor.com/project/JohnTheGr8/flow-launcher/branch/dev)
[](https://github.com/Flow-Launcher/Flow.Launcher/releases)
[](https://github.com/Flow-Launcher/Flow.Launcher/releases/latest)
From a65e17dba00830c32c746d7dea3b737fc518fa7a Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Fri, 1 Jan 2021 18:57:58 +1100
Subject: [PATCH 48/95] fix wrong error message
---
Plugins/Flow.Launcher.Plugin.PluginsManager/Languages/en.xaml | 4 +++-
Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs | 4 ++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.PluginsManager/Languages/en.xaml
index 8d24c145c..eaea9783b 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Languages/en.xaml
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Languages/en.xaml
@@ -1,4 +1,4 @@
-
@@ -6,6 +6,8 @@
Downloading plugin
Please wait...
Successfully downloaded
+ Error downloading plugin
+ Error occured while trying to download the plugin
{0} by {1} {2}{3}Would you like to uninstall this plugin? After the uninstallation Flow will automatically restart.
{0} by {1} {2}{3}Would you like to install this plugin? After the installation Flow will automatically restart.
Plugin Install
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
index ac15618ca..a378a9046 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
@@ -134,8 +134,8 @@ namespace Flow.Launcher.Plugin.PluginsManager
}
catch (Exception e)
{
- Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_downloading_plugin"),
- Context.API.GetTranslation("plugin_pluginsmanager_download_success"));
+ Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_download_error_title"),
+ Context.API.GetTranslation("plugin_pluginsmanager_download_error_subtitle"));
Log.Exception("PluginsManager", "An error occured while downloading plugin", e, "PluginDownload");
}
From 54f6858937fdf3445e8503e7da398bafd0efa4b5 Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Fri, 1 Jan 2021 19:03:06 +1100
Subject: [PATCH 49/95] add plugin name to error msg popup
---
Plugins/Flow.Launcher.Plugin.PluginsManager/Languages/en.xaml | 2 +-
Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.PluginsManager/Languages/en.xaml
index eaea9783b..d0370ddc3 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Languages/en.xaml
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Languages/en.xaml
@@ -7,7 +7,7 @@
Please wait...
Successfully downloaded
Error downloading plugin
- Error occured while trying to download the plugin
+ Error occured while trying to download {0}
{0} by {1} {2}{3}Would you like to uninstall this plugin? After the uninstallation Flow will automatically restart.
{0} by {1} {2}{3}Would you like to install this plugin? After the installation Flow will automatically restart.
Plugin Install
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
index a378a9046..9d9d50902 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
@@ -135,7 +135,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
catch (Exception e)
{
Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_download_error_title"),
- Context.API.GetTranslation("plugin_pluginsmanager_download_error_subtitle"));
+ string.Format(Context.API.GetTranslation("plugin_pluginsmanager_download_error_subtitle"), plugin.Name));
Log.Exception("PluginsManager", "An error occured while downloading plugin", e, "PluginDownload");
}
From cab1b93183d4a8170f3b589354e1159b8e92cd7c Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Fri, 1 Jan 2021 19:13:14 +1100
Subject: [PATCH 50/95] move install method into try catch
---
.../Languages/en.xaml | 4 ++--
.../PluginsManager.cs | 9 +++++----
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.PluginsManager/Languages/en.xaml
index d0370ddc3..3017f39c3 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Languages/en.xaml
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Languages/en.xaml
@@ -6,13 +6,13 @@
Downloading plugin
Please wait...
Successfully downloaded
- Error downloading plugin
- Error occured while trying to download {0}
{0} by {1} {2}{3}Would you like to uninstall this plugin? After the uninstallation Flow will automatically restart.
{0} by {1} {2}{3}Would you like to install this plugin? After the installation Flow will automatically restart.
Plugin Install
Plugin Uninstall
Install failed: unable to find the plugin.json metadata file from the new plugin
+ Error installing plugin
+ Error occured while trying to install {0}
No update available
All plugins are up to date
{0} by {1} {2}{3}Would you like to update this plugin? After the update Flow will automatically restart.
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
index 9d9d50902..db0327111 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
@@ -131,16 +131,17 @@ namespace Flow.Launcher.Plugin.PluginsManager
Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_downloading_plugin"),
Context.API.GetTranslation("plugin_pluginsmanager_download_success"));
+
+ Install(plugin, filePath);
}
catch (Exception e)
{
- Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_download_error_title"),
- string.Format(Context.API.GetTranslation("plugin_pluginsmanager_download_error_subtitle"), plugin.Name));
+ Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_install_error_title"),
+ string.Format(Context.API.GetTranslation("plugin_pluginsmanager_install_error_subtitle"), plugin.Name));
- Log.Exception("PluginsManager", "An error occured while downloading plugin", e, "PluginDownload");
+ Log.Exception("PluginsManager", "An error occured while downloading plugin", e, "InstallOrUpdate");
}
- Install(plugin, filePath);
Context.API.RestartApp();
}
From 878f7bf5dfb154a2bf663deaf9256ce73ba3de1d Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Fri, 1 Jan 2021 19:49:19 +1100
Subject: [PATCH 51/95] version bump for PluginsManager
---
Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json b/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json
index d94af71a1..7e78d65d6 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json
@@ -6,7 +6,7 @@
"Name": "Plugins Manager",
"Description": "Management of installing, uninstalling or updating Flow Launcher plugins",
"Author": "Jeremy Wu",
- "Version": "1.3.1",
+ "Version": "1.3.2",
"Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.PluginsManager.dll",
From 81cb20bf91edb292eb35445861a25acec31a2445 Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Fri, 1 Jan 2021 21:54:34 +1100
Subject: [PATCH 52/95] add return to continue
---
Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
index db0327111..880157a77 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
@@ -140,6 +140,8 @@ namespace Flow.Launcher.Plugin.PluginsManager
string.Format(Context.API.GetTranslation("plugin_pluginsmanager_install_error_subtitle"), plugin.Name));
Log.Exception("PluginsManager", "An error occured while downloading plugin", e, "InstallOrUpdate");
+
+ return;
}
Context.API.RestartApp();
From 6d66aa3f4415f114f44bb6b962651f5d269783f6 Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Sat, 2 Jan 2021 00:06:55 +1100
Subject: [PATCH 53/95] fix script to delete with condition dll version is same
---
Scripts/post_build.ps1 | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/Scripts/post_build.ps1 b/Scripts/post_build.ps1
index 59036842a..b20393b02 100644
--- a/Scripts/post_build.ps1
+++ b/Scripts/post_build.ps1
@@ -44,8 +44,9 @@ function Delete-Unused ($path, $config) {
$target = "$path\Output\$config"
$included = Get-ChildItem $target -Filter "*.dll"
foreach ($i in $included){
- Remove-Item -Path $target\Plugins -Include $i -Recurse
- Write-Host "Deleting duplicated $i"
+ $deleteList = Get-ChildItem $target\Plugins -Include $i -Recurse | Where {$_.VersionInfo.FileVersion -eq $i.VersionInfo.FileVersion}
+ $deleteList | foreach-object{ Write-Host Deleting duplicated $_.Name with version $_.VersionInfo.FileVersion at location $_.Directory.FullName }
+ $deleteList | Remove-Item
}
Remove-Item -Path $target -Include "*.xml" -Recurse
}
From 29a382085fde4f5ac5ea173b5ccf338258d0c029 Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Sat, 2 Jan 2021 00:09:02 +1100
Subject: [PATCH 54/95] method name update
---
Scripts/post_build.ps1 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Scripts/post_build.ps1 b/Scripts/post_build.ps1
index b20393b02..e0868f3bb 100644
--- a/Scripts/post_build.ps1
+++ b/Scripts/post_build.ps1
@@ -45,7 +45,7 @@ function Delete-Unused ($path, $config) {
$included = Get-ChildItem $target -Filter "*.dll"
foreach ($i in $included){
$deleteList = Get-ChildItem $target\Plugins -Include $i -Recurse | Where {$_.VersionInfo.FileVersion -eq $i.VersionInfo.FileVersion}
- $deleteList | foreach-object{ Write-Host Deleting duplicated $_.Name with version $_.VersionInfo.FileVersion at location $_.Directory.FullName }
+ $deleteList | ForEach-Object{ Write-Host Deleting duplicated $_.Name with version $_.VersionInfo.FileVersion at location $_.Directory.FullName }
$deleteList | Remove-Item
}
Remove-Item -Path $target -Include "*.xml" -Recurse
From f1badd6ae20466ab720b516d544a4b5f58b64dff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=A0=E5=BC=98=E9=9F=AC?=
Date: Fri, 1 Jan 2021 21:19:05 +0800
Subject: [PATCH 55/95] Add Exception Handling for Querying plugins results
---
Flow.Launcher/ViewModel/MainViewModel.cs | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs
index 7a3aa9f2f..2a69635bb 100644
--- a/Flow.Launcher/ViewModel/MainViewModel.cs
+++ b/Flow.Launcher/ViewModel/MainViewModel.cs
@@ -21,6 +21,7 @@ using Flow.Launcher.Plugin.SharedCommands;
using Flow.Launcher.Storage;
using System.Windows.Media;
using Flow.Launcher.Infrastructure.Image;
+using Flow.Launcher.Infrastructure.Logger;
namespace Flow.Launcher.ViewModel
{
@@ -414,8 +415,15 @@ namespace Flow.Launcher.ViewModel
{
if (!plugin.Metadata.Disabled)
{
- var results = PluginManager.QueryForPlugin(plugin, query);
- UpdateResultView(results, plugin.Metadata, query);
+ try
+ {
+ var results = PluginManager.QueryForPlugin(plugin, query);
+ UpdateResultView(results, plugin.Metadata, query);
+ }
+ catch(Exception e)
+ {
+ Log.Exception($"|MainViewModel|Exception when querying {plugin.Metadata.Name}", e);
+ }
}
});
}
@@ -432,7 +440,10 @@ namespace Flow.Launcher.ViewModel
{ // update to hidden if this is still the current query
ProgressBarVisibility = Visibility.Hidden;
}
- }, currentCancellationToken);
+ }, currentCancellationToken).ContinueWith(t =>
+ {
+ Log.Exception("|MainViewModel|Error when querying plugin", t.Exception?.InnerException);
+ }, TaskContinuationOptions.OnlyOnFaulted);
}
}
else
From f3355c525dfbdaa46ece70cb5197826c1bf354e9 Mon Sep 17 00:00:00 2001
From: Ioannis G
Date: Fri, 1 Jan 2021 23:15:37 +0200
Subject: [PATCH 56/95] fix: properly include all plugin translation files
---
...low.Launcher.Plugin.BrowserBookmark.csproj | 9 +---
.../Flow.Launcher.Plugin.Calculator.csproj | 44 +-----------------
.../Flow.Launcher.Plugin.ControlPanel.csproj | 45 +------------------
.../Flow.Launcher.Plugin.Explorer.csproj | 32 +------------
...low.Launcher.Plugin.PluginIndicator.csproj | 42 +----------------
.../Flow.Launcher.Plugin.ProcessKiller.csproj | 2 +-
.../Flow.Launcher.Plugin.Program.csproj | 27 +----------
.../Flow.Launcher.Plugin.Shell.csproj | 39 ++--------------
.../Flow.Launcher.Plugin.Sys.csproj | 27 +----------
.../Flow.Launcher.Plugin.Url.csproj | 36 +--------------
.../Flow.Launcher.Plugin.WebSearch.csproj | 27 +----------
11 files changed, 17 insertions(+), 313 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj
index 85b745a6b..f308aa49a 100644
--- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj
+++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj
@@ -43,11 +43,6 @@
Always
-
- Designer
- MSBuild:Compile
- PreserveNewest
-
Always
@@ -60,9 +55,9 @@
-
+
-
+
MSBuild:Compile
Designer
PreserveNewest
diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj b/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj
index 9e1fefdb3..983ac160e 100644
--- a/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj
+++ b/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj
@@ -49,49 +49,9 @@
PreserveNewest
-
+
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
-
-
+
MSBuild:Compile
Designer
PreserveNewest
diff --git a/Plugins/Flow.Launcher.Plugin.ControlPanel/Flow.Launcher.Plugin.ControlPanel.csproj b/Plugins/Flow.Launcher.Plugin.ControlPanel/Flow.Launcher.Plugin.ControlPanel.csproj
index 699737634..dce54cb52 100644
--- a/Plugins/Flow.Launcher.Plugin.ControlPanel/Flow.Launcher.Plugin.ControlPanel.csproj
+++ b/Plugins/Flow.Launcher.Plugin.ControlPanel/Flow.Launcher.Plugin.ControlPanel.csproj
@@ -48,50 +48,7 @@
PreserveNewest
-
-
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
-
-
+
MSBuild:Compile
Designer
PreserveNewest
diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj b/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj
index a1a08843a..a9f675be8 100644
--- a/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj
+++ b/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj
@@ -62,37 +62,7 @@
PreserveNewest
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
+
MSBuild:Compile
Designer
PreserveNewest
diff --git a/Plugins/Flow.Launcher.Plugin.PluginIndicator/Flow.Launcher.Plugin.PluginIndicator.csproj b/Plugins/Flow.Launcher.Plugin.PluginIndicator/Flow.Launcher.Plugin.PluginIndicator.csproj
index e6bfa7aa3..6abfc8469 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginIndicator/Flow.Launcher.Plugin.PluginIndicator.csproj
+++ b/Plugins/Flow.Launcher.Plugin.PluginIndicator/Flow.Launcher.Plugin.PluginIndicator.csproj
@@ -52,47 +52,7 @@
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
-
-
+
MSBuild:Compile
Designer
PreserveNewest
diff --git a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Flow.Launcher.Plugin.ProcessKiller.csproj b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Flow.Launcher.Plugin.ProcessKiller.csproj
index cf9c96294..a393d8510 100644
--- a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Flow.Launcher.Plugin.ProcessKiller.csproj
+++ b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Flow.Launcher.Plugin.ProcessKiller.csproj
@@ -39,7 +39,7 @@
PreserveNewest
-
+
Designer
MSBuild:Compile
PreserveNewest
diff --git a/Plugins/Flow.Launcher.Plugin.Program/Flow.Launcher.Plugin.Program.csproj b/Plugins/Flow.Launcher.Plugin.Program/Flow.Launcher.Plugin.Program.csproj
index 3802297c7..7e1b36fc1 100644
--- a/Plugins/Flow.Launcher.Plugin.Program/Flow.Launcher.Plugin.Program.csproj
+++ b/Plugins/Flow.Launcher.Plugin.Program/Flow.Launcher.Plugin.Program.csproj
@@ -68,35 +68,10 @@
Always
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
+
MSBuild:Compile
Designer
PreserveNewest
diff --git a/Plugins/Flow.Launcher.Plugin.Shell/Flow.Launcher.Plugin.Shell.csproj b/Plugins/Flow.Launcher.Plugin.Shell/Flow.Launcher.Plugin.Shell.csproj
index 178d95010..316742bf6 100644
--- a/Plugins/Flow.Launcher.Plugin.Shell/Flow.Launcher.Plugin.Shell.csproj
+++ b/Plugins/Flow.Launcher.Plugin.Shell/Flow.Launcher.Plugin.Shell.csproj
@@ -33,32 +33,6 @@
4
false
-
-
-
- Always
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
@@ -72,18 +46,13 @@
+
+ Always
+
PreserveNewest
-
-
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
+
MSBuild:Compile
Designer
PreserveNewest
diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Flow.Launcher.Plugin.Sys.csproj b/Plugins/Flow.Launcher.Plugin.Sys/Flow.Launcher.Plugin.Sys.csproj
index bdab40457..61635dd08 100644
--- a/Plugins/Flow.Launcher.Plugin.Sys/Flow.Launcher.Plugin.Sys.csproj
+++ b/Plugins/Flow.Launcher.Plugin.Sys/Flow.Launcher.Plugin.Sys.csproj
@@ -52,32 +52,7 @@
PreserveNewest
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
+
MSBuild:Compile
Designer
PreserveNewest
diff --git a/Plugins/Flow.Launcher.Plugin.Url/Flow.Launcher.Plugin.Url.csproj b/Plugins/Flow.Launcher.Plugin.Url/Flow.Launcher.Plugin.Url.csproj
index 7d802d815..fb40c1e17 100644
--- a/Plugins/Flow.Launcher.Plugin.Url/Flow.Launcher.Plugin.Url.csproj
+++ b/Plugins/Flow.Launcher.Plugin.Url/Flow.Launcher.Plugin.Url.csproj
@@ -50,41 +50,9 @@
PreserveNewest
-
+
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
-
-
-
+
MSBuild:Compile
Designer
PreserveNewest
diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Flow.Launcher.Plugin.WebSearch.csproj b/Plugins/Flow.Launcher.Plugin.WebSearch/Flow.Launcher.Plugin.WebSearch.csproj
index 431ca9ce8..e3bb4b408 100644
--- a/Plugins/Flow.Launcher.Plugin.WebSearch/Flow.Launcher.Plugin.WebSearch.csproj
+++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Flow.Launcher.Plugin.WebSearch.csproj
@@ -89,32 +89,7 @@
PreserveNewest
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
+
MSBuild:Compile
Designer
PreserveNewest
From 8ab528c380acd0515b6576e74f76300763bd3bd6 Mon Sep 17 00:00:00 2001
From: Ioannis G
Date: Sat, 2 Jan 2021 00:00:12 +0200
Subject: [PATCH 57/95] fix slovak translation
---
Flow.Launcher/Languages/sk.xaml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Flow.Launcher/Languages/sk.xaml b/Flow.Launcher/Languages/sk.xaml
index bf001d507..85fc1462c 100644
--- a/Flow.Launcher/Languages/sk.xaml
+++ b/Flow.Launcher/Languages/sk.xaml
@@ -45,8 +45,8 @@
Nová akcia skratky:
Priečinok s pluginmi
Autor
- Príprava: {0}ms
- Čas dopytu: {0}ms
+ Príprava:
+ Čas dopytu:
Motív
From 75f5a81a31ead865464f6a11f61f4c8fcf8d7cb6 Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Sat, 2 Jan 2021 11:55:06 +1100
Subject: [PATCH 58/95] update exception message
---
Flow.Launcher/ViewModel/MainViewModel.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs
index 2a69635bb..eed30f377 100644
--- a/Flow.Launcher/ViewModel/MainViewModel.cs
+++ b/Flow.Launcher/ViewModel/MainViewModel.cs
@@ -422,7 +422,7 @@ namespace Flow.Launcher.ViewModel
}
catch(Exception e)
{
- Log.Exception($"|MainViewModel|Exception when querying {plugin.Metadata.Name}", e);
+ Log.Exception("MainViewModel", $"Exception when querying the plugin {plugin.Metadata.Name}", e, "QueryResults");
}
}
});
@@ -442,7 +442,7 @@ namespace Flow.Launcher.ViewModel
}
}, currentCancellationToken).ContinueWith(t =>
{
- Log.Exception("|MainViewModel|Error when querying plugin", t.Exception?.InnerException);
+ Log.Exception("MainViewModel", "Error when querying plugins", t.Exception?.InnerException, "QueryResults");
}, TaskContinuationOptions.OnlyOnFaulted);
}
}
From 041bf4e9c4860b9114a95741fcb036d2f969d208 Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Sat, 2 Jan 2021 12:10:06 +1100
Subject: [PATCH 59/95] add condition to match name also
---
Scripts/post_build.ps1 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Scripts/post_build.ps1 b/Scripts/post_build.ps1
index e0868f3bb..836e27380 100644
--- a/Scripts/post_build.ps1
+++ b/Scripts/post_build.ps1
@@ -44,7 +44,7 @@ function Delete-Unused ($path, $config) {
$target = "$path\Output\$config"
$included = Get-ChildItem $target -Filter "*.dll"
foreach ($i in $included){
- $deleteList = Get-ChildItem $target\Plugins -Include $i -Recurse | Where {$_.VersionInfo.FileVersion -eq $i.VersionInfo.FileVersion}
+ $deleteList = Get-ChildItem $target\Plugins -Include $i -Recurse | Where { $_.VersionInfo.FileVersion -eq $i.VersionInfo.FileVersion -And $_.Name -eq "$i" }
$deleteList | ForEach-Object{ Write-Host Deleting duplicated $_.Name with version $_.VersionInfo.FileVersion at location $_.Directory.FullName }
$deleteList | Remove-Item
}
From be1776fd2153f6bc9fbefbce71b313ea9ab9789e Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Sat, 2 Jan 2021 12:47:20 +1100
Subject: [PATCH 60/95] version bump for plugins
---
Plugins/Flow.Launcher.Plugin.BrowserBookmark/plugin.json | 2 +-
Plugins/Flow.Launcher.Plugin.Calculator/plugin.json | 2 +-
Plugins/Flow.Launcher.Plugin.ControlPanel/plugin.json | 2 +-
Plugins/Flow.Launcher.Plugin.Explorer/plugin.json | 2 +-
Plugins/Flow.Launcher.Plugin.PluginIndicator/plugin.json | 2 +-
.../Flow.Launcher.Plugin.PluginsManager.csproj | 2 +-
Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json | 2 +-
Plugins/Flow.Launcher.Plugin.ProcessKiller/plugin.json | 2 +-
Plugins/Flow.Launcher.Plugin.Program/plugin.json | 2 +-
Plugins/Flow.Launcher.Plugin.Shell/plugin.json | 2 +-
Plugins/Flow.Launcher.Plugin.Sys/plugin.json | 2 +-
Plugins/Flow.Launcher.Plugin.Url/plugin.json | 2 +-
Plugins/Flow.Launcher.Plugin.WebSearch/plugin.json | 2 +-
13 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/plugin.json b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/plugin.json
index de4f3849b..b0c3d2e29 100644
--- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/plugin.json
+++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/plugin.json
@@ -4,7 +4,7 @@
"Name": "Browser Bookmarks",
"Description": "Search your browser bookmarks",
"Author": "qianlifeng, Ioannis G.",
- "Version": "1.3.1",
+ "Version": "1.3.2",
"Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.BrowserBookmark.dll",
diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json b/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json
index 709757d1a..7d9ca58d5 100644
--- a/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json
+++ b/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json
@@ -4,7 +4,7 @@
"Name": "Calculator",
"Description": "Provide mathematical calculations.(Try 5*3-2 in Flow Launcher)",
"Author": "cxfksword",
- "Version": "1.1.3",
+ "Version": "1.1.4",
"Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.Caculator.dll",
diff --git a/Plugins/Flow.Launcher.Plugin.ControlPanel/plugin.json b/Plugins/Flow.Launcher.Plugin.ControlPanel/plugin.json
index 4f552a014..23f35e9ac 100644
--- a/Plugins/Flow.Launcher.Plugin.ControlPanel/plugin.json
+++ b/Plugins/Flow.Launcher.Plugin.ControlPanel/plugin.json
@@ -4,7 +4,7 @@
"Name": "Control Panel",
"Description": "Search within the Control Panel.",
"Author": "CoenraadS",
- "Version": "1.1.1",
+ "Version": "1.1.2",
"Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.ControlPanel.dll",
diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/plugin.json b/Plugins/Flow.Launcher.Plugin.Explorer/plugin.json
index 2c57ac668..aa44c4413 100644
--- a/Plugins/Flow.Launcher.Plugin.Explorer/plugin.json
+++ b/Plugins/Flow.Launcher.Plugin.Explorer/plugin.json
@@ -7,7 +7,7 @@
"Name": "Explorer",
"Description": "Search and manage files and folders. Explorer utilises Windows Index Search",
"Author": "Jeremy Wu",
- "Version": "1.2.5",
+ "Version": "1.2.6",
"Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.Explorer.dll",
diff --git a/Plugins/Flow.Launcher.Plugin.PluginIndicator/plugin.json b/Plugins/Flow.Launcher.Plugin.PluginIndicator/plugin.json
index 80900a445..7f73263a8 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginIndicator/plugin.json
+++ b/Plugins/Flow.Launcher.Plugin.PluginIndicator/plugin.json
@@ -4,7 +4,7 @@
"Name": "Plugin Indicator",
"Description": "Provide plugin actionword suggestion",
"Author": "qianlifeng",
- "Version": "1.1.1",
+ "Version": "1.1.2",
"Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.PluginIndicator.dll",
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Flow.Launcher.Plugin.PluginsManager.csproj b/Plugins/Flow.Launcher.Plugin.PluginsManager/Flow.Launcher.Plugin.PluginsManager.csproj
index cc1a931ce..7beb8308b 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Flow.Launcher.Plugin.PluginsManager.csproj
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Flow.Launcher.Plugin.PluginsManager.csproj
@@ -35,7 +35,7 @@
-
+
PreserveNewest
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json b/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json
index d94af71a1..7e78d65d6 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json
@@ -6,7 +6,7 @@
"Name": "Plugins Manager",
"Description": "Management of installing, uninstalling or updating Flow Launcher plugins",
"Author": "Jeremy Wu",
- "Version": "1.3.1",
+ "Version": "1.3.2",
"Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.PluginsManager.dll",
diff --git a/Plugins/Flow.Launcher.Plugin.ProcessKiller/plugin.json b/Plugins/Flow.Launcher.Plugin.ProcessKiller/plugin.json
index d769397a8..2bb40c644 100644
--- a/Plugins/Flow.Launcher.Plugin.ProcessKiller/plugin.json
+++ b/Plugins/Flow.Launcher.Plugin.ProcessKiller/plugin.json
@@ -4,7 +4,7 @@
"Name":"Process Killer",
"Description":"kill running processes from Flow",
"Author":"Flow-Launcher",
- "Version":"1.2.1",
+ "Version":"1.2.2",
"Language":"csharp",
"Website":"https://github.com/Flow-Launcher/Flow.Launcher.Plugin.ProcessKiller",
"IcoPath":"Images\\app.png",
diff --git a/Plugins/Flow.Launcher.Plugin.Program/plugin.json b/Plugins/Flow.Launcher.Plugin.Program/plugin.json
index 7d7a42e03..6c2c18e47 100644
--- a/Plugins/Flow.Launcher.Plugin.Program/plugin.json
+++ b/Plugins/Flow.Launcher.Plugin.Program/plugin.json
@@ -4,7 +4,7 @@
"Name": "Program",
"Description": "Search programs in Flow.Launcher",
"Author": "qianlifeng",
- "Version": "1.2.2",
+ "Version": "1.2.3",
"Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.Program.dll",
diff --git a/Plugins/Flow.Launcher.Plugin.Shell/plugin.json b/Plugins/Flow.Launcher.Plugin.Shell/plugin.json
index 63e74d678..4ad572cf6 100644
--- a/Plugins/Flow.Launcher.Plugin.Shell/plugin.json
+++ b/Plugins/Flow.Launcher.Plugin.Shell/plugin.json
@@ -4,7 +4,7 @@
"Name": "Shell",
"Description": "Provide executing commands from Flow Launcher. Commands should start with >",
"Author": "qianlifeng",
- "Version": "1.1.1",
+ "Version": "1.1.2",
"Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.Shell.dll",
diff --git a/Plugins/Flow.Launcher.Plugin.Sys/plugin.json b/Plugins/Flow.Launcher.Plugin.Sys/plugin.json
index 8d4b9a238..cf8ed6041 100644
--- a/Plugins/Flow.Launcher.Plugin.Sys/plugin.json
+++ b/Plugins/Flow.Launcher.Plugin.Sys/plugin.json
@@ -4,7 +4,7 @@
"Name": "System Commands",
"Description": "Provide System related commands. e.g. shutdown,lock,setting etc.",
"Author": "qianlifeng",
- "Version": "1.1.1",
+ "Version": "1.1.2",
"Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.Sys.dll",
diff --git a/Plugins/Flow.Launcher.Plugin.Url/plugin.json b/Plugins/Flow.Launcher.Plugin.Url/plugin.json
index be64f6708..89dc20a33 100644
--- a/Plugins/Flow.Launcher.Plugin.Url/plugin.json
+++ b/Plugins/Flow.Launcher.Plugin.Url/plugin.json
@@ -4,7 +4,7 @@
"Name": "URL",
"Description": "Open the typed URL from Flow Launcher",
"Author": "qianlifeng",
- "Version": "1.1.1",
+ "Version": "1.1.2",
"Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.Url.dll",
diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/plugin.json b/Plugins/Flow.Launcher.Plugin.WebSearch/plugin.json
index 99fd2210a..c036fbf8b 100644
--- a/Plugins/Flow.Launcher.Plugin.WebSearch/plugin.json
+++ b/Plugins/Flow.Launcher.Plugin.WebSearch/plugin.json
@@ -25,7 +25,7 @@
"Name": "Web Searches",
"Description": "Provide the web search ability",
"Author": "qianlifeng",
- "Version": "1.2.0",
+ "Version": "1.2.1",
"Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.WebSearch.dll",
From 08f97f0ef9236e4572d7a707741488cddb568d38 Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Sat, 2 Jan 2021 12:57:13 +1100
Subject: [PATCH 61/95] change csproj images folder to use wildcard
---
...low.Launcher.Plugin.BrowserBookmark.csproj | 6 +-
.../Flow.Launcher.Plugin.Calculator.csproj | 9 +--
.../Flow.Launcher.Plugin.ControlPanel.csproj | 4 +-
.../Flow.Launcher.Plugin.Explorer.csproj | 35 +----------
...low.Launcher.Plugin.PluginIndicator.csproj | 9 +--
...Flow.Launcher.Plugin.PluginsManager.csproj | 9 +--
.../Flow.Launcher.Plugin.ProcessKiller.csproj | 6 +-
.../Flow.Launcher.Plugin.Program.csproj | 21 +------
.../Flow.Launcher.Plugin.Shell.csproj | 9 +--
.../Flow.Launcher.Plugin.Sys.csproj | 50 +--------------
.../Flow.Launcher.Plugin.Url.csproj | 9 +--
.../Flow.Launcher.Plugin.WebSearch.csproj | 63 +------------------
12 files changed, 33 insertions(+), 197 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj
index f308aa49a..d2a8736a6 100644
--- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj
+++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj
@@ -40,9 +40,6 @@
-
- Always
-
Always
@@ -62,6 +59,9 @@
Designer
PreserveNewest
+
+ PreserveNewest
+
diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj b/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj
index 983ac160e..06d8dea7d 100644
--- a/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj
+++ b/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj
@@ -43,12 +43,6 @@
-
-
-
- PreserveNewest
-
-
@@ -56,6 +50,9 @@
Designer
PreserveNewest
+
+ PreserveNewest
+
diff --git a/Plugins/Flow.Launcher.Plugin.ControlPanel/Flow.Launcher.Plugin.ControlPanel.csproj b/Plugins/Flow.Launcher.Plugin.ControlPanel/Flow.Launcher.Plugin.ControlPanel.csproj
index dce54cb52..06969a135 100644
--- a/Plugins/Flow.Launcher.Plugin.ControlPanel/Flow.Launcher.Plugin.ControlPanel.csproj
+++ b/Plugins/Flow.Launcher.Plugin.ControlPanel/Flow.Launcher.Plugin.ControlPanel.csproj
@@ -45,9 +45,9 @@
-
+
PreserveNewest
-
+
MSBuild:Compile
Designer
diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj b/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj
index a9f675be8..9d9c09a93 100644
--- a/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj
+++ b/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj
@@ -26,42 +26,9 @@
-
- PreserveNewest
-
-
-
- PreserveNewest
-
-
-
- PreserveNewest
-
-
-
- PreserveNewest
-
-
-
- Always
-
-
-
+
PreserveNewest
-
-
- PreserveNewest
-
-
-
- PreserveNewest
-
-
-
- PreserveNewest
-
-
MSBuild:Compile
Designer
diff --git a/Plugins/Flow.Launcher.Plugin.PluginIndicator/Flow.Launcher.Plugin.PluginIndicator.csproj b/Plugins/Flow.Launcher.Plugin.PluginIndicator/Flow.Launcher.Plugin.PluginIndicator.csproj
index 6abfc8469..0140444e1 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginIndicator/Flow.Launcher.Plugin.PluginIndicator.csproj
+++ b/Plugins/Flow.Launcher.Plugin.PluginIndicator/Flow.Launcher.Plugin.PluginIndicator.csproj
@@ -45,18 +45,15 @@
-
-
- PreserveNewest
-
-
-
MSBuild:Compile
Designer
PreserveNewest
+
+ PreserveNewest
+
\ No newline at end of file
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Flow.Launcher.Plugin.PluginsManager.csproj b/Plugins/Flow.Launcher.Plugin.PluginsManager/Flow.Launcher.Plugin.PluginsManager.csproj
index 7beb8308b..2e352d832 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Flow.Launcher.Plugin.PluginsManager.csproj
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Flow.Launcher.Plugin.PluginsManager.csproj
@@ -27,17 +27,14 @@
PreserveNewest
-
-
-
- PreserveNewest
-
-
PreserveNewest
+
+ PreserveNewest
+
diff --git a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Flow.Launcher.Plugin.ProcessKiller.csproj b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Flow.Launcher.Plugin.ProcessKiller.csproj
index a393d8510..a643ebf86 100644
--- a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Flow.Launcher.Plugin.ProcessKiller.csproj
+++ b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Flow.Launcher.Plugin.ProcessKiller.csproj
@@ -36,14 +36,14 @@
-
- PreserveNewest
-
Designer
MSBuild:Compile
PreserveNewest
+
+ PreserveNewest
+
Always
diff --git a/Plugins/Flow.Launcher.Plugin.Program/Flow.Launcher.Plugin.Program.csproj b/Plugins/Flow.Launcher.Plugin.Program/Flow.Launcher.Plugin.Program.csproj
index 7e1b36fc1..12e113855 100644
--- a/Plugins/Flow.Launcher.Plugin.Program/Flow.Launcher.Plugin.Program.csproj
+++ b/Plugins/Flow.Launcher.Plugin.Program/Flow.Launcher.Plugin.Program.csproj
@@ -52,30 +52,15 @@
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- Always
-
-
-
MSBuild:Compile
Designer
PreserveNewest
+
+ PreserveNewest
+
diff --git a/Plugins/Flow.Launcher.Plugin.Shell/Flow.Launcher.Plugin.Shell.csproj b/Plugins/Flow.Launcher.Plugin.Shell/Flow.Launcher.Plugin.Shell.csproj
index 316742bf6..c542dc89b 100644
--- a/Plugins/Flow.Launcher.Plugin.Shell/Flow.Launcher.Plugin.Shell.csproj
+++ b/Plugins/Flow.Launcher.Plugin.Shell/Flow.Launcher.Plugin.Shell.csproj
@@ -46,17 +46,14 @@
-
- Always
-
-
- PreserveNewest
-
MSBuild:Compile
Designer
PreserveNewest
+
+ PreserveNewest
+
MSBuild:Compile
Designer
diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Flow.Launcher.Plugin.Sys.csproj b/Plugins/Flow.Launcher.Plugin.Sys/Flow.Launcher.Plugin.Sys.csproj
index 61635dd08..8ef4dc0fb 100644
--- a/Plugins/Flow.Launcher.Plugin.Sys/Flow.Launcher.Plugin.Sys.csproj
+++ b/Plugins/Flow.Launcher.Plugin.Sys/Flow.Launcher.Plugin.Sys.csproj
@@ -40,23 +40,14 @@
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
MSBuild:Compile
Designer
PreserveNewest
+
+ PreserveNewest
+
MSBuild:Compile
Designer
@@ -68,39 +59,4 @@
PreserveNewest
-
-
-
- PreserveNewest
-
-
-
-
-
- PreserveNewest
-
-
-
-
-
- PreserveNewest
-
-
-
-
-
- PreserveNewest
-
-
-
-
-
- PreserveNewest
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Plugins/Flow.Launcher.Plugin.Url/Flow.Launcher.Plugin.Url.csproj b/Plugins/Flow.Launcher.Plugin.Url/Flow.Launcher.Plugin.Url.csproj
index fb40c1e17..671a8b1c2 100644
--- a/Plugins/Flow.Launcher.Plugin.Url/Flow.Launcher.Plugin.Url.csproj
+++ b/Plugins/Flow.Launcher.Plugin.Url/Flow.Launcher.Plugin.Url.csproj
@@ -44,12 +44,6 @@
-
-
-
- PreserveNewest
-
-
@@ -57,6 +51,9 @@
Designer
PreserveNewest
+
+ PreserveNewest
+
\ No newline at end of file
diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Flow.Launcher.Plugin.WebSearch.csproj b/Plugins/Flow.Launcher.Plugin.WebSearch/Flow.Launcher.Plugin.WebSearch.csproj
index e3bb4b408..af86af842 100644
--- a/Plugins/Flow.Launcher.Plugin.WebSearch/Flow.Launcher.Plugin.WebSearch.csproj
+++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Flow.Launcher.Plugin.WebSearch.csproj
@@ -35,65 +35,14 @@
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
MSBuild:Compile
Designer
PreserveNewest
+
+ PreserveNewest
+
MSBuild:Compile
Designer
@@ -109,12 +58,6 @@
PreserveNewest
-
-
-
- PreserveNewest
-
-
From 482988c288392af9b1bf2a911a6eb798c54f11ff Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Sat, 2 Jan 2021 12:59:58 +1100
Subject: [PATCH 62/95] use wild card to include images for main project
---
Flow.Launcher/Flow.Launcher.csproj | 108 +----------------------------
1 file changed, 3 insertions(+), 105 deletions(-)
diff --git a/Flow.Launcher/Flow.Launcher.csproj b/Flow.Launcher/Flow.Launcher.csproj
index 8548ba39e..39b2087aa 100644
--- a/Flow.Launcher/Flow.Launcher.csproj
+++ b/Flow.Launcher/Flow.Launcher.csproj
@@ -60,6 +60,9 @@
Designer
PreserveNewest
+
+ PreserveNewest
+
@@ -87,111 +90,6 @@
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
-
From 97ac42751717121f5db1c695b81d5aed98df191f Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Sat, 2 Jan 2021 16:58:23 +1100
Subject: [PATCH 63/95] add manual reload of PluginsManifest data
---
Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
index d700b9dfd..7c1eda3aa 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
@@ -10,7 +10,7 @@ using System.Threading.Tasks;
namespace Flow.Launcher.Plugin.PluginsManager
{
- public class Main : ISettingProvider, IPlugin, ISavable, IContextMenu, IPluginI18n
+ public class Main : ISettingProvider, IPlugin, ISavable, IContextMenu, IPluginI18n, IReloadable
{
internal PluginInitContext Context { get; set; }
@@ -87,5 +87,14 @@ namespace Flow.Launcher.Plugin.PluginsManager
{
return Context.API.GetTranslation("plugin_pluginsmanager_plugin_description");
}
+
+ public void ReloadData()
+ {
+ Task.Run(async () =>
+ {
+ await pluginManager.UpdateManifest();
+ lastUpdateTime = DateTime.Now;
+ });
+ }
}
}
From 661c64b1c21b5e744ac4029b68e70d095a2074e2 Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Sat, 2 Jan 2021 17:00:10 +1100
Subject: [PATCH 64/95] version bump for PluginsManager
---
Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json b/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json
index 7e78d65d6..f5bbf3f6b 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json
@@ -6,7 +6,7 @@
"Name": "Plugins Manager",
"Description": "Management of installing, uninstalling or updating Flow Launcher plugins",
"Author": "Jeremy Wu",
- "Version": "1.3.2",
+ "Version": "1.4.0",
"Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.PluginsManager.dll",
From b4b30dd34da9426a6f512966fca780c5d5ef1437 Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Sat, 2 Jan 2021 18:06:44 +1100
Subject: [PATCH 65/95] wait manifest update before proceeding
---
Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
index 7c1eda3aa..f10f022d7 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs
@@ -90,11 +90,8 @@ namespace Flow.Launcher.Plugin.PluginsManager
public void ReloadData()
{
- Task.Run(async () =>
- {
- await pluginManager.UpdateManifest();
- lastUpdateTime = DateTime.Now;
- });
+ Task.Run(() => pluginManager.UpdateManifest()).Wait();
+ lastUpdateTime = DateTime.Now;
}
}
}
From d369108b0b17d05c300919d7f20e296c5322b731 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Sun, 3 Jan 2021 20:40:18 +0800
Subject: [PATCH 66/95] Error handling for plugin update
---
.../PluginsManager.cs | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
index 880157a77..4debf5598 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
@@ -214,11 +214,19 @@ namespace Flow.Launcher.Plugin.PluginsManager
Task.Run(async delegate
{
+ Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_downloading_plugin"),
+ Context.API.GetTranslation("plugin_pluginsmanager_please_wait"));
+
await Http.Download(x.PluginNewUserPlugin.UrlDownload, downloadToFilePath).ConfigureAwait(false);
+
+ Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_downloading_plugin"),
+ Context.API.GetTranslation("plugin_pluginsmanager_download_success"));
+
Install(x.PluginNewUserPlugin, downloadToFilePath);
Context.API.RestartApp();
- });
+ }).ContinueWith(t => Log.Exception($"|PluginsManager|Update fail for {x.Name}", t.Exception.InnerException),
+ TaskContinuationOptions.OnlyOnFaulted);
return true;
}
From 8fa1e2e33f4355766282ca6934e3a279b8a3b8be Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Sun, 3 Jan 2021 20:49:14 +0800
Subject: [PATCH 67/95] add one more message
---
.../Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
index 4debf5598..9cef704a6 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
@@ -225,8 +225,12 @@ namespace Flow.Launcher.Plugin.PluginsManager
Install(x.PluginNewUserPlugin, downloadToFilePath);
Context.API.RestartApp();
- }).ContinueWith(t => Log.Exception($"|PluginsManager|Update fail for {x.Name}", t.Exception.InnerException),
- TaskContinuationOptions.OnlyOnFaulted);
+ }).ContinueWith(t =>
+ {
+ Log.Exception($"|PluginsManager|Update fail for {x.Name}", t.Exception.InnerException);
+ Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_install_error_title"),
+ string.Format(Context.API.GetTranslation("plugin_pluginsmanager_install_error_subtitle"), x.Name));
+ }, TaskContinuationOptions.OnlyOnFaulted);
return true;
}
From d35a3bb43d05cf19b1fd46ef3577376941b7ed44 Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Mon, 4 Jan 2021 06:40:45 +1100
Subject: [PATCH 68/95] version bump for PluginsManager
---
Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json b/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json
index f5bbf3f6b..ef2c1255a 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json
@@ -6,7 +6,7 @@
"Name": "Plugins Manager",
"Description": "Management of installing, uninstalling or updating Flow Launcher plugins",
"Author": "Jeremy Wu",
- "Version": "1.4.0",
+ "Version": "1.4.1",
"Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.PluginsManager.dll",
From 6287358275e01457fabf0e2482343836a80bb9dd Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Mon, 4 Jan 2021 06:41:05 +1100
Subject: [PATCH 69/95] update error message
---
Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
index 9cef704a6..724ddf20d 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
@@ -227,7 +227,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
Context.API.RestartApp();
}).ContinueWith(t =>
{
- Log.Exception($"|PluginsManager|Update fail for {x.Name}", t.Exception.InnerException);
+ Log.Exception("PluginsManager", $"Update failed for {x.Name}", t.Exception.InnerException, "RequestUpdate");
Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_install_error_title"),
string.Format(Context.API.GetTranslation("plugin_pluginsmanager_install_error_subtitle"), x.Name));
}, TaskContinuationOptions.OnlyOnFaulted);
From a8dc1599d746d88c8ce28ac551abb0e02bf6a90d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Mon, 4 Jan 2021 10:28:33 +0800
Subject: [PATCH 70/95] Add Http Error Handling
---
Flow.Launcher.Infrastructure/Http/Http.cs | 44 +++++++++++++++++------
1 file changed, 33 insertions(+), 11 deletions(-)
diff --git a/Flow.Launcher.Infrastructure/Http/Http.cs b/Flow.Launcher.Infrastructure/Http/Http.cs
index 8e2832690..b796d807c 100644
--- a/Flow.Launcher.Infrastructure/Http/Http.cs
+++ b/Flow.Launcher.Infrastructure/Http/Http.cs
@@ -91,7 +91,7 @@ namespace Flow.Launcher.Infrastructure.Http
///
/// Asynchrously get the result as string from url.
- /// When supposing the result is long and large, try using GetStreamAsync to avoid reading as string
+ /// When supposing the result larger than 83kb, try using GetStreamAsync to avoid reading as string
///
///
///
@@ -101,19 +101,33 @@ namespace Flow.Launcher.Infrastructure.Http
return GetAsync(new Uri(url.Replace("#", "%23")));
}
+ ///
+ /// Asynchrously get the result as string from url.
+ /// When supposing the result larger than 83kb, try using GetStreamAsync to avoid reading as string
+ ///
+ ///
+ ///
public static async Task GetAsync([NotNull] Uri url)
{
Log.Debug($"|Http.Get|Url <{url}>");
- using var response = await client.GetAsync(url);
- var content = await response.Content.ReadAsStringAsync();
- if (response.StatusCode == HttpStatusCode.OK)
+ try
{
- return content;
+ using var response = await client.GetAsync(url);
+ var content = await response.Content.ReadAsStringAsync();
+ if (response.StatusCode == HttpStatusCode.OK)
+ {
+ return content;
+ }
+ else
+ {
+ throw new HttpRequestException(
+ $"Error code <{response.StatusCode}> with content <{content}> returned from <{url}>");
+ }
}
- else
+ catch (HttpRequestException e)
{
- throw new HttpRequestException(
- $"Error code <{response.StatusCode}> with content <{content}> returned from <{url}>");
+ Log.Exception("Infrastructure.Http", "Http Request Error", e, "GetAsync");
+ throw;
}
}
@@ -124,9 +138,17 @@ namespace Flow.Launcher.Infrastructure.Http
///
public static async Task GetStreamAsync([NotNull] string url)
{
- Log.Debug($"|Http.Get|Url <{url}>");
- var response = await client.GetAsync(url);
- return await response.Content.ReadAsStreamAsync();
+ try
+ {
+ Log.Debug($"|Http.Get|Url <{url}>");
+ var response = await client.GetAsync(url);
+ return await response.Content.ReadAsStreamAsync();
+ }
+ catch (HttpRequestException e)
+ {
+ Log.Exception("Infrastructure.Http", "Http Request Error", e, "GetStreamAsync");
+ throw;
+ }
}
}
}
From bc63b9ebfa100426176603ba6c7009b72dd3502e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Mon, 4 Jan 2021 10:31:05 +0800
Subject: [PATCH 71/95] Change Download to DownloadAsync Add error handling for
download as well
---
Flow.Launcher.Infrastructure/Http/Http.cs | 22 +++++++++++++------
.../PluginsManager.cs | 4 ++--
2 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/Flow.Launcher.Infrastructure/Http/Http.cs b/Flow.Launcher.Infrastructure/Http/Http.cs
index b796d807c..78fa099c9 100644
--- a/Flow.Launcher.Infrastructure/Http/Http.cs
+++ b/Flow.Launcher.Infrastructure/Http/Http.cs
@@ -75,17 +75,25 @@ namespace Flow.Launcher.Infrastructure.Http
};
}
- public static async Task Download([NotNull] string url, [NotNull] string filePath)
+ public static async Task DownloadAsync([NotNull] string url, [NotNull] string filePath)
{
- using var response = await client.GetAsync(url);
- if (response.StatusCode == HttpStatusCode.OK)
+ try
{
- await using var fileStream = new FileStream(filePath, FileMode.CreateNew);
- await response.Content.CopyToAsync(fileStream);
+ using var response = await client.GetAsync(url);
+ if (response.StatusCode == HttpStatusCode.OK)
+ {
+ await using var fileStream = new FileStream(filePath, FileMode.CreateNew);
+ await response.Content.CopyToAsync(fileStream);
+ }
+ else
+ {
+ throw new HttpRequestException($"Error code <{response.StatusCode}> returned from <{url}>");
+ }
}
- else
+ catch (HttpRequestException e)
{
- throw new HttpRequestException($"Error code <{response.StatusCode}> returned from <{url}>");
+ Log.Exception("Infrastructure.Http", "Http Request Error", e, "DownloadAsync");
+ throw;
}
}
diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
index 724ddf20d..68df5bc1f 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
@@ -127,7 +127,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_downloading_plugin"),
Context.API.GetTranslation("plugin_pluginsmanager_please_wait"));
- await Http.Download(plugin.UrlDownload, filePath).ConfigureAwait(false);
+ await Http.DownloadAsync(plugin.UrlDownload, filePath).ConfigureAwait(false);
Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_downloading_plugin"),
Context.API.GetTranslation("plugin_pluginsmanager_download_success"));
@@ -217,7 +217,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_downloading_plugin"),
Context.API.GetTranslation("plugin_pluginsmanager_please_wait"));
- await Http.Download(x.PluginNewUserPlugin.UrlDownload, downloadToFilePath).ConfigureAwait(false);
+ await Http.DownloadAsync(x.PluginNewUserPlugin.UrlDownload, downloadToFilePath).ConfigureAwait(false);
Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_downloading_plugin"),
Context.API.GetTranslation("plugin_pluginsmanager_download_success"));
From fb640b68c8e5a49e105e0666ce77e057c1a43735 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Mon, 4 Jan 2021 11:05:59 +0800
Subject: [PATCH 72/95] Use ValueTask instead of Task
---
Flow.Launcher/ViewModel/ResultViewModel.cs | 25 ++++++++++++++--------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/Flow.Launcher/ViewModel/ResultViewModel.cs b/Flow.Launcher/ViewModel/ResultViewModel.cs
index 00a0e1ae5..20d32890b 100644
--- a/Flow.Launcher/ViewModel/ResultViewModel.cs
+++ b/Flow.Launcher/ViewModel/ResultViewModel.cs
@@ -1,4 +1,5 @@
using System;
+using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
@@ -12,7 +13,7 @@ namespace Flow.Launcher.ViewModel
{
public class ResultViewModel : BaseModel
{
- public class LazyAsync : Lazy>
+ public class LazyAsync : Lazy>
{
private T defaultValue;
@@ -23,21 +24,27 @@ namespace Flow.Launcher.ViewModel
{
if (!IsValueCreated)
{
- base.Value.ContinueWith(_ =>
- {
- _updateCallback();
- });
+ _ = Exercute();
return defaultValue;
}
-
+
if (!base.Value.IsCompleted || base.Value.IsFaulted)
return defaultValue;
return base.Value.Result;
+
+ // If none of the variables captured by the local function are captured by other lambdas
+ // , the compiler can avoid heap allocations.
+ async ValueTask Exercute()
+ {
+ await base.Value.ConfigureAwait(false);
+ _updateCallback();
+ }
+
}
}
- public LazyAsync(Func> factory, T defaultValue, Action updateCallback) : base(factory)
+ public LazyAsync(Func> factory, T defaultValue, Action updateCallback) : base(factory)
{
if (defaultValue != null)
{
@@ -55,7 +62,7 @@ namespace Flow.Launcher.ViewModel
Result = result;
Image = new LazyAsync(
- SetImage,
+ SetImage,
ImageLoader.DefaultImage,
() =>
{
@@ -82,7 +89,7 @@ namespace Flow.Launcher.ViewModel
public LazyAsync Image { get; set; }
- private async Task SetImage()
+ private async ValueTask SetImage()
{
var imagePath = Result.IcoPath;
if (string.IsNullOrEmpty(imagePath) && Result.Icon != null)
From 7967844cf381563c362f2d91bcac73342b3f5237 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Mon, 4 Jan 2021 11:10:02 +0800
Subject: [PATCH 73/95] make defaultValue readonly and edit comment
---
Flow.Launcher/ViewModel/ResultViewModel.cs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Flow.Launcher/ViewModel/ResultViewModel.cs b/Flow.Launcher/ViewModel/ResultViewModel.cs
index 20d32890b..d1b03f911 100644
--- a/Flow.Launcher/ViewModel/ResultViewModel.cs
+++ b/Flow.Launcher/ViewModel/ResultViewModel.cs
@@ -15,7 +15,7 @@ namespace Flow.Launcher.ViewModel
{
public class LazyAsync : Lazy>
{
- private T defaultValue;
+ private readonly T defaultValue;
private readonly Action _updateCallback;
public new T Value
@@ -24,7 +24,7 @@ namespace Flow.Launcher.ViewModel
{
if (!IsValueCreated)
{
- _ = Exercute();
+ _ = Exercute(); // manually use callback strategy
return defaultValue;
}
@@ -34,8 +34,8 @@ namespace Flow.Launcher.ViewModel
return base.Value.Result;
- // If none of the variables captured by the local function are captured by other lambdas
- // , the compiler can avoid heap allocations.
+ // If none of the variables captured by the local function are captured by other lambdas,
+ // the compiler can avoid heap allocations.
async ValueTask Exercute()
{
await base.Value.ConfigureAwait(false);
From fc015245b3392664f4b630a6a10a68b85d05bc2d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Mon, 4 Jan 2021 16:22:48 +0800
Subject: [PATCH 74/95] Change the way checking successfuly
---
Flow.Launcher/ViewModel/ResultViewModel.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Flow.Launcher/ViewModel/ResultViewModel.cs b/Flow.Launcher/ViewModel/ResultViewModel.cs
index d1b03f911..9eece1a97 100644
--- a/Flow.Launcher/ViewModel/ResultViewModel.cs
+++ b/Flow.Launcher/ViewModel/ResultViewModel.cs
@@ -29,7 +29,7 @@ namespace Flow.Launcher.ViewModel
return defaultValue;
}
- if (!base.Value.IsCompleted || base.Value.IsFaulted)
+ if (!base.Value.IsCompletedSuccessfully)
return defaultValue;
return base.Value.Result;
From 6703e0d137b3fcd03c8fdb16644df7fa5645b24b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Mon, 4 Jan 2021 16:31:48 +0800
Subject: [PATCH 75/95] Return default image when loading UWP icon fail
---
Flow.Launcher/ViewModel/ResultViewModel.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Flow.Launcher/ViewModel/ResultViewModel.cs b/Flow.Launcher/ViewModel/ResultViewModel.cs
index 9eece1a97..4c65f2b9f 100644
--- a/Flow.Launcher/ViewModel/ResultViewModel.cs
+++ b/Flow.Launcher/ViewModel/ResultViewModel.cs
@@ -68,7 +68,7 @@ namespace Flow.Launcher.ViewModel
{
OnPropertyChanged(nameof(Image));
});
- }
+ }
Settings = settings;
}
@@ -101,7 +101,7 @@ namespace Flow.Launcher.ViewModel
catch (Exception e)
{
Log.Exception($"|ResultViewModel.Image|IcoPath is empty and exception when calling Icon() for result <{Result.Title}> of plugin <{Result.PluginDirectory}>", e);
- imagePath = Constant.MissingImgIcon;
+ return ImageLoader.DefaultImage;
}
}
From a2f741b376d5c00da6ad51e0d800e5f3ccf24d5c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Wed, 6 Jan 2021 09:59:20 +0800
Subject: [PATCH 76/95] change bitmap scaling mode to Fant (High Quality) to
make the search icon looks better.
---
Flow.Launcher/MainWindow.xaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml
index 07bb96339..b6782cb60 100644
--- a/Flow.Launcher/MainWindow.xaml
+++ b/Flow.Launcher/MainWindow.xaml
@@ -92,7 +92,7 @@
-
+
Date: Wed, 6 Jan 2021 10:34:08 +0800
Subject: [PATCH 77/95] Use SVG for search icon
---
Flow.Launcher.Infrastructure/Constant.cs | 2 +-
Flow.Launcher/Flow.Launcher.csproj | 1 +
Flow.Launcher/Images/mainsearch.svg | 10 ++++++++++
Flow.Launcher/MainWindow.xaml | 9 +++++----
Flow.Launcher/ViewModel/MainViewModel.cs | 2 +-
5 files changed, 18 insertions(+), 6 deletions(-)
create mode 100644 Flow.Launcher/Images/mainsearch.svg
diff --git a/Flow.Launcher.Infrastructure/Constant.cs b/Flow.Launcher.Infrastructure/Constant.cs
index 3dba35f8d..de6ed1b29 100644
--- a/Flow.Launcher.Infrastructure/Constant.cs
+++ b/Flow.Launcher.Infrastructure/Constant.cs
@@ -30,7 +30,7 @@ namespace Flow.Launcher.Infrastructure
public static string PythonPath;
- public static readonly string QueryTextBoxIconImagePath = $"{ProgramDirectory}\\Images\\mainsearch.png";
+ public static readonly string QueryTextBoxIconImagePath = $"{ProgramDirectory}\\Images\\mainsearch.svg";
public const string DefaultTheme = "Darker";
diff --git a/Flow.Launcher/Flow.Launcher.csproj b/Flow.Launcher/Flow.Launcher.csproj
index 39b2087aa..0f8e6a767 100644
--- a/Flow.Launcher/Flow.Launcher.csproj
+++ b/Flow.Launcher/Flow.Launcher.csproj
@@ -82,6 +82,7 @@
runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/Flow.Launcher/Images/mainsearch.svg b/Flow.Launcher/Images/mainsearch.svg
new file mode 100644
index 000000000..5d28abdb3
--- /dev/null
+++ b/Flow.Launcher/Images/mainsearch.svg
@@ -0,0 +1,10 @@
+
+
\ No newline at end of file
diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml
index b6782cb60..c9db58385 100644
--- a/Flow.Launcher/MainWindow.xaml
+++ b/Flow.Launcher/MainWindow.xaml
@@ -6,6 +6,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:converters="clr-namespace:Flow.Launcher.Converters"
+ xmlns:svgc="http://sharpvectors.codeplex.com/svgc/"
mc:Ignorable="d"
Title="Flow Launcher"
Topmost="True"
@@ -68,8 +69,8 @@
Margin="18,0,56,0">
-
-
+
+
@@ -81,7 +82,7 @@
AllowDrop="True"
Visibility="Visible"
Background="Transparent"
- Margin="18,0,56,0">
+ Margin="18,1,0,1" HorizontalAlignment="Left" Width="660">
@@ -92,7 +93,7 @@
-
+
ImageLoader.Load(Constant.QueryTextBoxIconImagePath);
+ public string Image => Constant.QueryTextBoxIconImagePath;
#endregion
From 0dd6a982ad93affc9cc2d3aae8dd7a4ba31bc176 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Wed, 6 Jan 2021 15:51:52 +0800
Subject: [PATCH 78/95] change setting window to svg as well
---
Flow.Launcher/SettingWindow.xaml | 3 ++-
Flow.Launcher/ViewModel/SettingWindowViewModel.cs | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml
index e47f0e779..121b062ee 100644
--- a/Flow.Launcher/SettingWindow.xaml
+++ b/Flow.Launcher/SettingWindow.xaml
@@ -8,6 +8,7 @@
xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:ui="http://schemas.modernwpf.com/2019"
+ xmlns:svgc="http://sharpvectors.codeplex.com/svgc/"
x:Class="Flow.Launcher.SettingWindow"
mc:Ignorable="d"
Icon="Images\app.png"
@@ -252,7 +253,7 @@
Text="{DynamicResource hiThere}" IsReadOnly="True"
Style="{DynamicResource QueryBoxStyle}"
Margin="18 0 56 0" />
-
+
diff --git a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs
index c122f8037..c43167e09 100644
--- a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs
+++ b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs
@@ -438,7 +438,7 @@ namespace Flow.Launcher.ViewModel
}
}
- public ImageSource ThemeImage => ImageLoader.Load(Constant.QueryTextBoxIconImagePath);
+ public string ThemeImage => Constant.QueryTextBoxIconImagePath;
#endregion
From 3bfd900f054687dee90a9c9670ff55e096000116 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?=
Date: Wed, 6 Jan 2021 16:10:52 +0800
Subject: [PATCH 79/95] revert change for oneway for mutli binding
---
Flow.Launcher/MainWindow.xaml | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml
index c9db58385..4373c0f0c 100644
--- a/Flow.Launcher/MainWindow.xaml
+++ b/Flow.Launcher/MainWindow.xaml
@@ -69,8 +69,8 @@
Margin="18,0,56,0">
-
-
+
+
@@ -93,7 +93,8 @@
-
+
Date: Wed, 6 Jan 2021 16:46:38 +0800
Subject: [PATCH 80/95] remove unintended change and change the binding mode to
default
---
Flow.Launcher/MainWindow.xaml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml
index 4373c0f0c..998bc3e9a 100644
--- a/Flow.Launcher/MainWindow.xaml
+++ b/Flow.Launcher/MainWindow.xaml
@@ -82,7 +82,7 @@
AllowDrop="True"
Visibility="Visible"
Background="Transparent"
- Margin="18,1,0,1" HorizontalAlignment="Left" Width="660">
+ Margin="18,0,56,0" HorizontalAlignment="Left" Width="660">
@@ -93,7 +93,7 @@
-
Date: Wed, 6 Jan 2021 17:05:10 +0800
Subject: [PATCH 81/95] remove png file
---
Flow.Launcher/Images/mainsearch.png | Bin 63073 -> 0 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
delete mode 100644 Flow.Launcher/Images/mainsearch.png
diff --git a/Flow.Launcher/Images/mainsearch.png b/Flow.Launcher/Images/mainsearch.png
deleted file mode 100644
index ac5492fa62dfa1d7bf207c60823b2f9fa6f4b622..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 63073
zcmeFZiCc~N|37}G)I{{2EQM%>Q#nMDRMKM1$T_Kq7A-mr329N3XgO(U42ru=dzK2V
zGL^KQ#*kB}nN&D!IH{z4-@lJnGxPf&e%JMJUGHn&SLeQ8%k%YI9?!?~`MNLfH8ET;
zZ}~imq86}r|7b>05?u1XZ^ZEz)!Xdn_>ZLf?t`8bwQ&vkpUBx{eJ_d{Uc~xw$APo&
zzc%{ZjCa~GGgIYvl)jW_U{g^t?^pWABm2CP4Mgtzo)_(N^zTT6pRPUrc;TbvVu{6b
z>$AR_WaKQK$55}@V`iQ7)k5Upkwq~gH~dmJxZJXdjP{(FKGu81;QLAyC!gX>=gdoo
z+)wo#-R7Avpgl6cz-s>Q-~UPA|0M8#68Qh01pLx=QYqa6P^{G_pa!?yU>$1;X~=@|{p*pMtg(iL#0?%c_Yp_@G;&9xn;pRh{$x&pEU
zUES-GZD&@_)Hyq6NU)ifQD#d|WHf(0y=`LY(xsX9gye0}$*?HAYl^FO54Xm8?gaL!OZy)AxG$xvI+ovsZ=Ol5}l_xufE
z4XgQ^SRuw9wsfvv!bh8+{%JB7dDG0%*l2WAzu*v%J4^V`yZ
znc6#d?pWr#6gGP=A+uf*aw$w&Z
zHHvDstl6@L&-&b=X3HLH
z$e)fA4q&4LSFT*KKPK?nr-awJO+QoOl$^V9O@j)5+`6+-C;oM#bB4ERe@2#$^1(YY
zhV2g+1FYe2Grh(xFMT`q*lBvkBkeeOwbp^W`ahezlLb%z_~Vb_um*L$t`T!&v@S8M
zVbAv#)q#veqkg{I%$L*K6iP>md#0lA-@l*vBi^MdpW-yD4P#Q4b$Au(TeA-~cbwiT
zd>&T3!sFA6LW}Rmc|Xuq%F$W5-K@>_>~~>DN?ZghghXmu+r&8(ch!-0$8VNhB7cbF
z;*2;E8pi6h(C|dYNayKoBWbx!s{AQB?%qP-C5FQNT>pFF{kKd~2X4hSem$z7+fy_!
z%ofGFy^TbA>+ci{L;swsz
zWn2*|lAmH68&dFWgX^hM>rT`L6=k^y+;)?R
zq!!_OIl4FE+{-n-4ns)t@R~IpUumO3;gVGDhu=g-40=8#$Dky*Y!7V~){
zYt;?m_Y$RBpL?En*z229H=cm)Czw@~nwXmQ@UP{ElS$fjh%9^hmft@fGZAHGl98*o
zoo}jCkfEZsCDW+C+pMCHE*gk&&h#mNCTm}0N+gh^AjcKq-Wthh8}S#kOe8V#EyT6j
z#~BI_a!Vf7bQBG}Jsj$n+V&0Eb#VnwSt^;&=b!g3Y~0Ug>f1T{{YVSa=E&c6ri<=`
z_q!#B2XuKA&is|vbz22*7^tdIqSQ`@%E%4ghiq*dPWOiQtO<)tpO^ik>+b$cvkDvM
z3^y0Sa8RF=10Lr@ki`U^9`8tP_U(F~tG}PEt--&~>du^({X>Zbdo16&(?(WSR`q?Z
zbG;>lsEfsK5UkwIdJU-jOp9c5jmIZXUqeR`i-Ve)ditXou#k*;ThCWI8%st%`sLsa
zs`44OF_=+fqSN*EaESKjP08Vj#{F*@-uvgapR$ZJYqD_mBNnj2tEb5?n!r4s*=B6R
zFZpLS@^#K{L}To
zqm(AuVtUNOhYuB2E?f4_%-Mxbw-jr+?psoKZU-~DG27v3sj0E?8AT$(lG%svr5sza(KO+*E>g9dk?W7O+|?n3%IR}=j>iPoTF07I9B29Omf~
z4K-+q=PSp#|FI(9t=Zo|1`o^WVQZX&TZ{+RB!@pbk@1POb?uz&+a+;FEa{Fsm*$AO
zY_g}PWmu<5G|{M9>#EFL6GlP)YD)J*C+jmE=OzWE=9W1@oFNsTU&XrVZ`(Hhr*-F|
zPthe*aW}+2|3pUHt5>i5b}uATZpV}@+3~X`rlJxTc9+$Eow3rK8h`D}Ox}}O}k`rNv_y79kpKA|s&$fwA@8Dohy+Y|S(-$e>CS%lZnyMJ~s3^Njy5Z6zU;$%d<+?
zyK$)AUjLA@p9j6aNC{r&>;2r4qVWETJQvj{V#nu#G|!80e!Y6_T4QQW$K*Ns5#3<>
zEfr~?$rl(gtH_{sar21q%^fLmu88-4@iO7&5gS@!?Hu0b@gB1ZBWZc9Ub?Z+JHU>}
z-^vH_m)lF?hXB?C_s|B{vzkgz@=Fe%A2#{)<;$0aLOjTgI7~+Ud&{fc8D~71jyANR
zV#mEXymb=>bXR9x#`&SKw#0yVc|4k31mUYuueICaY~;1vInEhFmSHFNig8yB=2~|e
z88KB|1;YbGQoMe68UqDLs^M*y*UWePAL+x3MUtdXhZPlv_fJMgN7pOfC#S^w8>eKT
zFg=}c^X6IKjG+$JDkTZZ@9QGgq3|Q;1$mmY2V_`<1M>SBt10hlEF6iVAteP1F|LS*
zPsWgAa=7g8E)$AGms(yRf+Ur@yvu2Q4IpK@K6yKnzhQ|8hufu^T;z4?RG(Yh=g&>+
zCGf1g9*$`6USD5dFd$ZQW^TfbBiB|_QqkVE)-$)lbJAP{Kh2I=4gE|i-?L{=+_~Pd
zlF;G8yG3PvDV?^Mi(?$2CC|yoXigCGoz+|5(tA7Qn`~EkSZ&W2D^B`BR
z)J3qq6;E<|UST_Fh>JFnX8x&leb}_kx;a#^O90)0pc7S7Q=@9(6r}V_foP%PYGR8Ksu&v1g2O<{Zi}
zBUZQoURN8>_1wU7TnAV%cS-e@SGr-7{5v6-tRO|sG7aMa
zE@MB-|8QZGGUTOh0r4k5tC~*dFhT_e0?+l$Y0v?_E^xV=I
zj&ODn|HC3$*6uMe(R(cDnm#C1N>!U~%*dTS!)&c}5p1l$B6#0HdwAc0H<$jlsFYIMJ^aQxQA0;Zz{VH`rEsLP
zVLc%^y!2jfh+@auIh1HeBWv1JkT=86LTz*Ttk>JTd2@tNmQLR%MqT>Drm(SF
z;U)2T^YGaCHAKIXVD;BppMLr4ufOzFk|%f3pB5va*KA0B39Y*4A}}TEHYkO8@bZtx
zd_I~S-uxhUdIudw9`pW=Ux|R4>ecmrXbI81_A}xfYPUxPGxciIcwN4~2koR(aA!5e
z^M0IJHy#QVuPSc2Fh4Vroa`aE2Tr>&^wipUDwd(2DNgl@`sRlBzqIbGe4l4WG>Ur&
z*3LP04bCPD&c>KFye~q@r_5yL>K*p-%8Ni4;2r{M<+N`x_KY&CXntc|PM=;ZLWTTM
zikQ|M8yh=ueKA%xI0uKg^V49BY3Uf^KOE=SD@HjqQ{{#=JKE05YIMr3(96$+n1)4|
zh#WVt9v+6a-_xJU>Q4HG%HETim0QA@nVzaD=>21U)~s&Uaxin!wb0N+GxnH(F=8o7
zS$%JB(x1*ybpfWH9g8Moo$l2xtxC%^8TXT*(&-T>U~_arf`2GkS^8qPUq#jSF4Suq
zsWM`g#t@@6kUrap7~pnR4@m*F9{!%kn>1OWpwMj19;-b2T9v9kpQ)NWIiyiBN0cPtU|iBF|)4W>U`{==Jc|cLPSOgb1M*dF(_$#!w=gS#?Y>Y&|>MJThAa
zEGh^1C;n9Bx3r?iB
zo8iG1liqYH{HYfcPiV{pERid7>5D=MXJ`g7*3~?q!dqS$Eq1?owz^)S!f@l=&l{
zfzN`_t5=J@M*FqyR~MV#W%qkA%jqMV$Znw7{n8LM0sFBi?gwIk?=*}b>1ig6`(XI?^
z4wi46v+G-myX47R)nov}vD}q9Ubav&ig(>^5u4(9xPOtQIJJJa!u!J!GBtNYernqh
zgH`VDH_>(+tjjMMstKE9k=ROEooQ1Z>&kP<3Wv^ddf_~+HUoug^3&*(dqt_FRNF)B
zcU#rfJp;)~f)Iju`$)e3uV@aQ!dyvF@ufgK_NB8HNybsbI9lrtA3p5eb9!5wvd=wi
z%J0LY*Ib+BTntf8>RZ1irgoKpmpfm7N
z-Ax0i(UkSP7QW3{0m+H!O?Z@FXU8E{>97o1>&t9aWVxo{APnBxu%oR@{io~+K5oTO
z?QS@Yh5WhiF+cH
zTJ=Vweqo-Ay(&)CAOK*_JuD?9W!u2OKvjC~^gdbxW+`=TpgzN9Bn_Zv`ivQ79F&EX
zH1Dt3l5f;s!3fo#LtKX!8qJY(4qd
z%in+6kKmy}31zOxsDg1#`ac0ob1DR;ASm*3aQGnW-P1I6hFIIVSj`cU-84LJ6(ft)
zA9eycw65h_=F*>$
z8*IAs9zWKK6^h{1Y^jn1?C3azroP9>=2I9WP*AR;#}$TY!{bw*
zrghH`PZkorNqZ{E;fibpPgOAZx6#b)@O}yZ&!SZJg^jyCTuI(W=5t&oN{Jt+*`lnd
ztS!_Z=$pLae5j8hp5Wv^EYx%*4C+AX}p@uX;SIK!_U*9W4^VXM>
zX==8-ddHg9=0C)Gt3^*_3}wyw=Gm~rZG~ye{SW77+<$=~cmpX&6sxmp^13XOF@P2F
zE3QcPzuxHgStmm2el=ok&3Bp5BPSPG{;L=@h1_$~=nuG_tom4N*|SM34k
zwv!y4iZ1kI{4EiCgxT~a{wA^(r@X|oA1{|aB3`KG$q3jcIwG^5jqN6yLfBEud
zWg|Ei_rYBZs$Kfir%yKYOT~f+oV3)aPmTBb`s7UKYtx*AP{T_vl0lD!HiIr`
zyNiuzAxGq{%7xf;u3f!q8!jxtcGZ3(2V$c&E7gsd%;>C;eKaCA55>*GPN;&lnhRkc$j7qoBWHy}cEC%n^FsqEx(|AMGMIw2?eBa+DIc
za)fL*vtothV0hAl_o2R{B#$H#oaMU+tQRQy_|X$-_*3xL9Dwvuum&?kS6c!)cT?Hh
zVp0m+XzAyp^YK9ER)nmT#x;8g7VRy)hTr=U`%Ib1wsFEbGRwEij5p^&OF9X9=pkCt
z@M1%fh{anR%Cg+LdPYI?a>@|-K$^6_UDy#fdIfE3!`80u^2*wntn$XXH2O#Y*wjox
z*CCL7Bc+EHN9B+owf~%X9UEa*=U3jmf|=ZKyY3u<-dk`Pgj5a+aNEL{WYsaWr(3FK
z7A^E&**WtA_YU}yIwX$aPy-5Qw?sovZ`wIIysdmCfNxC`!;(?(wWYo_w{ATU%n}L1
zhBPClWk6>Yau-W`@5VEh_NV{)seWW&rak3&-A2#?*?_u>;F~0K>lWb^@*g%+SxNhT
z-MLtXvclw(S7lkB{3?+|MIG`VYc&P0W3-g$&LvQIoQwWVCVTd5M+y~im%8+F0ZT7R
zI6paDRcXwZt^z4mxog+1Oe-s^$FuY>sA02}Pi9kc&C;<~VMfgS?$g`y!9@^m*p^-3
zN$V&Vbe5GSBrR1t(vaq@m-qzt_2Q
z|K0!s?(*qs>iuT`OkScoA#7Z2V8w
zSE9#fouJZA2GF6Op9hYJN|fro&+F2>>u`T%QT(8El-a85LJ^6XbES;(2cqdY&&(?F
zfRmzFFeNEb1VNeQKoiH9t!G#!2SlwLH2BJFW)B3W!0!KW@#014^Se~jIvPBy?7UxT
z)Sr}x6z%DWI%|cS!g3&M2`h&yKyQgaZx7*Wcu8;)DmUOSA6j>&g~{I$&z_?fD_p64
zHpjd1$r*)hGm`^ZVHXd1&t_|1Eb_;1m{o|fnbJo6y$z!$9qN^MIUpe2yu5~`BZ&P(
zYaRs4Q?n(Ebtw8s#&X_ft34jaGlm+GuIs{2_QV4jWi_1rA}ju3q(wmgz;bse1v3I9+WLl8i}dpKN2Ko+low55oJmFu7~8_4%b3Cg<_v(Y&mHsZNE*#GsD^?$p%Q_UW&noI)0vhuTweYVWXd^b$EhD#NsJ~Km#xzJ(
zB?GiVAy7>Xy?uz&7sxS%|{7#JZ(=6l?JNGo&DZwZ9#*G_^9jCX2X63rFJ&M-xMta{dLQe>W
z)rqjCUP4&kAT%7L=hNFQ7PJU_*YGbQs4bP1Z7#t9W*N;Xp3wn)mW}G1HPcarztUW!
zt=?O4HaqI0X8=oAKX*V^lx%$Rh;au;L-VT=k
zfhFJZQ$0ShTB=Cw8e9YUj+}abJauIu{2o@YYk}N}#0RC&=mK
z$*-_pr%1Ecd-@k;Mse=>ZFQAEY#(I09itk4fymmHPK@-FYVmj0g7+})?`F8r^NYvk
zKW%%dUR6|!C|(s|7Sk}gBm3}yz*_^k2smE`2M3d9WdMcg)s6EX@6go$eDm<3L}BV1
z?ybL!`!gFxi+UP&*|*rd-ahcs=2}QdLZt8|Bh)y@WQp8zdl*J&0<7gR&Ucnu@eO|T
zdRwOuHm<2$khol}_XHha3iSR6!JH}CI~8}nyPz|(bb7p;@eX9k7{l2-Fwol^nL-2B
z5B8`aMU&(YxDv9m8TD0~8*
z>SaSi!+GM!&c$o4r50|R`1;6nJ6yI+ScClnx!soGW=H9wqeqW^Zub1tVb4|kYs;%p
zhW12Dz3!60z`-G)g?54#ND|lXi1TE$K@B$y_cYH$GNccPidRfCveI%(ChvxsoU0k`
z5=if!qmoZR9jRm856@BLOa8_)C@4Zj%fr>xl`tX(S;%yD_O$Su^Pi~)IP87Ha7)Wg
z2za@v+_v|NW$Abgp
z$CH*w6Y=Xw%dN9~V_ii^p~vzDst}eJODSyf2U@{WY`n>lwd!47SJCVWz|-yQob|Mg
zXX@>40zVlve^J6X1DVCc@8{2!gJ`PQf5FyGn@+JahGglhirN-3?KUWK)*#b51azAe
z1?J}#7|vI;?M>kUjU-jSyzqWgtO0a|xi;7TA2S?&?@V}K4gS-`fhB_%8KK};W-YAv
z4@ycZK1eyhK34efgn|9RwaH&ia{Q*ohujipwOi^pR9&uvRQIIiQ@29DFp1@9jtG|jR
zbzSv1_^hT){R%v|i;YeA?^_v6F?IXEYd1`aQw!N
z(+A;~Vcl6k2%2+-OvkqIq0TDebCAzb>Fq<1y<&cSgjcj!I8SAoR)FTq%GaZs=FtW
z_T>s|T8WRGx7cDKH$oj5YII`aOo4T0B4dp86X#5=bt*W!#AGqdECaI904a>Gd%nQW
zi2hW|H6M7#2mpK06lF*7aHUB0Il@DnAO4EEm#Jz0cRz7z-&l8My?*_=gm4U;0-Smv
zT!koIq|4v%hHKteW>)bAGP3W{_NI!R5T$P=htGrw+id6m@!%fIzraNhMdGH4vg{Pk
z;3o1X?|i{jK0`T8WPP_jn;8HmXy8f1=yN4XHy!oqNVDmCb=$gQ{%6qu?k4@+yLT3|
z^FDqnG2Zkq@7