From 455407f09c31dcfd9785a15b82f86cb8b322726f Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 3 Jun 2012 20:54:33 +0000 Subject: WinGui: Numerous fixes to the picture settings tab. Fixed framerate typo on the Video tab and fixed an issue on the main window when changing back to Chapters mode. (Start and End points were not set correctly) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4710 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 6 +++ .../ViewModels/PictureSettingsViewModel.cs | 56 +++++++++++++++++++++- win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml | 13 +++-- win/CS/HandBrakeWPF/Views/VideoView.xaml | 2 +- 4 files changed, 71 insertions(+), 6 deletions(-) (limited to 'win/CS/HandBrakeWPF') diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index df13c1482..5bc79dec7 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -726,6 +726,12 @@ namespace HandBrakeWPF.ViewModels this.CurrentTask.PointToPointMode = value; this.NotifyOfPropertyChange(() => SelectedPointToPoint); this.NotifyOfPropertyChange(() => ShowTextEntryForPointToPointMode); + + if (value == PointToPointMode.Chapters && this.SelectedTitle != null) + { + this.SelectedStartPoint = 1; + this.SelectedEndPoint = selectedTitle.Chapters.Last().ChapterNumber; + } } } diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs index cbed5a1bc..f5612df2e 100644 --- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs @@ -78,6 +78,16 @@ namespace HandBrakeWPF.ViewModels /// private bool widthControlEnabled = true; + /// + /// Backing field for the show modulus field + /// + private bool showModulus; + + /// + /// Backing field for showing display size. + /// + private bool showDisplaySize; + #endregion #region Constructors and Destructors @@ -127,6 +137,7 @@ namespace HandBrakeWPF.ViewModels { this.Task.Cropping.Bottom = this.CorrectForModulus(this.Task.Cropping.Bottom, value); this.NotifyOfPropertyChange(() => this.CropBottom); + this.SetDisplaySize(); } } @@ -144,6 +155,7 @@ namespace HandBrakeWPF.ViewModels { this.Task.Cropping.Left = this.CorrectForModulus(this.Task.Cropping.Left, value); this.NotifyOfPropertyChange(() => this.CropLeft); + this.SetDisplaySize(); } } @@ -161,6 +173,7 @@ namespace HandBrakeWPF.ViewModels { this.Task.Cropping.Right = this.CorrectForModulus(this.Task.Cropping.Right, value); this.NotifyOfPropertyChange(() => this.CropRight); + this.SetDisplaySize(); } } @@ -178,6 +191,7 @@ namespace HandBrakeWPF.ViewModels { this.Task.Cropping.Top = this.CorrectForModulus(this.Task.Cropping.Top, value); this.NotifyOfPropertyChange(() => this.CropTop); + this.SetDisplaySize(); } } @@ -388,6 +402,38 @@ namespace HandBrakeWPF.ViewModels } } + /// + /// Gets or sets a value indicating whether ShowModulus. + /// + public bool ShowModulus + { + get + { + return this.showModulus; + } + set + { + this.showModulus = value; + this.NotifyOfPropertyChange(() => this.ShowModulus); + } + } + + /// + /// Gets or sets a value indicating whether ShowDisplaySize. + /// + public bool ShowDisplaySize + { + get + { + return this.showDisplaySize; + } + set + { + this.showDisplaySize = value; + this.NotifyOfPropertyChange(() => this.ShowDisplaySize); + } + } + /// /// Gets or sets SourceInfo. /// @@ -580,12 +626,16 @@ namespace HandBrakeWPF.ViewModels this.CalculateAnamorphicSizes().Width, this.CalculateAnamorphicSizes().Height); + this.ShowDisplaySize = true; switch (this.SelectedAnamorphicMode) { case Anamorphic.None: this.WidthControlEnabled = true; this.HeightControlEnabled = true; this.ShowCustomAnamorphicControls = false; + this.ShowModulus = false; + this.ShowDisplaySize = false; + this.SelectedModulus = 16; // Reset this.Width = this.sourceResolution.Width; this.SetDisplaySize(); break; @@ -593,6 +643,8 @@ namespace HandBrakeWPF.ViewModels this.WidthControlEnabled = false; this.HeightControlEnabled = false; this.ShowCustomAnamorphicControls = false; + this.ShowModulus = false; + this.SelectedModulus = 16; // Reset this.Width = 0; this.Height = 0; @@ -605,6 +657,7 @@ namespace HandBrakeWPF.ViewModels this.WidthControlEnabled = true; this.HeightControlEnabled = false; this.ShowCustomAnamorphicControls = false; + this.ShowModulus = true; this.Width = this.sourceResolution.Width; this.Height = 0; @@ -617,6 +670,7 @@ namespace HandBrakeWPF.ViewModels this.WidthControlEnabled = true; this.HeightControlEnabled = true; this.ShowCustomAnamorphicControls = true; + this.ShowModulus = true; this.Width = this.sourceResolution.Width; this.Height = 0; @@ -861,7 +915,7 @@ namespace HandBrakeWPF.ViewModels this.Task.Height = (int)Math.Round(this.GetModulusValue(newHeight), 0); this.NotifyOfPropertyChange(() => this.Height); } - + this.SetDisplaySize(); break; case Anamorphic.Strict: this.Task.Width = 0; diff --git a/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml b/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml index d9ed6cef2..fa537e178 100644 --- a/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml +++ b/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml @@ -45,10 +45,13 @@