From ed2dc101bb56debd0d4effc65fb1abbd3cc2f078 Mon Sep 17 00:00:00 2001 From: Coenraad Stijne Date: Thu, 10 Jul 2014 16:52:18 +0200 Subject: [PATCH 1/3] [WebSearch] Fix MessageBox behaviour Fix MessageBox asking user to select item if he clicks No. --- .../WebSearch/WebSearchesSetting.xaml.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Wox.Plugin.SystemPlugins/WebSearch/WebSearchesSetting.xaml.cs b/Wox.Plugin.SystemPlugins/WebSearch/WebSearchesSetting.xaml.cs index 78cf8ac915..7d13dff7b4 100644 --- a/Wox.Plugin.SystemPlugins/WebSearch/WebSearchesSetting.xaml.cs +++ b/Wox.Plugin.SystemPlugins/WebSearch/WebSearchesSetting.xaml.cs @@ -36,12 +36,14 @@ namespace Wox.Plugin.SystemPlugins 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) + if (seletedWebSearch != null) { - UserSettingStorage.Instance.WebSearches.Remove(seletedWebSearch); - webSearchView.Items.Refresh(); + if (MessageBox.Show("Are your sure to delete " + seletedWebSearch.Title, "Delete WebSearch", + MessageBoxButton.YesNo) == MessageBoxResult.Yes) + { + UserSettingStorage.Instance.WebSearches.Remove(seletedWebSearch); + webSearchView.Items.Refresh(); + } } else { From b91850262dca5ad4710eaa0ed52d429484ce5c07 Mon Sep 17 00:00:00 2001 From: Coenraad Stijne Date: Thu, 10 Jul 2014 17:06:50 +0200 Subject: [PATCH 2/3] [Programs] Fix MessageBox behaviour Fix MessageBox asking user to select item if he clicks No after trying to Delete an item in Programs Settings. --- .../Program/ProgramSetting.xaml.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Wox.Plugin.SystemPlugins/Program/ProgramSetting.xaml.cs b/Wox.Plugin.SystemPlugins/Program/ProgramSetting.xaml.cs index 04c9d9c036..6fa388a6f0 100644 --- a/Wox.Plugin.SystemPlugins/Program/ProgramSetting.xaml.cs +++ b/Wox.Plugin.SystemPlugins/Program/ProgramSetting.xaml.cs @@ -35,12 +35,14 @@ namespace Wox.Plugin.SystemPlugins.Program private void btnDeleteProgramSource_OnClick(object sender, RoutedEventArgs e) { ProgramSource seletedProgramSource = programSourceView.SelectedItem as ProgramSource; - if (seletedProgramSource != null && - MessageBox.Show("Are your sure to delete " + seletedProgramSource.ToString(), "Delete ProgramSource", - MessageBoxButton.YesNo) == MessageBoxResult.Yes) + if (seletedProgramSource != null) { - UserSettingStorage.Instance.ProgramSources.Remove(seletedProgramSource); - programSourceView.Items.Refresh(); + if (MessageBox.Show("Are your sure to delete " + seletedProgramSource.ToString(), "Delete ProgramSource", + MessageBoxButton.YesNo) == MessageBoxResult.Yes) + { + UserSettingStorage.Instance.ProgramSources.Remove(seletedProgramSource); + programSourceView.Items.Refresh(); + } } else { From 418aa44960a360bc25a233c9f61a87ea6844e6cb Mon Sep 17 00:00:00 2001 From: Coenraad Stijne Date: Thu, 10 Jul 2014 17:16:46 +0200 Subject: [PATCH 3/3] Fix spelling mistake seleted => selected --- .../Program/ProgramSetting.xaml.cs | 14 +++++++------- .../WebSearch/WebSearchesSetting.xaml.cs | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Wox.Plugin.SystemPlugins/Program/ProgramSetting.xaml.cs b/Wox.Plugin.SystemPlugins/Program/ProgramSetting.xaml.cs index 6fa388a6f0..11a49707c3 100644 --- a/Wox.Plugin.SystemPlugins/Program/ProgramSetting.xaml.cs +++ b/Wox.Plugin.SystemPlugins/Program/ProgramSetting.xaml.cs @@ -34,13 +34,13 @@ namespace Wox.Plugin.SystemPlugins.Program private void btnDeleteProgramSource_OnClick(object sender, RoutedEventArgs e) { - ProgramSource seletedProgramSource = programSourceView.SelectedItem as ProgramSource; - if (seletedProgramSource != null) + ProgramSource selectedProgramSource = programSourceView.SelectedItem as ProgramSource; + if (selectedProgramSource != null) { - if (MessageBox.Show("Are your sure to delete " + seletedProgramSource.ToString(), "Delete ProgramSource", + if (MessageBox.Show("Are your sure to delete " + selectedProgramSource.ToString(), "Delete ProgramSource", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { - UserSettingStorage.Instance.ProgramSources.Remove(seletedProgramSource); + UserSettingStorage.Instance.ProgramSources.Remove(selectedProgramSource); programSourceView.Items.Refresh(); } } @@ -52,11 +52,11 @@ namespace Wox.Plugin.SystemPlugins.Program private void btnEditProgramSource_OnClick(object sender, RoutedEventArgs e) { - ProgramSource seletedProgramSource = programSourceView.SelectedItem as ProgramSource; - if (seletedProgramSource != null) + ProgramSource selectedProgramSource = programSourceView.SelectedItem as ProgramSource; + if (selectedProgramSource != null) { ProgramSourceSetting programSource = new ProgramSourceSetting(this); - programSource.UpdateItem(seletedProgramSource); + programSource.UpdateItem(selectedProgramSource); programSource.ShowDialog(); } else diff --git a/Wox.Plugin.SystemPlugins/WebSearch/WebSearchesSetting.xaml.cs b/Wox.Plugin.SystemPlugins/WebSearch/WebSearchesSetting.xaml.cs index 7d13dff7b4..219b8b14fd 100644 --- a/Wox.Plugin.SystemPlugins/WebSearch/WebSearchesSetting.xaml.cs +++ b/Wox.Plugin.SystemPlugins/WebSearch/WebSearchesSetting.xaml.cs @@ -35,13 +35,13 @@ namespace Wox.Plugin.SystemPlugins private void btnDeleteWebSearch_OnClick(object sender, RoutedEventArgs e) { - WebSearch seletedWebSearch = webSearchView.SelectedItem as WebSearch; - if (seletedWebSearch != null) + WebSearch selectedWebSearch = webSearchView.SelectedItem as WebSearch; + if (selectedWebSearch != null) { - if (MessageBox.Show("Are your sure to delete " + seletedWebSearch.Title, "Delete WebSearch", + if (MessageBox.Show("Are your sure to delete " + selectedWebSearch.Title, "Delete WebSearch", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { - UserSettingStorage.Instance.WebSearches.Remove(seletedWebSearch); + UserSettingStorage.Instance.WebSearches.Remove(selectedWebSearch); webSearchView.Items.Refresh(); } } @@ -53,11 +53,11 @@ namespace Wox.Plugin.SystemPlugins private void btnEditWebSearch_OnClick(object sender, RoutedEventArgs e) { - WebSearch seletedWebSearch = webSearchView.SelectedItem as WebSearch; - if (seletedWebSearch != null) + WebSearch selectedWebSearch = webSearchView.SelectedItem as WebSearch; + if (selectedWebSearch != null) { WebSearchSetting webSearch = new WebSearchSetting(this); - webSearch.UpdateItem(seletedWebSearch); + webSearch.UpdateItem(selectedWebSearch); webSearch.ShowDialog(); } else