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;

Flow.Launcher.Infrastructure/StringMatcher.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,6 @@ public StringMatcher(IAlphabet alphabet = null)
2121

2222
public static StringMatcher Instance { get; internal set; }
2323

24-
[Obsolete("This method is obsolete and should not be used. Please use the static function StringMatcher.FuzzySearch")]
25-
public static int Score(string source, string target)
26-
{
27-
return FuzzySearch(target, source).Score;
28-
}
29-
30-
[Obsolete("This method is obsolete and should not be used. Please use the static function StringMatcher.FuzzySearch")]
31-
public static bool IsMatch(string source, string target)
32-
{
33-
return Score(source, target) > 0;
34-
}
35-
3624
public static MatchResult FuzzySearch(string query, string stringToCompare)
3725
{
3826
return Instance.FuzzyMatch(query, stringToCompare);
@@ -323,18 +311,6 @@ private int ScoreAfterSearchPrecisionFilter(int rawScore)
323311

324312
public class MatchOption
325313
{
326-
/// <summary>
327-
/// prefix of match char, use for highlight
328-
/// </summary>
329-
[Obsolete("this is never used")]
330-
public string Prefix { get; set; } = "";
331-
332-
/// <summary>
333-
/// suffix of match char, use for highlight
334-
/// </summary>
335-
[Obsolete("this is never used")]
336-
public string Suffix { get; set; } = "";
337-
338314
public bool IgnoreCase { get; set; } = true;
339315
}
340316
}

Flow.Launcher.Infrastructure/UserSettings/DataLocation.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@ public static bool PortableDataLocationInUse()
3030
}
3131

3232
public static readonly string PluginsDirectory = Path.Combine(DataDirectory(), Constant.Plugins);
33+
public static readonly string PluginSettingsDirectory = Path.Combine(DataDirectory(), "Settings", Constant.Plugins);
3334
}
3435
}

Flow.Launcher.Infrastructure/UserSettings/PluginSettings.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ public void UpdatePluginSettings(List<PluginMetadata> metadatas)
1515
if (Plugins.ContainsKey(metadata.ID))
1616
{
1717
var settings = Plugins[metadata.ID];
18+
19+
// TODO: Remove. This is one off for 1.2.0 release.
20+
// Introduced a new action keyword in Explorer, so need to update plugin setting in the UserData folder.
21+
// This kind of plugin meta update should be handled by a dedicated method trigger by version bump.
22+
if (metadata.ID == "572be03c74c642baae319fc283e561a8" && metadata.ActionKeywords.Count != settings.ActionKeywords.Count)
23+
settings.ActionKeywords = metadata.ActionKeywords;
24+
25+
if (string.IsNullOrEmpty(settings.Version))
26+
settings.Version = metadata.Version;
27+
1828
if (settings.ActionKeywords?.Count > 0)
1929
{
2030
metadata.ActionKeywords = settings.ActionKeywords;
@@ -28,6 +38,7 @@ public void UpdatePluginSettings(List<PluginMetadata> metadatas)
2838
{
2939
ID = metadata.ID,
3040
Name = metadata.Name,
41+
Version = metadata.Version,
3142
ActionKeywords = metadata.ActionKeywords,
3243
Disabled = metadata.Disabled
3344
};
@@ -39,6 +50,7 @@ public class Plugin
3950
{
4051
public string ID { get; set; }
4152
public string Name { get; set; }
53+
public string Version { get; set; }
4254
public List<string> ActionKeywords { get; set; } // a reference of the action keywords from plugin manager
4355

4456
/// <summary>

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,6 @@ public string QuerySearchPrecisionString
7070
public PluginsSettings PluginSettings { get; set; } = new PluginsSettings();
7171
public ObservableCollection<CustomPluginHotkey> CustomPluginHotkeys { get; set; } = new ObservableCollection<CustomPluginHotkey>();
7272

73-
[Obsolete]
74-
public double Opacity { get; set; } = 1;
75-
76-
[Obsolete]
77-
public OpacityMode OpacityMode { get; set; } = OpacityMode.Normal;
78-
7973
public bool DontPromptUpdateMsg { get; set; }
8074
public bool EnableUpdateLog { get; set; }
8175

@@ -108,12 +102,4 @@ public enum LastQueryMode
108102
Empty,
109103
Preserved
110104
}
111-
112-
[Obsolete]
113-
public enum OpacityMode
114-
{
115-
Normal = 0,
116-
LayeredWindow = 1,
117-
DWM = 2
118-
}
119105
}

Flow.Launcher.Plugin/Feature.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,6 @@ public interface IContextMenu : IFeatures
1111
List<Result> LoadContextMenus(Result selectedResult);
1212
}
1313

14-
[Obsolete("If a plugin has a action keyword, then it is exclusive. This interface will be remove in v1.3.0")]
15-
public interface IExclusiveQuery : IFeatures
16-
{
17-
[Obsolete("If a plugin has a action keyword, then it is exclusive. This method will be remove in v1.3.0")]
18-
bool IsExclusiveQuery(Query query);
19-
}
20-
21-
/// <summary>
22-
/// Represent plugin query will be executed in UI thread directly. Don't do long-running operation in Query method if you implement this interface
23-
/// <remarks>This will improve the performance of instant search like websearch or cmd plugin</remarks>
24-
/// </summary>
25-
[Obsolete("Flow Launcher is fast enough now, executed on ui thread is no longer needed")]
26-
public interface IInstantQuery : IFeatures
27-
{
28-
bool IsInstantQuery(string query);
29-
}
30-
3114
/// <summary>
3215
/// Represent plugins that support internationalization
3316
/// </summary>

Flow.Launcher.Plugin/Features/IContextMenu.cs

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

Flow.Launcher.Plugin/Features/IExclusiveQuery.cs

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

Flow.Launcher.Plugin/Features/IInstantQuery.cs

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

Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
</PropertyGroup>
1515

1616
<PropertyGroup>
17-
<Version>1.1.0</Version>
18-
<PackageVersion>1.1.0</PackageVersion>
19-
<AssemblyVersion>1.1.0</AssemblyVersion>
20-
<FileVersion>1.1.0</FileVersion>
17+
<Version>1.2.0</Version>
18+
<PackageVersion>1.2.0</PackageVersion>
19+
<AssemblyVersion>1.2.0</AssemblyVersion>
20+
<FileVersion>1.2.0</FileVersion>
2121
<PackageId>Flow.Launcher.Plugin</PackageId>
2222
<Authors>Flow-Launcher</Authors>
2323
<PackageLicenseExpression>MIT</PackageLicenseExpression>

0 commit comments

Comments
 (0)