mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
add hotkey and interface listeners logic
This commit is contained in:
parent
bf60f5d1a6
commit
1896b67989
3 changed files with 11 additions and 4 deletions
|
|
@ -26,7 +26,6 @@ namespace Flow.Launcher.Core.Plugin
|
|||
|
||||
public static IPublicAPI API { private set; get; }
|
||||
|
||||
// todo happlebao, this should not be public, the indicator function should be embeded
|
||||
public static PluginsSettings Settings;
|
||||
private static List<PluginMetadata> _metadatas;
|
||||
|
||||
|
|
@ -181,9 +180,14 @@ namespace Flow.Launcher.Core.Plugin
|
|||
|
||||
public static async Task PublishPathSelectedFromResult(string selectedPath, string hotkey)
|
||||
{
|
||||
await Task.WhenAll(AllPlugins.Select(plugin => plugin.Plugin switch
|
||||
await Task.WhenAll(AllPlugins.Select(pluginPair => pluginPair.Plugin switch
|
||||
{
|
||||
IPathSelected p => p.PathSelected(selectedPath, hotkey),
|
||||
IPathSelected p
|
||||
when pluginPair
|
||||
.Metadata
|
||||
.Listeners
|
||||
.Any(x => x.ContainsKey(hotkey) && x.ContainsValue("IPathSelected"))
|
||||
=> p.PathSelected(selectedPath, hotkey),
|
||||
_ => Task.CompletedTask,
|
||||
}));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,8 +35,10 @@ namespace Flow.Launcher.Plugin
|
|||
|
||||
public List<string> ActionKeywords { get; set; }
|
||||
|
||||
public List<Dictionary<string, string>> Listeners { get; set;}
|
||||
|
||||
public string IcoPath { get; set;}
|
||||
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
"*",
|
||||
"*"
|
||||
],
|
||||
"Listeners": [{"f1": "IPathSelected"}],
|
||||
"Name": "Explorer",
|
||||
"Description": "Search and manage files and folders. Explorer utilises Windows Index Search",
|
||||
"Author": "Jeremy Wu",
|
||||
|
|
|
|||
Loading…
Reference in a new issue