From 02b77f3bc692e0d059c29ea907393fda31a3790b Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 30 Jun 2012 17:37:25 +0000 Subject: WinGui: Assorted fixes. - Implementation of CanBeBurned and CanBeForced on the subtitles panel. - Save updates to user presets from the Presets Options Menu. (Can use Add Preset to overwrite preset configuration instead also) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4800 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 29 +++++++++++++++++++++++++ 1 file changed, 29 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 0e508a7a2..7596919eb 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -1226,6 +1226,33 @@ namespace HandBrakeWPF.ViewModels this.WindowManager.ShowWindow(presetViewModel); } + /// + /// Update a selected preset. + /// + public void PresetUpdate() + { + if (this.SelectedPreset == null) + { + this.errorService.ShowMessageBox( + "Please select a preset to update.", "No Preset selected", MessageBoxButton.OK, MessageBoxImage.Warning); + + return; + } + + if (this.SelectedPreset.IsBuildIn) + { + this.errorService.ShowMessageBox( + "You can not modify built in presets. Please select one of your own presets.", "No Preset selected", MessageBoxButton.OK, MessageBoxImage.Warning); + return; + } + + this.SelectedPreset.Task = new EncodeTask(this.CurrentTask); + this.presetService.Update(this.SelectedPreset); + + this.errorService.ShowMessageBox( + "The Preset has now been updated with your current settings.", "Preset Updated", MessageBoxButton.OK, MessageBoxImage.Information); + } + /// /// Remove a Preset /// @@ -1475,6 +1502,8 @@ namespace HandBrakeWPF.ViewModels { MessageBox.Show("There is no new updates at this time.", "No Update Available", MessageBoxButton.OK, MessageBoxImage.Information); } + + this.ProgramStatusLabel = "Ready"; } #endregion -- cgit v1.2.3