mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-01-07 20:07:56 +08:00
Merge pull request #105 from CoenraadS/master
[WebSearch/Programs] Fix MessageBox behaviour
This commit is contained in:
commit
4436a72b9f
@ -34,13 +34,15 @@ namespace Wox.Plugin.SystemPlugins.Program
|
|||||||
|
|
||||||
private void btnDeleteProgramSource_OnClick(object sender, RoutedEventArgs e)
|
private void btnDeleteProgramSource_OnClick(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
ProgramSource seletedProgramSource = programSourceView.SelectedItem as ProgramSource;
|
ProgramSource selectedProgramSource = programSourceView.SelectedItem as ProgramSource;
|
||||||
if (seletedProgramSource != null &&
|
if (selectedProgramSource != null)
|
||||||
MessageBox.Show("Are your sure to delete " + seletedProgramSource.ToString(), "Delete ProgramSource",
|
|
||||||
MessageBoxButton.YesNo) == MessageBoxResult.Yes)
|
|
||||||
{
|
{
|
||||||
UserSettingStorage.Instance.ProgramSources.Remove(seletedProgramSource);
|
if (MessageBox.Show("Are your sure to delete " + selectedProgramSource.ToString(), "Delete ProgramSource",
|
||||||
programSourceView.Items.Refresh();
|
MessageBoxButton.YesNo) == MessageBoxResult.Yes)
|
||||||
|
{
|
||||||
|
UserSettingStorage.Instance.ProgramSources.Remove(selectedProgramSource);
|
||||||
|
programSourceView.Items.Refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -50,11 +52,11 @@ namespace Wox.Plugin.SystemPlugins.Program
|
|||||||
|
|
||||||
private void btnEditProgramSource_OnClick(object sender, RoutedEventArgs e)
|
private void btnEditProgramSource_OnClick(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
ProgramSource seletedProgramSource = programSourceView.SelectedItem as ProgramSource;
|
ProgramSource selectedProgramSource = programSourceView.SelectedItem as ProgramSource;
|
||||||
if (seletedProgramSource != null)
|
if (selectedProgramSource != null)
|
||||||
{
|
{
|
||||||
ProgramSourceSetting programSource = new ProgramSourceSetting(this);
|
ProgramSourceSetting programSource = new ProgramSourceSetting(this);
|
||||||
programSource.UpdateItem(seletedProgramSource);
|
programSource.UpdateItem(selectedProgramSource);
|
||||||
programSource.ShowDialog();
|
programSource.ShowDialog();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -35,13 +35,15 @@ namespace Wox.Plugin.SystemPlugins
|
|||||||
|
|
||||||
private void btnDeleteWebSearch_OnClick(object sender, RoutedEventArgs e)
|
private void btnDeleteWebSearch_OnClick(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
WebSearch seletedWebSearch = webSearchView.SelectedItem as WebSearch;
|
WebSearch selectedWebSearch = webSearchView.SelectedItem as WebSearch;
|
||||||
if (seletedWebSearch != null &&
|
if (selectedWebSearch != null)
|
||||||
MessageBox.Show("Are your sure to delete " + seletedWebSearch.Title, "Delete WebSearch",
|
|
||||||
MessageBoxButton.YesNo) == MessageBoxResult.Yes)
|
|
||||||
{
|
{
|
||||||
UserSettingStorage.Instance.WebSearches.Remove(seletedWebSearch);
|
if (MessageBox.Show("Are your sure to delete " + selectedWebSearch.Title, "Delete WebSearch",
|
||||||
webSearchView.Items.Refresh();
|
MessageBoxButton.YesNo) == MessageBoxResult.Yes)
|
||||||
|
{
|
||||||
|
UserSettingStorage.Instance.WebSearches.Remove(selectedWebSearch);
|
||||||
|
webSearchView.Items.Refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -51,11 +53,11 @@ namespace Wox.Plugin.SystemPlugins
|
|||||||
|
|
||||||
private void btnEditWebSearch_OnClick(object sender, RoutedEventArgs e)
|
private void btnEditWebSearch_OnClick(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
WebSearch seletedWebSearch = webSearchView.SelectedItem as WebSearch;
|
WebSearch selectedWebSearch = webSearchView.SelectedItem as WebSearch;
|
||||||
if (seletedWebSearch != null)
|
if (selectedWebSearch != null)
|
||||||
{
|
{
|
||||||
WebSearchSetting webSearch = new WebSearchSetting(this);
|
WebSearchSetting webSearch = new WebSearchSetting(this);
|
||||||
webSearch.UpdateItem(seletedWebSearch);
|
webSearch.UpdateItem(selectedWebSearch);
|
||||||
webSearch.ShowDialog();
|
webSearch.ShowDialog();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user