From 60f0a6693164d25b21676711835abe8f0e0d40c3 Mon Sep 17 00:00:00 2001 From: sr55 Date: Wed, 10 Oct 2012 20:22:46 +0000 Subject: WinGui: Settings tidyup git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5013 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/HandBrakeWPF/Helpers/CliCheckHelper.cs | 10 +++++----- win/CS/HandBrakeWPF/Services/UpdateService.cs | 2 +- win/CS/HandBrakeWPF/Services/UpdateVersionService.cs | 10 +++++----- win/CS/HandBrakeWPF/UserSettingConstants.cs | 20 ++++++++++++++++++++ win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs | 4 ++-- win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs | 6 +++--- 6 files changed, 36 insertions(+), 16 deletions(-) (limited to 'win/CS/HandBrakeWPF') diff --git a/win/CS/HandBrakeWPF/Helpers/CliCheckHelper.cs b/win/CS/HandBrakeWPF/Helpers/CliCheckHelper.cs index da349c417..ee0df3b88 100644 --- a/win/CS/HandBrakeWPF/Helpers/CliCheckHelper.cs +++ b/win/CS/HandBrakeWPF/Helpers/CliCheckHelper.cs @@ -51,7 +51,7 @@ namespace HandBrakeWPF.Helpers string base64Hash = Convert.ToBase64String(hash); // Compare the hash with the last known hash. If it's the same, return. - if (userSettingService.GetUserSetting(ASUserSettingConstants.HandBrakeExeHash) == base64Hash) + if (userSettingService.GetUserSetting(UserSettingConstants.HandBrakeExeHash) == base64Hash) { return; } @@ -94,7 +94,7 @@ namespace HandBrakeWPF.Helpers if (platform.Success) { userSettingService.SetUserSetting( - ASUserSettingConstants.HandBrakePlatform, platform.Value.Replace("-", string.Empty).Trim()); + UserSettingConstants.HandBrakePlatform, platform.Value.Replace("-", string.Empty).Trim()); } } @@ -112,15 +112,15 @@ namespace HandBrakeWPF.Helpers if (success) { - userSettingService.SetUserSetting(ASUserSettingConstants.HandBrakeExeHash, base64Hash); + userSettingService.SetUserSetting(UserSettingConstants.HandBrakeExeHash, base64Hash); } } catch (Exception e) { userSettingService.SetUserSetting(ASUserSettingConstants.HandBrakeBuild, 0); - userSettingService.SetUserSetting(ASUserSettingConstants.HandBrakePlatform, string.Empty); + userSettingService.SetUserSetting(UserSettingConstants.HandBrakePlatform, string.Empty); userSettingService.SetUserSetting(ASUserSettingConstants.HandBrakeVersion, string.Empty); - userSettingService.SetUserSetting(ASUserSettingConstants.HandBrakeExeHash, string.Empty); + userSettingService.SetUserSetting(UserSettingConstants.HandBrakeExeHash, string.Empty); errorService.ShowError( "Unable to Initialise HandBrake. This error is unrecoverable.", " Try restarting.", e); diff --git a/win/CS/HandBrakeWPF/Services/UpdateService.cs b/win/CS/HandBrakeWPF/Services/UpdateService.cs index 2b6cfa852..112493ac7 100644 --- a/win/CS/HandBrakeWPF/Services/UpdateService.cs +++ b/win/CS/HandBrakeWPF/Services/UpdateService.cs @@ -87,7 +87,7 @@ namespace HandBrakeWPF.Services try { string url = - this.userSettingService.GetUserSetting(ASUserSettingConstants.HandBrakePlatform) + this.userSettingService.GetUserSetting(UserSettingConstants.HandBrakePlatform) .Contains("x86_64") ? this.userSettingService.GetUserSetting(UserSettingConstants.Appcast_x64) : this.userSettingService.GetUserSetting(UserSettingConstants.Appcast_i686); diff --git a/win/CS/HandBrakeWPF/Services/UpdateVersionService.cs b/win/CS/HandBrakeWPF/Services/UpdateVersionService.cs index 0472f9da2..e0de1d88a 100644 --- a/win/CS/HandBrakeWPF/Services/UpdateVersionService.cs +++ b/win/CS/HandBrakeWPF/Services/UpdateVersionService.cs @@ -72,7 +72,7 @@ namespace HandBrakeWPF.Services string base64Hash = Convert.ToBase64String(hash); // Compare the hash with the last known hash. If it's the same, return. - if (userSettingService.GetUserSetting(ASUserSettingConstants.HandBrakeExeHash) == base64Hash) + if (userSettingService.GetUserSetting(UserSettingConstants.HandBrakeExeHash) == base64Hash) { return; } @@ -115,7 +115,7 @@ namespace HandBrakeWPF.Services if (platform.Success) { - userSettingService.SetUserSetting(ASUserSettingConstants.HandBrakePlatform, platform.Value.Replace("-", string.Empty).Trim()); + userSettingService.SetUserSetting(UserSettingConstants.HandBrakePlatform, platform.Value.Replace("-", string.Empty).Trim()); } if (cliProcess.TotalProcessorTime.Seconds > 10) // Don't wait longer than 10 seconds. @@ -128,14 +128,14 @@ namespace HandBrakeWPF.Services } } - userSettingService.SetUserSetting(ASUserSettingConstants.HandBrakeExeHash, base64Hash); + userSettingService.SetUserSetting(UserSettingConstants.HandBrakeExeHash, base64Hash); } catch (Exception e) { userSettingService.SetUserSetting(ASUserSettingConstants.HandBrakeBuild, string.Empty); - userSettingService.SetUserSetting(ASUserSettingConstants.HandBrakePlatform, string.Empty); + userSettingService.SetUserSetting(UserSettingConstants.HandBrakePlatform, string.Empty); userSettingService.SetUserSetting(ASUserSettingConstants.HandBrakeVersion, string.Empty); - userSettingService.SetUserSetting(ASUserSettingConstants.HandBrakeExeHash, string.Empty); + userSettingService.SetUserSetting(UserSettingConstants.HandBrakeExeHash, string.Empty); this.errorService.ShowError("Unable to Initialise HandBrake", "This error is unrecoverable. Maybe try restarting.", e); diff --git a/win/CS/HandBrakeWPF/UserSettingConstants.cs b/win/CS/HandBrakeWPF/UserSettingConstants.cs index 9371dc733..fb35f0cdb 100644 --- a/win/CS/HandBrakeWPF/UserSettingConstants.cs +++ b/win/CS/HandBrakeWPF/UserSettingConstants.cs @@ -191,6 +191,26 @@ namespace HandBrakeWPF /// public const string GrowlQueue = "GrowlQueue"; + /// + /// HandBrakes CLI Exe SHA1 Hash + /// + public const string HandBrakeExeHash = "HandBrakeExeHash"; + + /// + /// The Instance Id + /// + public const string InstanceId = "InstanceId"; + + /// + /// The X264 Stepper + /// + public const string X264Step = "X264Step"; + + /// + /// HandBrakes build + /// + public const string HandBrakePlatform = "HandBrakePlatform"; + #endregion } } \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index 779e3e86a..6404188c0 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -1654,7 +1654,7 @@ namespace HandBrakeWPF.ViewModels this.ConstantQualityGranularity.Add("0.50"); this.ConstantQualityGranularity.Add("0.25"); this.ConstantQualityGranularity.Add("0.20"); - this.SelectedGranulairty = userSettingService.GetUserSetting(ASUserSettingConstants.X264Step).ToString("0.00", CultureInfo.InvariantCulture); + this.SelectedGranulairty = userSettingService.GetUserSetting(UserSettingConstants.X264Step).ToString("0.00", CultureInfo.InvariantCulture); // Min Title Length this.MinLength = this.userSettingService.GetUserSetting(ASUserSettingConstants.MinScanDuration); @@ -1872,7 +1872,7 @@ namespace HandBrakeWPF.ViewModels userSettingService.SetUserSetting(UserSettingConstants.PresetNotification, this.DisablePresetUpdateCheckNotification); userSettingService.SetUserSetting(ASUserSettingConstants.ClearCompletedFromQueue, this.ClearQueueOnEncodeCompleted); userSettingService.SetUserSetting(ASUserSettingConstants.PreviewScanCount, this.SelectedPreviewCount); - userSettingService.SetUserSetting(ASUserSettingConstants.X264Step, double.Parse(this.SelectedGranulairty, CultureInfo.InvariantCulture)); + userSettingService.SetUserSetting(UserSettingConstants.X264Step, double.Parse(this.SelectedGranulairty, CultureInfo.InvariantCulture)); int value; if (int.TryParse(this.MinLength.ToString(), out value)) diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs index b14e09ff4..9dabbd323 100644 --- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs @@ -253,7 +253,7 @@ namespace HandBrakeWPF.ViewModels { this.rf = value; - double cqStep = userSettingService.GetUserSetting(ASUserSettingConstants.X264Step); + double cqStep = userSettingService.GetUserSetting(UserSettingConstants.X264Step); this.SetQualitySliderBounds(); switch (this.SelectedVideoEncoder) { @@ -435,7 +435,7 @@ namespace HandBrakeWPF.ViewModels break; } - double cqStep = userSettingService.GetUserSetting(ASUserSettingConstants.X264Step); + double cqStep = userSettingService.GetUserSetting(UserSettingConstants.X264Step); double rfValue = 0; this.SetQualitySliderBounds(); switch (this.SelectedVideoEncoder) @@ -550,7 +550,7 @@ namespace HandBrakeWPF.ViewModels break; case VideoEncoder.X264: this.QualityMin = 0; - this.QualityMax = (int)(51 / userSettingService.GetUserSetting(ASUserSettingConstants.X264Step)); + this.QualityMax = (int)(51 / userSettingService.GetUserSetting(UserSettingConstants.X264Step)); break; case VideoEncoder.Theora: this.QualityMin = 0; -- cgit v1.2.3