From cd5085da6ab11a2dac5b92170a3aa894ef0c09ef Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 1 Sep 2013 15:31:24 +0000 Subject: WinGui: Fix an issue with the Seconds mode (not setting end point correctly) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5762 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'win') diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index fef4b1cdd..213b2118b 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -706,7 +706,7 @@ namespace HandBrakeWPF.ViewModels } this.NotifyOfPropertyChange(() => this.CurrentTask); - this.Duration = this.selectedTitle.Duration.ToString(); + this.Duration = this.selectedTitle.Duration.ToString("g"); // Setup the tab controls this.SetupTabs(); @@ -830,7 +830,7 @@ namespace HandBrakeWPF.ViewModels this.SelectedStartPoint = 0; int timeInSeconds; - if (int.TryParse(selectedTitle.Duration.TotalSeconds.ToString(CultureInfo.InvariantCulture), out timeInSeconds)) + if (int.TryParse(Math.Round(selectedTitle.Duration.TotalSeconds, 0).ToString(CultureInfo.InvariantCulture), out timeInSeconds)) { this.SelectedEndPoint = timeInSeconds; } @@ -1777,12 +1777,12 @@ namespace HandBrakeWPF.ViewModels switch (this.SelectedPointToPoint) { case PointToPointMode.Chapters: - return this.SelectedTitle.CalculateDuration(this.SelectedStartPoint, this.SelectedEndPoint).ToString(); + return this.SelectedTitle.CalculateDuration(this.SelectedStartPoint, this.SelectedEndPoint).ToString("g"); case PointToPointMode.Seconds: - return TimeSpan.FromSeconds(startEndDuration).ToString(); + return TimeSpan.FromSeconds(startEndDuration).ToString("g"); case PointToPointMode.Frames: startEndDuration = startEndDuration / selectedTitle.Fps; - return TimeSpan.FromSeconds(startEndDuration).ToString(); + return TimeSpan.FromSeconds(Math.Round(startEndDuration, 2)).ToString("g"); } return "--:--:--"; -- cgit v1.2.3