Skip to content

Commit c9ca92e

Browse files
authored
Merge branch 'dev' into administrator_mode
2 parents 1cf0d44 + e730235 commit c9ca92e

File tree

14 files changed

+145
-51
lines changed

14 files changed

+145
-51
lines changed

Flow.Launcher.Core/ExternalPlugins/Environments/PythonEnvironment.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ namespace Flow.Launcher.Core.ExternalPlugins.Environments
1111
{
1212
internal class PythonEnvironment : AbstractPluginEnvironment
1313
{
14+
private static readonly string ClassName = nameof(PythonEnvironment);
15+
1416
internal override string Language => AllowedLanguage.Python;
1517

1618
internal override string EnvName => DataLocation.PythonEnvironmentName;
@@ -39,9 +41,20 @@ internal override void InstallEnvironment()
3941

4042
// Python 3.11.4 is no longer Windows 7 compatible. If user is on Win 7 and
4143
// uses Python plugin they need to custom install and use v3.8.9
42-
JTF.Run(() => DroplexPackage.Drop(App.python_3_11_4_embeddable, InstallPath));
44+
JTF.Run(async () =>
45+
{
46+
try
47+
{
48+
await DroplexPackage.Drop(App.python_3_11_4_embeddable, InstallPath);
4349

44-
PluginsSettingsFilePath = ExecutablePath;
50+
PluginsSettingsFilePath = ExecutablePath;
51+
}
52+
catch (System.Exception e)
53+
{
54+
API.ShowMsgError(API.GetTranslation("failToInstallPythonEnv"));
55+
API.LogException(ClassName, "Failed to install Python environment", e);
56+
}
57+
});
4558
}
4659

4760
internal override PluginPair CreatePluginPair(string filePath, PluginMetadata metadata)

Flow.Launcher.Core/ExternalPlugins/Environments/TypeScriptEnvironment.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ namespace Flow.Launcher.Core.ExternalPlugins.Environments
1111
{
1212
internal class TypeScriptEnvironment : AbstractPluginEnvironment
1313
{
14+
private static readonly string ClassName = nameof(TypeScriptEnvironment);
15+
1416
internal override string Language => AllowedLanguage.TypeScript;
1517

1618
internal override string EnvName => DataLocation.NodeEnvironmentName;
@@ -34,9 +36,20 @@ internal override void InstallEnvironment()
3436
{
3537
FilesFolders.RemoveFolderIfExists(InstallPath, (s) => API.ShowMsgBox(s));
3638

37-
JTF.Run(() => DroplexPackage.Drop(App.nodejs_16_18_0, InstallPath));
39+
JTF.Run(async () =>
40+
{
41+
try
42+
{
43+
await DroplexPackage.Drop(App.nodejs_16_18_0, InstallPath);
3844

39-
PluginsSettingsFilePath = ExecutablePath;
45+
PluginsSettingsFilePath = ExecutablePath;
46+
}
47+
catch (System.Exception e)
48+
{
49+
API.ShowMsgError(API.GetTranslation("failToInstallTypeScriptEnv"));
50+
API.LogException(ClassName, "Failed to install TypeScript environment", e);
51+
}
52+
});
4053
}
4154

4255
internal override PluginPair CreatePluginPair(string filePath, PluginMetadata metadata)

Flow.Launcher.Core/ExternalPlugins/Environments/TypeScriptV2Environment.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ namespace Flow.Launcher.Core.ExternalPlugins.Environments
1111
{
1212
internal class TypeScriptV2Environment : AbstractPluginEnvironment
1313
{
14+
private static readonly string ClassName = nameof(TypeScriptV2Environment);
15+
1416
internal override string Language => AllowedLanguage.TypeScriptV2;
1517

1618
internal override string EnvName => DataLocation.NodeEnvironmentName;
@@ -34,9 +36,20 @@ internal override void InstallEnvironment()
3436
{
3537
FilesFolders.RemoveFolderIfExists(InstallPath, (s) => API.ShowMsgBox(s));
3638

37-
JTF.Run(() => DroplexPackage.Drop(App.nodejs_16_18_0, InstallPath));
39+
JTF.Run(async () =>
40+
{
41+
try
42+
{
43+
await DroplexPackage.Drop(App.nodejs_16_18_0, InstallPath);
3844

39-
PluginsSettingsFilePath = ExecutablePath;
45+
PluginsSettingsFilePath = ExecutablePath;
46+
}
47+
catch (System.Exception e)
48+
{
49+
API.ShowMsgError(API.GetTranslation("failToInstallTypeScriptEnv"));
50+
API.LogException(ClassName, "Failed to install TypeScript environment", e);
51+
}
52+
});
4053
}
4154

4255
internal override PluginPair CreatePluginPair(string filePath, PluginMetadata metadata)

Flow.Launcher.Core/Plugin/PluginsLoader.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,9 @@ private static IEnumerable<PluginPair> DotNetPlugins(List<PluginMetadata> source
124124
API.GetTranslation("pluginsHaveErrored") :
125125
API.GetTranslation("pluginHasErrored");
126126

127-
_ = Task.Run(() =>
128-
{
129-
API.ShowMsgBox($"{errorMessage}{Environment.NewLine}{Environment.NewLine}" +
130-
$"{errorPluginString}{Environment.NewLine}{Environment.NewLine}" +
131-
API.GetTranslation("referToLogs"), string.Empty,
132-
MessageBoxButton.OK, MessageBoxImage.Warning);
133-
});
127+
API.ShowMsgError($"{errorMessage}{Environment.NewLine}{Environment.NewLine}" +
128+
$"{errorPluginString}{Environment.NewLine}{Environment.NewLine}" +
129+
API.GetTranslation("referToLogs"));
134130
}
135131

136132
return plugins;

Flow.Launcher.Core/Resource/AvailableLanguages.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ internal static class AvailableLanguages
1717
public static Language German = new Language("de", "Deutsch");
1818
public static Language Korean = new Language("ko", "한국어");
1919
public static Language Serbian = new Language("sr", "Srpski");
20+
public static Language Serbian_Cyrillic = new Language("sr-Cyrl-RS", "Српски");
2021
public static Language Portuguese_Portugal = new Language("pt-pt", "Português");
2122
public static Language Portuguese_Brazil = new Language("pt-br", "Português (Brasil)");
2223
public static Language Spanish = new Language("es", "Spanish");
@@ -47,6 +48,7 @@ public static List<Language> GetAvailableLanguages()
4748
German,
4849
Korean,
4950
Serbian,
51+
Serbian_Cyrillic,
5052
Portuguese_Portugal,
5153
Portuguese_Brazil,
5254
Spanish,
@@ -79,7 +81,8 @@ public static string GetSystemTranslation(string languageCode)
7981
"da" => "System",
8082
"de" => "System",
8183
"ko" => "시스템",
82-
"sr" => "Систем",
84+
"sr" => "Sistem",
85+
"sr-Cyrl-RS" => "Систем",
8386
"pt-pt" => "Sistema",
8487
"pt-br" => "Sistema",
8588
"es" => "Sistema",

Flow.Launcher.Core/packages.lock.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@
161161
},
162162
"Microsoft.Win32.SystemEvents": {
163163
"type": "Transitive",
164-
"resolved": "9.0.7",
165-
"contentHash": "lFGY2aGgmMREPJEfOmZcA6v0CLjWVpcfNHRgqYMoSQhy80+GxhYqdW5xe+DCLrVqE1M7/0RpOkIo49/KH/cd/A=="
164+
"resolved": "7.0.0",
165+
"contentHash": "2nXPrhdAyAzir0gLl8Yy8S5Mnm/uBSQQA7jEsILOS1MTyS7DbmV1NgViMtvV1sfCD1ebITpNwb1NIinKeJgUVQ=="
166166
},
167167
"Mono.Cecil": {
168168
"type": "Transitive",
@@ -222,10 +222,10 @@
222222
},
223223
"System.Drawing.Common": {
224224
"type": "Transitive",
225-
"resolved": "9.0.7",
226-
"contentHash": "1k/Pk7hcM3vP2tfIRRS2ECCCN7ya+hvocsM1JMc4ZDCU6qw7yOuUmqmCDfgXZ4Q4FS6jass2EAai5ByKodDi0g==",
225+
"resolved": "7.0.0",
226+
"contentHash": "KIX+oBU38pxkKPxvLcLfIkOV5Ien8ReN78wro7OF5/erwcmortzeFx+iBswlh2Vz6gVne0khocQudGwaO1Ey6A==",
227227
"dependencies": {
228-
"Microsoft.Win32.SystemEvents": "9.0.7"
228+
"Microsoft.Win32.SystemEvents": "7.0.0"
229229
}
230230
},
231231
"System.IO.Pipelines": {
@@ -262,7 +262,7 @@
262262
"NLog": "[6.0.1, )",
263263
"NLog.OutputDebugString": "[6.0.1, )",
264264
"SharpVectors.Wpf": "[1.8.4.2, )",
265-
"System.Drawing.Common": "[9.0.7, )",
265+
"System.Drawing.Common": "[7.0.0, )",
266266
"ToolGood.Words.Pinyin": "[3.1.0.3, )"
267267
}
268268
},

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@
7474
<PrivateAssets>all</PrivateAssets>
7575
</PackageReference>
7676
<PackageReference Include="SharpVectors.Wpf" Version="1.8.4.2" />
77-
<PackageReference Include="System.Drawing.Common" Version="9.0.7" />
77+
<!-- Do not upgrade this to higher version since it can cause this issue on WinForm platform: -->
78+
<!-- PlatformNotSupportedException: SystemEvents is not supported on this platform. -->
79+
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
7880
<PackageReference Include="ToolGood.Words.Pinyin" Version="3.1.0.3" />
7981
</ItemGroup>
8082

Flow.Launcher.Infrastructure/packages.lock.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@
108108
},
109109
"System.Drawing.Common": {
110110
"type": "Direct",
111-
"requested": "[9.0.7, )",
112-
"resolved": "9.0.7",
113-
"contentHash": "1k/Pk7hcM3vP2tfIRRS2ECCCN7ya+hvocsM1JMc4ZDCU6qw7yOuUmqmCDfgXZ4Q4FS6jass2EAai5ByKodDi0g==",
111+
"requested": "[7.0.0, )",
112+
"resolved": "7.0.0",
113+
"contentHash": "KIX+oBU38pxkKPxvLcLfIkOV5Ien8ReN78wro7OF5/erwcmortzeFx+iBswlh2Vz6gVne0khocQudGwaO1Ey6A==",
114114
"dependencies": {
115-
"Microsoft.Win32.SystemEvents": "9.0.7"
115+
"Microsoft.Win32.SystemEvents": "7.0.0"
116116
}
117117
},
118118
"ToolGood.Words.Pinyin": {
@@ -156,8 +156,8 @@
156156
},
157157
"Microsoft.Win32.SystemEvents": {
158158
"type": "Transitive",
159-
"resolved": "9.0.7",
160-
"contentHash": "lFGY2aGgmMREPJEfOmZcA6v0CLjWVpcfNHRgqYMoSQhy80+GxhYqdW5xe+DCLrVqE1M7/0RpOkIo49/KH/cd/A=="
159+
"resolved": "7.0.0",
160+
"contentHash": "2nXPrhdAyAzir0gLl8Yy8S5Mnm/uBSQQA7jEsILOS1MTyS7DbmV1NgViMtvV1sfCD1ebITpNwb1NIinKeJgUVQ=="
161161
},
162162
"Microsoft.Windows.SDK.Win32Docs": {
163163
"type": "Transitive",

Flow.Launcher.Plugin/Result.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ public string CopyText
5757
/// for user on the plugin result. If autocomplete action for example is tab, pressing tab will have
5858
/// the default constructed autocomplete text (result's Title), or the text provided here if not empty.
5959
/// </summary>
60-
/// <remarks>When a value is not set, the <see cref="Title"/> will be used.</remarks>
60+
/// <remarks>
61+
/// When a value is not set, the <see cref="Title"/> will be used.
62+
/// Please include the action keyword prefix when necessary because Flow does not prepend it automatically.
63+
/// </remarks>
6164
public string AutoCompleteText { get; set; }
6265

6366
/// <summary>
@@ -257,6 +260,17 @@ public string PluginDirectory
257260
/// </summary>
258261
public bool ShowBadge { get; set; } = false;
259262

263+
/// <summary>
264+
/// This holds the text which can be shown as a query suggestion.
265+
/// </summary>
266+
/// <remarks>
267+
/// When a value is not set, the <see cref="Title"/> will be used.
268+
/// Do not include the action keyword prefix because Flow prepends it automatically.
269+
/// If the it does not start with the query text, it will not be shown as a suggestion.
270+
/// So make sure to set this value to start with the query text.
271+
/// </remarks>
272+
public string QuerySuggestionText { get; set; }
273+
260274
/// <summary>
261275
/// Run this result, asynchronously
262276
/// </summary>
@@ -307,7 +321,8 @@ public Result Clone()
307321
Preview = Preview,
308322
AddSelectedCount = AddSelectedCount,
309323
RecordKey = RecordKey,
310-
ShowBadge = ShowBadge
324+
ShowBadge = ShowBadge,
325+
QuerySuggestionText = QuerySuggestionText
311326
};
312327
}
313328

Flow.Launcher/App.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ private static void AutoUpdates()
317317
});
318318
}
319319

320+
[Conditional("RELEASE")]
320321
private static void AutoPluginUpdates()
321322
{
322323
_ = Task.Run(async () =>

0 commit comments

Comments
 (0)