diff options
author | sr55 <[email protected]> | 2017-09-17 15:43:47 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2017-09-17 15:44:02 +0100 |
commit | 361f4d9e6c055faa48c3ca61a97872d0216261f6 (patch) | |
tree | c298da50abab13e5f7ae07cece8a0bc77fa6fe3d /win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs | |
parent | 491e02354e74118ba9aca4ef201c8d2c3a42bda4 (diff) |
WinGui: Initial ground work on code that will detect when the user modifies settings that don't match the currently selected preset.
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs index a65fca5eb..5409e7502 100644 --- a/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs @@ -55,6 +55,7 @@ namespace HandBrakeWPF.ViewModels this.userSettingService = userSettingService; } + public event EventHandler<TabStatusEventArgs> TabStatusChanged; public event EventHandler<OutputFormatChangedEventArgs> OutputFormatChanged; public Preset Preset @@ -309,6 +310,31 @@ namespace HandBrakeWPF.ViewModels this.NotifyOfPropertyChange(() => this.AlignAVStart); } + public bool MatchesPreset(Preset preset) + { + if (preset.Task.OutputFormat != this.SelectedOutputFormat) + { + return false; + } + + if (preset.Task.OptimizeMP4 != this.OptimizeMP4) + { + return false; + } + + if (preset.Task.AlignAVStart != this.AlignAVStart) + { + return false; + } + + if (preset.Task.IPod5GSupport != this.IPod5GSupport) + { + return false; + } + + return true; + } + public void UpdateDisplayedInfo() { if (this.CurrentTitle == null) @@ -377,6 +403,11 @@ namespace HandBrakeWPF.ViewModels #region Private Methods + protected virtual void OnTabStatusChanged(TabStatusEventArgs e) + { + this.TabStatusChanged?.Invoke(this, e); + } + private void UpdateSettings(Preset selectedPreset) { // Main Window Settings |