mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 04:07:40 +02:00
Add web search feature & some UI changes.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Wox.Infrastructure;
|
||||
|
||||
namespace Wox.Plugin.System
|
||||
{
|
||||
@@ -15,7 +16,7 @@ namespace Wox.Plugin.System
|
||||
List<Result> results = new List<Result>();
|
||||
if (string.IsNullOrEmpty(query.RawQuery)) return results;
|
||||
|
||||
foreach (PluginMetadata metadata in allPlugins.Select(o=>o.Metadata))
|
||||
foreach (PluginMetadata metadata in allPlugins.Select(o => o.Metadata))
|
||||
{
|
||||
if (metadata.ActionKeyword.StartsWith(query.RawQuery))
|
||||
{
|
||||
@@ -23,15 +24,27 @@ namespace Wox.Plugin.System
|
||||
Result result = new Result
|
||||
{
|
||||
Title = metadata.ActionKeyword,
|
||||
SubTitle = string.Format("Activate {0} workflow",metadata.Name),
|
||||
SubTitle = string.Format("Activate {0} plugin", metadata.Name),
|
||||
Score = 50,
|
||||
IcoPath = "Images/work.png",
|
||||
Action = () => changeQuery(metadataCopy.ActionKeyword + " "),
|
||||
DontHideWoxAfterSelect = true
|
||||
};
|
||||
results.Add(result);
|
||||
results.Add(result);
|
||||
}
|
||||
}
|
||||
|
||||
results.AddRange(CommonStorage.Instance.UserSetting.WebSearches.Where(o => o.ActionWord.StartsWith(query.RawQuery)).Select(n => new Result()
|
||||
{
|
||||
|
||||
Title = n.ActionWord,
|
||||
SubTitle = string.Format("Activate {0} plugin", n.ActionWord),
|
||||
Score = 50,
|
||||
IcoPath = "Images/work.png",
|
||||
Action = () => changeQuery(n.ActionWord + " "),
|
||||
DontHideWoxAfterSelect = true
|
||||
}));
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user