Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

<system:String x:Key="flowlauncher_plugin_pluginindicator_result_subtitle">Activate {0} plugin action keyword</system:String>

<system:String x:Key="flowlauncher_plugin_pluginindicator_plugin_settings_title">Settings: {0}</system:String>
<system:String x:Key="flowlauncher_plugin_pluginindicator_plugin_settings_subtitle">Open the settings page for the {0} plugin</system:String>

<system:String x:Key="flowlauncher_plugin_pluginindicator_plugin_name">Plugin Indicator</system:String>
<system:String x:Key="flowlauncher_plugin_pluginindicator_plugin_description">Provides plugins action words suggestions</system:String>

Expand Down
20 changes: 19 additions & 1 deletion Plugins/Flow.Launcher.Plugin.PluginIndicator/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Flow.Launcher.Plugin.PluginIndicator
{
public class Main : IPlugin, IPluginI18n, IHomeQuery
public class Main : IPlugin, IPluginI18n, IHomeQuery, IContextMenu
{
internal static PluginInitContext Context { get; private set; }

Expand Down Expand Up @@ -38,6 +38,7 @@ from pluginPair in nonGlobalPlugins[keyword]
SubTitle = Localize.flowlauncher_plugin_pluginindicator_result_subtitle(plugin.Name),
Score = score,
IcoPath = plugin.IcoPath,
ContextData = plugin,
AutoCompleteText = $"{keyword}{Plugin.Query.TermSeparator}",
Action = c =>
{
Expand All @@ -48,6 +49,23 @@ from pluginPair in nonGlobalPlugins[keyword]
return [.. results];
}

public List<Result> LoadContextMenus(Result selectedResult)
{
if (selectedResult.ContextData is not PluginMetadata plugin)
return [];

return new List<Result>
{
new Result
{
Title = Localize.flowlauncher_plugin_pluginindicator_plugin_settings_title(plugin.Name),
SubTitle = Localize.flowlauncher_plugin_pluginindicator_plugin_settings_subtitle(plugin.Name),
IcoPath = plugin.IcoPath, // icon of indicated plugin
Action = _ => Context.API.OpenPluginSettingsWindow(plugin.ID)
}
};
}

private static Dictionary<string, List<PluginPair>> GetNonGlobalPlugins()
{
var nonGlobalPlugins = new Dictionary<string, List<PluginPair>>();
Expand Down
Loading