Enable multiple action keywords

See issue #352
This commit is contained in:
bao-qian
2015-11-04 22:49:40 +00:00
parent 59a4abff7c
commit a07d6aa1e7
25 changed files with 95 additions and 112 deletions

View File

@@ -42,7 +42,7 @@ namespace Wox.Plugin.WebSearch
cbEnable.IsChecked = webSearch.Enabled;
tbTitle.Text = webSearch.Title;
tbUrl.Text = webSearch.Url;
tbActionword.Text = webSearch.ActionWord;
tbActionword.Text = webSearch.ActionKeyword;
}
private void ShowIcon(string path)
@@ -90,7 +90,7 @@ namespace Wox.Plugin.WebSearch
if (!update)
{
if (WebSearchStorage.Instance.WebSearches.Exists(o => o.ActionWord == action))
if (WebSearchStorage.Instance.WebSearches.Exists(o => o.ActionKeyword == action))
{
string warning = context.API.GetTranslation("wox_plugin_websearch_action_keyword_exist");
MessageBox.Show(warning);
@@ -98,7 +98,7 @@ namespace Wox.Plugin.WebSearch
}
WebSearchStorage.Instance.WebSearches.Add(new WebSearch()
{
ActionWord = action,
ActionKeyword = action,
Enabled = cbEnable.IsChecked ?? false,
IconPath = tbIconPath.Text,
Url = url,
@@ -109,13 +109,13 @@ namespace Wox.Plugin.WebSearch
}
else
{
if (WebSearchStorage.Instance.WebSearches.Exists(o => o.ActionWord == action && o != updateWebSearch))
if (WebSearchStorage.Instance.WebSearches.Exists(o => o.ActionKeyword == action && o != updateWebSearch))
{
string warning = context.API.GetTranslation("wox_plugin_websearch_action_keyword_exist");
MessageBox.Show(warning);
return;
}
updateWebSearch.ActionWord = action;
updateWebSearch.ActionKeyword = action;
updateWebSearch.IconPath = tbIconPath.Text;
updateWebSearch.Enabled = cbEnable.IsChecked ?? false;
updateWebSearch.Url = url;