Move WebSearch into featureBox

This commit is contained in:
Yeechan Lu
2014-03-29 16:13:36 +08:00
parent 80ec16b9bd
commit c9790d7bb8
9 changed files with 146 additions and 94 deletions

View File

@@ -154,7 +154,6 @@ namespace Wox
themeComboBox.SelectedItem = UserSettingStorage.Instance.Theme;
cbReplaceWinR.IsChecked = UserSettingStorage.Instance.ReplaceWinR;
webSearchView.ItemsSource = UserSettingStorage.Instance.WebSearches;
lvCustomHotkey.ItemsSource = UserSettingStorage.Instance.CustomPluginHotkeys;
cbEnablePythonPlugins.IsChecked = UserSettingStorage.Instance.EnablePythonPlugins;
cbStartWithWindows.IsChecked = File.Exists(woxLinkPath);
@@ -198,57 +197,12 @@ namespace Wox
App.Window.SetTheme(UserSettingStorage.Instance.Theme);
}
public void ReloadWebSearchView()
{
webSearchView.Items.Refresh();
}
private List<string> LoadAvailableThemes()
{
string themePath = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath), "Themes");
return Directory.GetFiles(themePath).Where(filePath => filePath.EndsWith(".xaml") && !filePath.EndsWith("Default.xaml")).ToList();
}
private void btnAddWebSearch_OnClick(object sender, RoutedEventArgs e)
{
WebSearchSetting webSearch = new WebSearchSetting(this);
webSearch.ShowDialog();
}
private void btnDeleteWebSearch_OnClick(object sender, RoutedEventArgs e)
{
WebSearch seletedWebSearch = webSearchView.SelectedItem as WebSearch;
if (seletedWebSearch != null &&
MessageBox.Show("Are your sure to delete " + seletedWebSearch.Title, "Delete WebSearch",
MessageBoxButton.YesNo) == MessageBoxResult.Yes)
{
UserSettingStorage.Instance.WebSearches.Remove(seletedWebSearch);
webSearchView.Items.Refresh();
}
else
{
MessageBox.Show("Please select a web search");
}
}
private void btnEditWebSearch_OnClick(object sender, RoutedEventArgs e)
{
WebSearch seletedWebSearch = webSearchView.SelectedItem as WebSearch;
if (seletedWebSearch != null)
{
WebSearchSetting webSearch = new WebSearchSetting(this);
webSearch.UpdateItem(seletedWebSearch);
webSearch.ShowDialog();
}
else
{
MessageBox.Show("Please select a web search");
}
}
private void CbStartWithWindows_OnChecked(object sender, RoutedEventArgs e)
{
CreateStartupFolderShortcut();