Fix icon path for Web Search plugin

This commit is contained in:
bao-qian
2015-11-09 03:56:56 +00:00
parent 8aee2858ea
commit 4351080aea
2 changed files with 6 additions and 19 deletions

View File

@@ -50,13 +50,7 @@ namespace Wox.Plugin.WebSearch
private void ShowIcon(string path) private void ShowIcon(string path)
{ {
try imgIcon.Source = new BitmapImage(new Uri($"{_defaultWebSearchImageDirectory}\\{path}", UriKind.Absolute));
{
imgIcon.Source = new BitmapImage(new Uri(path, UriKind.Relative));
}
catch (Exception)
{
}
} }
private void BtnCancel_OnClick(object sender, RoutedEventArgs e) private void BtnCancel_OnClick(object sender, RoutedEventArgs e)
@@ -86,13 +80,6 @@ namespace Wox.Plugin.WebSearch
} }
string newActionKeyword = tbActionword.Text.Trim(); string newActionKeyword = tbActionword.Text.Trim();
if (string.IsNullOrEmpty(newActionKeyword))
{
string warning = _context.API.GetTranslation("wox_plugin_websearch_input_action_keyword");
MessageBox.Show(warning);
return;
}
if (_isUpdate) if (_isUpdate)
{ {
try try
@@ -155,8 +142,8 @@ namespace Wox.Plugin.WebSearch
if (result == true) if (result == true)
{ {
string filename = dlg.FileName; string filename = dlg.FileName;
tbIconPath.Text = filename; tbIconPath.Text = Path.GetFileName(filename);
ShowIcon(filename); ShowIcon(tbIconPath.Text);
} }
} }
} }

View File

@@ -41,7 +41,7 @@ namespace Wox.Plugin.WebSearch
{ {
Title = "Google", Title = "Google",
ActionKeyword = "g", ActionKeyword = "g",
IconPath = @"Images\websearch\google.png", IconPath = @"google.png",
Url = "https://www.google.com/search?q={q}", Url = "https://www.google.com/search?q={q}",
Enabled = true Enabled = true
}; };
@@ -52,7 +52,7 @@ namespace Wox.Plugin.WebSearch
{ {
Title = "Wikipedia", Title = "Wikipedia",
ActionKeyword = "wiki", ActionKeyword = "wiki",
IconPath = @"Images\websearch\wiki.png", IconPath = @"wiki.png",
Url = "http://en.wikipedia.org/wiki/{q}", Url = "http://en.wikipedia.org/wiki/{q}",
Enabled = true Enabled = true
}; };
@@ -62,7 +62,7 @@ namespace Wox.Plugin.WebSearch
{ {
Title = "FindIcon", Title = "FindIcon",
ActionKeyword = "findicon", ActionKeyword = "findicon",
IconPath = @"Images\websearch\pictures.png", IconPath = @"pictures.png",
Url = "http://findicons.com/search/{q}", Url = "http://findicons.com/search/{q}",
Enabled = true Enabled = true
}; };