From 1bb72869200565d955b8cc690242bae526ebe71c Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Tue, 1 Jul 2025 08:57:32 +0800 Subject: [PATCH] Show error message instead of message --- Flow.Launcher.Core/Plugin/PluginInstaller.cs | 6 +++--- Flow.Launcher.Core/Plugin/PluginManager.cs | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Flow.Launcher.Core/Plugin/PluginInstaller.cs b/Flow.Launcher.Core/Plugin/PluginInstaller.cs index 4cdab09f9..e39c24430 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.ShowMsg(string.Format(API.GetTranslation("failedToInstallPluginTitle"), newPlugin.Name), + API.ShowMsgError(string.Format(API.GetTranslation("failedToInstallPluginTitle"), newPlugin.Name), API.GetTranslation("pluginModifiedAlreadyMessage")); return; } @@ -126,7 +126,7 @@ public static class PluginInstaller if (API.PluginModified(plugin.ID)) { - API.ShowMsg(string.Format(API.GetTranslation("failedToInstallPluginTitle"), plugin.Name), + API.ShowMsgError(string.Format(API.GetTranslation("failedToInstallPluginTitle"), plugin.Name), API.GetTranslation("pluginModifiedAlreadyMessage")); return; } @@ -148,7 +148,7 @@ public static class PluginInstaller { if (API.PluginModified(oldPlugin.ID)) { - API.ShowMsg(string.Format(API.GetTranslation("failedToUninstallPluginTitle"), oldPlugin.Name), + API.ShowMsgError(string.Format(API.GetTranslation("failedToUninstallPluginTitle"), oldPlugin.Name), API.GetTranslation("pluginModifiedAlreadyMessage")); return; } diff --git a/Flow.Launcher.Core/Plugin/PluginManager.cs b/Flow.Launcher.Core/Plugin/PluginManager.cs index 5b74d80f0..5bff71007 100644 --- a/Flow.Launcher.Core/Plugin/PluginManager.cs +++ b/Flow.Launcher.Core/Plugin/PluginManager.cs @@ -566,7 +566,7 @@ namespace Flow.Launcher.Core.Plugin { if (checkModified && PluginModified(plugin.ID)) { - API.ShowMsg(string.Format(API.GetTranslation("failedToInstallPluginTitle"), plugin.Name), + API.ShowMsgError(string.Format(API.GetTranslation("failedToInstallPluginTitle"), plugin.Name), API.GetTranslation("pluginModifiedAlreadyMessage")); return false; } @@ -586,14 +586,14 @@ namespace Flow.Launcher.Core.Plugin if (string.IsNullOrEmpty(metadataJsonFilePath) || string.IsNullOrEmpty(pluginFolderPath)) { - API.ShowMsg(string.Format(API.GetTranslation("failedToInstallPluginTitle"), plugin.Name), + API.ShowMsgError(string.Format(API.GetTranslation("failedToInstallPluginTitle"), plugin.Name), string.Format(API.GetTranslation("fileNotFoundMessage"), pluginFolderPath)); return false; } if (SameOrLesserPluginVersionExists(metadataJsonFilePath)) { - API.ShowMsg(string.Format(API.GetTranslation("failedToInstallPluginTitle"), plugin.Name), + API.ShowMsgError(string.Format(API.GetTranslation("failedToInstallPluginTitle"), plugin.Name), API.GetTranslation("pluginExistAlreadyMessage")); return false; } @@ -647,7 +647,7 @@ namespace Flow.Launcher.Core.Plugin { if (checkModified && PluginModified(plugin.ID)) { - API.ShowMsg(string.Format(API.GetTranslation("failedToUninstallPluginTitle"), plugin.Name), + API.ShowMsgError(string.Format(API.GetTranslation("failedToUninstallPluginTitle"), plugin.Name), API.GetTranslation("pluginModifiedAlreadyMessage")); return; } @@ -712,6 +712,8 @@ namespace Flow.Launcher.Core.Plugin { _modifiedPlugins.Add(plugin.ID); } + + return; } #endregion