From afdee44dd14932ae19195af3132839afb7485c94 Mon Sep 17 00:00:00 2001 From: qianlifeng Date: Fri, 19 Sep 2014 16:18:54 +0800 Subject: [PATCH] Fix #183 --- .../WebSearch/WebSearchSetting.xaml.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Wox.Plugin.SystemPlugins/WebSearch/WebSearchSetting.xaml.cs b/Wox.Plugin.SystemPlugins/WebSearch/WebSearchSetting.xaml.cs index 3aa26440e8..6f496b1b7b 100644 --- a/Wox.Plugin.SystemPlugins/WebSearch/WebSearchSetting.xaml.cs +++ b/Wox.Plugin.SystemPlugins/WebSearch/WebSearchSetting.xaml.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using System.Windows; @@ -20,6 +21,7 @@ namespace Wox.Plugin.SystemPlugins { public partial class WebSearchSetting : Window { + private string defaultWebSearchImageDirectory = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath), "Images\\websearch"); private WebSearchesSetting settingWindow; private bool update; private WebSearch updateWebSearch; @@ -128,10 +130,16 @@ namespace Wox.Plugin.SystemPlugins private void BtnSelectIcon_OnClick(object sender, RoutedEventArgs e) { + if(!Directory.Exists(defaultWebSearchImageDirectory)) + { + defaultWebSearchImageDirectory = + System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath); + } + var dlg = new Microsoft.Win32.OpenFileDialog { - DefaultExt = ".png", - Filter ="Image files (*.jpg, *.jpeg, *.gif, *.png, *.bmp) | *.jpg; *.jpeg; *.gif; *.png, *.bmp" + InitialDirectory = defaultWebSearchImageDirectory, + Filter ="Image files (*.jpg, *.jpeg, *.gif, *.png, *.bmp) |*.jpg; *.jpeg; *.gif; *.png; *.bmp" }; bool? result = dlg.ShowDialog();