From b89d9987440e08807238a5ec77ca59d1d4cce7c0 Mon Sep 17 00:00:00 2001 From: sr55 Date: Thu, 31 May 2012 00:50:26 +0000 Subject: WinGui: Fix an issue with the x264 CQ Granulairty on certain cultures. Change the way the Destination text box works and update the autonaming code to work with Start and End points. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4709 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 36 +++++++++++++++++++--- win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs | 2 +- win/CS/HandBrakeWPF/Views/MainView.xaml | 2 +- 3 files changed, 33 insertions(+), 7 deletions(-) (limited to 'win/CS') diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 548523eee..df13c1482 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -589,6 +589,22 @@ namespace HandBrakeWPF.ViewModels #region Properties for Settings + /// + /// Gets or sets Destination. + /// + public string Destination + { + get + { + return this.CurrentTask.Destination; + } + set + { + this.CurrentTask.Destination = value; + this.NotifyOfPropertyChange(() => this.Destination); + } + } + /// /// Gets or sets SelectedTitle. /// @@ -624,7 +640,7 @@ namespace HandBrakeWPF.ViewModels if (this.UserSettingService.GetUserSetting(UserSettingConstants.AutoNaming)) { - this.CurrentTask.Destination = AutoNameHelper.AutoName(this.CurrentTask, this.SourceName); + this.Destination = AutoNameHelper.AutoName(this.CurrentTask, this.SourceName); } this.NotifyOfPropertyChange(() => this.CurrentTask); @@ -666,6 +682,11 @@ namespace HandBrakeWPF.ViewModels this.CurrentTask.StartPoint = value; this.NotifyOfPropertyChange(() => this.SelectedStartPoint); this.Duration = this.DurationCalculation(); + + if (this.UserSettingService.GetUserSetting(UserSettingConstants.AutoNaming)) + { + this.Destination = AutoNameHelper.AutoName(this.CurrentTask, this.SourceName); + } } } @@ -683,6 +704,11 @@ namespace HandBrakeWPF.ViewModels this.CurrentTask.EndPoint = value; this.NotifyOfPropertyChange(() => this.SelectedEndPoint); this.Duration = this.DurationCalculation(); + + if (this.UserSettingService.GetUserSetting(UserSettingConstants.AutoNaming)) + { + this.Destination = AutoNameHelper.AutoName(this.CurrentTask, this.SourceName); + } } } @@ -988,7 +1014,7 @@ namespace HandBrakeWPF.ViewModels return; } - if (string.IsNullOrEmpty(this.CurrentTask.Destination)) + if (string.IsNullOrEmpty(this.Destination)) { this.errorService.ShowMessageBox("The Destination field was empty.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); return; @@ -1000,7 +1026,7 @@ namespace HandBrakeWPF.ViewModels return; } - if (File.Exists(this.CurrentTask.Destination)) + if (File.Exists(this.Destination)) { MessageBoxResult result = this.errorService.ShowMessageBox("The current file already exists, do you wish to overwrite it?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Question); if (result == MessageBoxResult.No) @@ -1110,7 +1136,7 @@ namespace HandBrakeWPF.ViewModels break; } - this.CurrentTask.Destination = dialog.FileName; + this.Destination = dialog.FileName; this.NotifyOfPropertyChange(() => this.CurrentTask); } } @@ -1312,7 +1338,7 @@ namespace HandBrakeWPF.ViewModels // Update The browse file extension display if (Path.HasExtension(newExtension)) { - this.CurrentTask.Destination = Path.ChangeExtension(this.CurrentTask.Destination, newExtension); + this.Destination = Path.ChangeExtension(this.Destination, newExtension); } // Update the UI Display diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index 6f9500e0d..47189db9b 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -1678,7 +1678,7 @@ namespace HandBrakeWPF.ViewModels userSettingService.SetUserSetting(ASUserSettingConstants.ShowCLI, this.ShowCliWindow); userSettingService.SetUserSetting(ASUserSettingConstants.ClearCompletedFromQueue, this.ClearQueueOnEncodeCompleted); userSettingService.SetUserSetting(ASUserSettingConstants.PreviewScanCount, this.SelectedPreviewCount); - userSettingService.SetUserSetting(ASUserSettingConstants.X264Step, double.Parse(this.SelectedGranulairty)); + userSettingService.SetUserSetting(ASUserSettingConstants.X264Step, double.Parse(this.SelectedGranulairty, CultureInfo.InvariantCulture)); int value; if (int.TryParse(this.MinLength.ToString(), out value)) diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml index 4b68d6b3e..0b8347c0b 100644 --- a/win/CS/HandBrakeWPF/Views/MainView.xaml +++ b/win/CS/HandBrakeWPF/Views/MainView.xaml @@ -267,7 +267,7 @@