From 5bfdc583b12422c572934039eed60cadb0355df1 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Tue, 1 Jul 2025 13:18:26 +0800 Subject: [PATCH] Change the notification message title about plugin already installed/uninstalled from 'Fail to install ' to ' is already installed'. Do the same for uninstalling notification title. --- Flow.Launcher.Core/Plugin/PluginInstaller.cs | 6 +++--- Flow.Launcher.Core/Plugin/PluginManager.cs | 4 ++-- Flow.Launcher/Languages/en.xaml | 3 ++- .../Languages/en.xaml | 2 ++ .../PluginsManager.cs | 20 +++++++++++++------ 5 files changed, 23 insertions(+), 12 deletions(-) diff --git a/Flow.Launcher.Core/Plugin/PluginInstaller.cs b/Flow.Launcher.Core/Plugin/PluginInstaller.cs index e69dd58ab..6e2ff99ff 100644 --- a/Flow.Launcher.Core/Plugin/PluginInstaller.cs +++ b/Flow.Launcher.Core/Plugin/PluginInstaller.cs @@ -29,7 +29,7 @@ public static class PluginInstaller { if (API.PluginModified(newPlugin.ID)) { - API.ShowMsgError(string.Format(API.GetTranslation("failedToInstallPluginTitle"), newPlugin.Name), + API.ShowMsgError(string.Format(API.GetTranslation("pluginModifiedAlreadyTitle"), newPlugin.Name), API.GetTranslation("pluginModifiedAlreadyMessage")); return; } @@ -129,7 +129,7 @@ public static class PluginInstaller if (API.PluginModified(plugin.ID)) { - API.ShowMsgError(string.Format(API.GetTranslation("failedToInstallPluginTitle"), plugin.Name), + API.ShowMsgError(string.Format(API.GetTranslation("pluginModifiedAlreadyTitle"), plugin.Name), API.GetTranslation("pluginModifiedAlreadyMessage")); return; } @@ -151,7 +151,7 @@ public static class PluginInstaller { if (API.PluginModified(oldPlugin.ID)) { - API.ShowMsgError(string.Format(API.GetTranslation("failedToUninstallPluginTitle"), oldPlugin.Name), + API.ShowMsgError(string.Format(API.GetTranslation("pluginModifiedAlreadyTitle"), oldPlugin.Name), API.GetTranslation("pluginModifiedAlreadyMessage")); return; } diff --git a/Flow.Launcher.Core/Plugin/PluginManager.cs b/Flow.Launcher.Core/Plugin/PluginManager.cs index 4dae01e61..979d77df9 100644 --- a/Flow.Launcher.Core/Plugin/PluginManager.cs +++ b/Flow.Launcher.Core/Plugin/PluginManager.cs @@ -568,7 +568,7 @@ namespace Flow.Launcher.Core.Plugin { if (checkModified && PluginModified(plugin.ID)) { - API.ShowMsgError(string.Format(API.GetTranslation("failedToInstallPluginTitle"), plugin.Name), + API.ShowMsgError(string.Format(API.GetTranslation("pluginModifiedAlreadyTitle"), plugin.Name), API.GetTranslation("pluginModifiedAlreadyMessage")); return false; } @@ -649,7 +649,7 @@ namespace Flow.Launcher.Core.Plugin { if (checkModified && PluginModified(plugin.ID)) { - API.ShowMsgError(string.Format(API.GetTranslation("failedToUninstallPluginTitle"), plugin.Name), + API.ShowMsgError(string.Format(API.GetTranslation("pluginModifiedAlreadyTitle"), plugin.Name), API.GetTranslation("pluginModifiedAlreadyMessage")); return false; } diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 1cc03d6b1..c9ddfb91c 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -175,9 +175,10 @@ Plugins: {0} - Fail to remove plugin settings files, please remove them manually Fail to remove plugin cache Plugins: {0} - Fail to remove plugin cache files, please remove them manually + Plugin {0} is installed or uninstalled already + Please restart Flow before making any further changes Fail to install {0} Fail to uninstall {0} - This plugin has been installed or uninstalled already, please restart Flow Unable to find plugin.json from the extracted zip file, or this path {0} does not exist A plugin with the same ID and version already exists, or the version is greater than this downloaded plugin diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.PluginsManager/Languages/en.xaml index 742d5d8b9..ff2158f79 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Languages/en.xaml +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Languages/en.xaml @@ -45,6 +45,8 @@ Plugin {0} successfully updated. Please restart Flow. {0} plugins successfully updated. Please restart Flow. Plugin {0} has already been modified. Please restart Flow before making any further changes. + Plugin {0} has already been modified + Please restart Flow before making any further changes Invalid zip installer file Please check if there is a plugin.json in {0} diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs index 3d74e26f2..76d5eeafd 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs @@ -116,9 +116,9 @@ namespace Flow.Launcher.Plugin.PluginsManager if (Context.API.PluginModified(plugin.ID)) { - Context.API.ShowMsgError(Context.API.GetTranslation("plugin_pluginsmanager_install_error_title"), - string.Format(Context.API.GetTranslation("plugin_pluginsmanager_plugin_modified_error"), - plugin.Name)); + Context.API.ShowMsgError( + string.Format(Context.API.GetTranslation("plugin_pluginsmanager_plugin_modified_error_title"), plugin.Name), + Context.API.GetTranslation("plugin_pluginsmanager_plugin_modified_error_message")); return; } @@ -314,9 +314,9 @@ namespace Flow.Launcher.Plugin.PluginsManager { if (Context.API.PluginModified(x.ID)) { - Context.API.ShowMsgError(Context.API.GetTranslation("plugin_pluginsmanager_install_error_title"), - string.Format(Context.API.GetTranslation("plugin_pluginsmanager_plugin_modified_error"), - x.Name)); + Context.API.ShowMsgError( + string.Format(Context.API.GetTranslation("plugin_pluginsmanager_plugin_modified_error_title"), x.Name), + Context.API.GetTranslation("plugin_pluginsmanager_plugin_modified_error_message")); return false; } @@ -765,6 +765,14 @@ namespace Flow.Launcher.Plugin.PluginsManager IcoPath = x.Metadata.IcoPath, AsyncAction = async e => { + if (Context.API.PluginModified(x.Metadata.ID)) + { + Context.API.ShowMsgError( + string.Format(Context.API.GetTranslation("plugin_pluginsmanager_plugin_modified_error_title"), x.Metadata.Name), + Context.API.GetTranslation("plugin_pluginsmanager_plugin_modified_error_message")); + return false; + } + string message; if (Settings.AutoRestartAfterChanging) {