mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
Move WebSearch into featureBox
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user