From 8dbb216c9e01ca7102b24e8e5ebd09304a7ee0a9 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 18 Apr 2015 19:03:56 +0000 Subject: WinGui: Adding Del shortcut to preset pane, and better warnings when deleting. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7103 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs') diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 7465ceb10..652068444 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -1638,6 +1638,29 @@ namespace HandBrakeWPF.ViewModels { if (this.selectedPreset != null) { + if (this.selectedPreset.IsDefault) + { + this.errorService.ShowMessageBox( + "You can not delete the default preset. Please set another preset as default first.", + Resources.Warning, + MessageBoxButton.OK, + MessageBoxImage.Information); + + return; + } + + MessageBoxResult result = + this.errorService.ShowMessageBox( + "Are you sure you want to delete the preset: " + this.selectedPreset.Name + " ?", + Resources.Question, + MessageBoxButton.YesNo, + MessageBoxImage.Question); + + if (result == MessageBoxResult.No) + { + return; + } + this.presetService.Remove(this.selectedPreset); } else -- cgit v1.2.3