Skip to content

Commit a8bfe6e

Browse files
authored
Merge pull request #124 from Flow-Launcher/dev
Release 1.2.0 | Plugin 1.2.0
2 parents 8a9c338 + c6bee8a commit a8bfe6e

File tree

102 files changed

+690
-1686
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+690
-1686
lines changed

Flow.Launcher.Core/Plugin/QueryBuilder.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public static Query Build(string text, Dictionary<string, PluginPair> nonGlobalP
2929
else
3030
{ // non action keyword
3131
actionKeyword = string.Empty;
32-
actionParameters = terms.ToList();
3332
search = rawQuery;
3433
}
3534

@@ -38,10 +37,7 @@ public static Query Build(string text, Dictionary<string, PluginPair> nonGlobalP
3837
Terms = terms,
3938
RawQuery = rawQuery,
4039
ActionKeyword = actionKeyword,
41-
Search = search,
42-
// Obsolete value initialisation
43-
ActionName = actionKeyword,
44-
ActionParameters = actionParameters
40+
Search = search
4541
};
4642

4743
return query;

Flow.Launcher.Core/Updater.cs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
using Flow.Launcher.Infrastructure.Logger;
1717
using System.IO;
1818
using Flow.Launcher.Infrastructure.UserSettings;
19+
using Flow.Launcher.Plugin;
1920

2021
namespace Flow.Launcher.Core
2122
{
@@ -28,11 +29,14 @@ public Updater(string gitHubRepository)
2829
GitHubRepository = gitHubRepository;
2930
}
3031

31-
public async Task UpdateApp(bool silentIfLatestVersion = true)
32+
public async Task UpdateApp(IPublicAPI api , bool silentUpdate = true)
3233
{
3334
UpdateManager updateManager;
3435
UpdateInfo newUpdateInfo;
3536

37+
if (!silentUpdate)
38+
api.ShowMsg("Please wait...", "Checking for new update");
39+
3640
try
3741
{
3842
updateManager = await GitHubUpdateManager(GitHubRepository);
@@ -62,12 +66,15 @@ public async Task UpdateApp(bool silentIfLatestVersion = true)
6266

6367
if (newReleaseVersion <= currentVersion)
6468
{
65-
if (!silentIfLatestVersion)
69+
if (!silentUpdate)
6670
MessageBox.Show("You already have the latest Flow Launcher version");
6771
updateManager.Dispose();
6872
return;
6973
}
70-
74+
75+
if (!silentUpdate)
76+
api.ShowMsg("Update found", "Updating...");
77+
7178
try
7279
{
7380
await updateManager.DownloadReleases(newUpdateInfo.ReleasesToApply);
@@ -96,11 +103,15 @@ public async Task UpdateApp(bool silentIfLatestVersion = true)
96103

97104
var newVersionTips = NewVersinoTips(newReleaseVersion.ToString());
98105

99-
MessageBox.Show(newVersionTips);
100106
Log.Info($"|Updater.UpdateApp|Update success:{newVersionTips}");
101107

102108
// always dispose UpdateManager
103109
updateManager.Dispose();
110+
111+
if (MessageBox.Show(newVersionTips, "New Update", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
112+
{
113+
UpdateManager.RestartApp(Constant.ApplicationFileName);
114+
}
104115
}
105116

106117
[UsedImplicitly]

Flow.Launcher.Infrastructure/Alphabet.cs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -95,27 +95,6 @@ public void Save()
9595
private static string[] EmptyStringArray = new string[0];
9696
private static string[][] Empty2DStringArray = new string[0][];
9797

98-
[Obsolete("Not accurate, eg 音乐 will not return yinyue but returns yinle ")]
99-
/// <summary>
100-
/// replace chinese character with pinyin, non chinese character won't be modified
101-
/// <param name="word"> should be word or sentence, instead of single character. e.g. 微软 </param>
102-
/// </summary>
103-
public string[] Pinyin(string word)
104-
{
105-
if (!_settings.ShouldUsePinyin)
106-
{
107-
return EmptyStringArray;
108-
}
109-
110-
var pinyin = word.Select(c =>
111-
{
112-
var pinyins = PinyinHelper.toHanyuPinyinStringArray(c);
113-
var result = pinyins == null ? c.ToString() : pinyins[0];
114-
return result;
115-
}).ToArray();
116-
return pinyin;
117-
}
118-
11998
/// <summmary>
12099
/// replace chinese character with pinyin, non chinese character won't be modified
121100
/// Because we don't have words dictionary, so we can only return all possiblie pinyin combination

Flow.Launcher.Infrastructure/Constant.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ public static class Constant
2727
public static readonly string ErrorIcon = Path.Combine(ProgramDirectory, "Images", "app_error.png");
2828

2929
public static string PythonPath;
30-
public static string EverythingSDKPath;
3130

3231
public static readonly string QueryTextBoxIconImagePath = $"{ProgramDirectory}\\Images\\mainsearch.png";
3332

Flow.Launcher.Infrastructure/Exception/ExceptionFormatter.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ private static string CreateExceptionReport(System.Exception ex)
6767
sb.AppendLine($"* IntPtr Length: {IntPtr.Size}");
6868
sb.AppendLine($"* x64: {Environment.Is64BitOperatingSystem}");
6969
sb.AppendLine($"* Python Path: {Constant.PythonPath}");
70-
sb.AppendLine($"* Everything SDK Path: {Constant.EverythingSDKPath}");
7170
sb.AppendLine($"* CLR Version: {Environment.Version}");
7271
sb.AppendLine($"* Installed .NET Framework: ");
7372
foreach (var result in GetFrameworkVersionFromRegistry())

Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838

3939
<ItemGroup>
4040
<Compile Include="..\SolutionAssemblyInfo.cs" Link="Properties\SolutionAssemblyInfo.cs" />
41+
<None Include="FodyWeavers.xml" />
4142
</ItemGroup>
4243

4344
<ItemGroup>
@@ -55,6 +56,7 @@
5556
<PackageReference Include="Pinyin4DotNet" Version="2016.4.23.4" />
5657
<PackageReference Include="System.Drawing.Common" Version="4.7.0" />
5758
<PackageReference Include="System.Runtime" Version="4.3.1" />
59+
<PackageReference Include="PropertyChanged.Fody" Version="2.5.13" />
5860
</ItemGroup>
5961

6062
<ItemGroup>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
3+
<PropertyChanged />
4+
</Weavers>

Flow.Launcher.Infrastructure/FuzzyMatcher.cs

Lines changed: 0 additions & 32 deletions
This file was deleted.

Flow.Launcher.Infrastructure/Image/ImageLoader.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,8 @@ private static ImageResult GetThumbnailResult(ref string path, bool loadFullImag
156156
if (Directory.Exists(path))
157157
{
158158
/* Directories can also have thumbnails instead of shell icons.
159-
* Generating thumbnails for a bunch of folders while scrolling through
160-
* results from Everything makes a big impact on performance and
161-
* Flow.Launcher responsibility.
159+
* Generating thumbnails for a bunch of folder results while scrolling
160+
* could have a big impact on performance and Flow.Launcher responsibility.
162161
* - Solution: just load the icon
163162
*/
164163
type = ImageType.Folder;

0 commit comments

Comments
 (0)