summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2020-04-11 16:17:06 +0100
committersr55 <[email protected]>2020-04-11 16:17:06 +0100
commitfa81cfaf559d8a53a86a9958025e2d4674887910 (patch)
tree2c145318a2e67ecdc9db43d81e818f753c2f2d6a /win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
parenta06bd83f2d1b1e9edc190fa09bdb7f0752783a7f (diff)
WinGui: If selecting a preset that uses an video encoder that's not in use, warn the user and don't select the preset. #2631
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs17
1 files changed, 14 insertions, 3 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index 7c8c28e6b..878f03b4d 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -330,13 +330,13 @@ namespace HandBrakeWPF.ViewModels
{
if (!object.Equals(this.selectedPreset, value))
{
- this.selectedPreset = value;
- this.NotifyOfPropertyChange(() => this.SelectedPreset);
-
if (value != null)
{
this.PresetSelect(value);
}
+
+ this.selectedPreset = value;
+ this.NotifyOfPropertyChange(() => this.SelectedPreset);
}
}
}
@@ -347,6 +347,7 @@ namespace HandBrakeWPF.ViewModels
{
return this.isModifiedPreset;
}
+
set
{
if (value == this.isModifiedPreset) return;
@@ -2088,6 +2089,16 @@ namespace HandBrakeWPF.ViewModels
Preset preset = tag as Preset;
if (preset != null)
{
+ if (preset.IsPresetDisabled)
+ {
+ this.errorService.ShowMessageBox(
+ Resources.Presets_NotAvailableForUse,
+ Resources.Warning,
+ MessageBoxButton.OK,
+ MessageBoxImage.Warning);
+ return;
+ }
+
if (this.SelectedPresetCategory == null || this.SelectedPresetCategory.Category != preset.Category)
{
this.SelectedPresetCategory = this.PresetsCategories.FirstOrDefault(c => c.Category == preset.Category);