Add 'src/modules/launcher/' from commit '28acd466b352a807910cebbc74477d3173b31511'

git-subtree-dir: src/modules/launcher
git-subtree-mainline: 852689b3df
git-subtree-split: 28acd466b3
This commit is contained in:
Alekhya Reddy Kommuru
2020-03-10 14:15:29 -07:00
487 changed files with 28191 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
using System.Collections.Generic;
using System.Linq;
using Wox.Core.Plugin;
namespace Wox.Plugin.PluginIndicator
{
public class Main : IPlugin, IPluginI18n
{
private PluginInitContext context;
public List<Result> Query(Query query)
{
var results = from keyword in PluginManager.NonGlobalPlugins.Keys
where keyword.StartsWith(query.Terms[0])
let metadata = PluginManager.NonGlobalPlugins[keyword].Metadata
where !metadata.Disabled
select new Result
{
Title = keyword,
SubTitle = $"Activate {metadata.Name} plugin",
Score = 100,
IcoPath = metadata.IcoPath,
Action = c =>
{
context.API.ChangeQuery($"{keyword}{Plugin.Query.TermSeperater}");
return false;
}
};
return results.ToList();
}
public void Init(PluginInitContext context)
{
this.context = context;
}
public string GetTranslatedPluginTitle()
{
return context.API.GetTranslation("wox_plugin_pluginindicator_plugin_name");
}
public string GetTranslatedPluginDescription()
{
return context.API.GetTranslation("wox_plugin_pluginindicator_plugin_description");
}
}
}