From ab7685e9ea9bf58a4f1bf3c519ca7cebd1ca1880 Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Sat, 18 Nov 2023 21:45:06 -0500 Subject: [PATCH 1/4] Show a result error instead of popping up dialog --- Flow.Launcher.Core/Plugin/PluginManager.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher.Core/Plugin/PluginManager.cs b/Flow.Launcher.Core/Plugin/PluginManager.cs index f8c9a3f17..31ded2baf 100644 --- a/Flow.Launcher.Core/Plugin/PluginManager.cs +++ b/Flow.Launcher.Core/Plugin/PluginManager.cs @@ -210,7 +210,18 @@ namespace Flow.Launcher.Core.Plugin } catch (Exception e) { - throw new FlowPluginException(metadata, e); + Result r = new() + { + Title = $"{metadata.Name}: {e.GetType().Name}", + SubTitle = "ERROR: There was an error loading this plugin!", + IcoPath = "Images\\app_error.png", + PluginDirectory = metadata.PluginDirectory, + ActionKeywordAssigned = query.ActionKeyword, + PluginID = metadata.ID, + OriginQuery = query, + Action = _ => { throw new FlowPluginException(metadata, e);} + }; + results.Add(r); } return results; } From a84e509aabbb726c81bf547d0ea48d35df933caa Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Fri, 24 Nov 2023 13:15:17 -0500 Subject: [PATCH 2/4] Use proper error icon constant --- Flow.Launcher.Core/Plugin/PluginManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher.Core/Plugin/PluginManager.cs b/Flow.Launcher.Core/Plugin/PluginManager.cs index 31ded2baf..a297de63e 100644 --- a/Flow.Launcher.Core/Plugin/PluginManager.cs +++ b/Flow.Launcher.Core/Plugin/PluginManager.cs @@ -214,7 +214,7 @@ namespace Flow.Launcher.Core.Plugin { Title = $"{metadata.Name}: {e.GetType().Name}", SubTitle = "ERROR: There was an error loading this plugin!", - IcoPath = "Images\\app_error.png", + IcoPath = Flow.Launcher.Infrastructure.Constant.ErrorIcon, PluginDirectory = metadata.PluginDirectory, ActionKeywordAssigned = query.ActionKeyword, PluginID = metadata.ID, From 0e226d7a5b60f61b5bc68d6c72647bd1050334f1 Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Fri, 24 Nov 2023 13:15:29 -0500 Subject: [PATCH 3/4] Reword title and subtitle --- Flow.Launcher.Core/Plugin/PluginManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher.Core/Plugin/PluginManager.cs b/Flow.Launcher.Core/Plugin/PluginManager.cs index a297de63e..7454b5a94 100644 --- a/Flow.Launcher.Core/Plugin/PluginManager.cs +++ b/Flow.Launcher.Core/Plugin/PluginManager.cs @@ -212,8 +212,8 @@ namespace Flow.Launcher.Core.Plugin { Result r = new() { - Title = $"{metadata.Name}: {e.GetType().Name}", - SubTitle = "ERROR: There was an error loading this plugin!", + Title = $"{metadata.Name}: Failed to respond!", + SubTitle = "Select this result for more info", IcoPath = Flow.Launcher.Infrastructure.Constant.ErrorIcon, PluginDirectory = metadata.PluginDirectory, ActionKeywordAssigned = query.ActionKeyword, From f684883d7250996dd8656e40b711697d875ad4d8 Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Fri, 24 Nov 2023 13:15:58 -0500 Subject: [PATCH 4/4] Insure result is never in front of relevant results --- Flow.Launcher.Core/Plugin/PluginManager.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher.Core/Plugin/PluginManager.cs b/Flow.Launcher.Core/Plugin/PluginManager.cs index 7454b5a94..eec906807 100644 --- a/Flow.Launcher.Core/Plugin/PluginManager.cs +++ b/Flow.Launcher.Core/Plugin/PluginManager.cs @@ -219,7 +219,8 @@ namespace Flow.Launcher.Core.Plugin ActionKeywordAssigned = query.ActionKeyword, PluginID = metadata.ID, OriginQuery = query, - Action = _ => { throw new FlowPluginException(metadata, e);} + Action = _ => { throw new FlowPluginException(metadata, e);}, + Score = -100 }; results.Add(r); }