Add web search feature & some UI changes.

This commit is contained in:
qianlifeng
2014-01-29 22:44:57 +08:00
parent 9f22a6d26d
commit fa3ae62254
31 changed files with 340 additions and 86 deletions

View File

@@ -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;
}