Skip to content

Commit 58f8aaa

Browse files
committed
Show message when failed to remove plugin settings & Improve code quality
1 parent 54a0f3d commit 58f8aaa

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

Flow.Launcher.Core/Plugin/PluginManager.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@ public static async Task InitializePluginsAsync(IPublicAPI api)
210210
{
211211
var failed = string.Join(",", failedPlugins.Select(x => x.Metadata.Name));
212212
API.ShowMsg(
213-
InternationalizationManager.Instance.GetTranslation("failedToInitializePluginsTitle"),
213+
API.GetTranslation("failedToInitializePluginsTitle"),
214214
string.Format(
215-
InternationalizationManager.Instance.GetTranslation("failedToInitializePluginsMessage"),
215+
API.GetTranslation("failedToInitializePluginsMessage"),
216216
failed
217217
),
218218
"",
@@ -568,6 +568,8 @@ internal static void UninstallPlugin(PluginMetadata plugin, bool removePluginFro
568568
catch (Exception e)
569569
{
570570
Log.Exception($"|PluginManager.UninstallPlugin|Failed to delete plugin json folder for {plugin.Name}", e);
571+
API.ShowMsg(API.GetTranslation("failedToRemovePluginSettingsTitle"),
572+
string.Format(API.GetTranslation("failedToRemovePluginSettingsMessage"), plugin.Name));
571573
}
572574
}
573575
}
@@ -583,6 +585,8 @@ internal static void UninstallPlugin(PluginMetadata plugin, bool removePluginFro
583585
catch (Exception e)
584586
{
585587
Log.Exception($"|PluginManager.UninstallPlugin|Failed to delete plugin json folder for {plugin.Name}", e);
588+
API.ShowMsg(API.GetTranslation("failedToRemovePluginSettingsTitle"),
589+
string.Format(API.GetTranslation("failedToRemovePluginSettingsMessage"), plugin.Name));
586590
}
587591
}
588592
}

Flow.Launcher/Languages/en.xaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@
128128
<system:String x:Key="plugin_query_version">Version</system:String>
129129
<system:String x:Key="plugin_query_web">Website</system:String>
130130
<system:String x:Key="plugin_uninstall">Uninstall</system:String>
131-
131+
<system:String x:Key="failedToRemovePluginSettingsTitle">Fail to remove plugin settings</system:String>
132+
<system:String x:Key="failedToRemovePluginSettingsMessage">Plugins: {0} - Fail to remove plugin settings files, please remove them manually</system:String>
132133

133134
<!-- Setting Plugin Store -->
134135
<system:String x:Key="pluginStore">Plugin Store</system:String>
@@ -145,8 +146,6 @@
145146
<system:String x:Key="LabelNewToolTip">This plugin has been updated within the last 7 days</system:String>
146147
<system:String x:Key="LabelUpdateToolTip">New Update is Available</system:String>
147148

148-
149-
150149
<!-- Setting Theme -->
151150
<system:String x:Key="theme">Theme</system:String>
152151
<system:String x:Key="appearance">Appearance</system:String>
@@ -196,7 +195,6 @@
196195
<system:String x:Key="TypeIsDarkToolTip">This theme supports two(light/dark) modes.</system:String>
197196
<system:String x:Key="TypeHasBlurToolTip">This theme supports Blur Transparent Background.</system:String>
198197

199-
200198
<!-- Setting Hotkey -->
201199
<system:String x:Key="hotkey">Hotkey</system:String>
202200
<system:String x:Key="hotkeys">Hotkeys</system:String>

0 commit comments

Comments
 (0)