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)
{
try
{
imgIcon.Source = new BitmapImage(new Uri(path, UriKind.Relative));
}
catch (Exception)
{
}
imgIcon.Source = new BitmapImage(new Uri($"{_defaultWebSearchImageDirectory}\\{path}", UriKind.Absolute));
}
private void BtnCancel_OnClick(object sender, RoutedEventArgs e)
@@ -86,13 +80,6 @@ namespace Wox.Plugin.WebSearch
}
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)
{
try
@@ -155,8 +142,8 @@ namespace Wox.Plugin.WebSearch
if (result == true)
{
string filename = dlg.FileName;
tbIconPath.Text = filename;
ShowIcon(filename);
tbIconPath.Text = Path.GetFileName(filename);
ShowIcon(tbIconPath.Text);
}
}
}

View File

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