diff options
author | sr55 <[email protected]> | 2018-07-18 22:28:13 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2018-07-18 22:28:27 +0100 |
commit | 3e41c7995374e71e9d61b0dce4ac59066a261599 (patch) | |
tree | c7e643e1e5df2ab9d3bb78740c4f6ad740efba31 /win/CS/HandBrakeWPF/ViewModels | |
parent | 45f24decdf2bb41c8eac24ead218d05fbd92955a (diff) |
WinGui: Move UserSettings over to JSON format. Settings from the older XML format will automatically transfer and the legacy files will be removed.
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs | 12 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs | 8 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs | 10 |
3 files changed, 15 insertions, 15 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index 3ad88a97e..736d67e69 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -1325,7 +1325,7 @@ namespace HandBrakeWPF.ViewModels this.checkForUpdatesFrequencies.Add("Weekly");
this.checkForUpdatesFrequencies.Add("Monthly");
- this.CheckForUpdatesFrequency = this.userSettingService.GetUserSetting<int>(UserSettingConstants.DaysBetweenUpdateCheck);
+ this.CheckForUpdatesFrequency = this.userSettingService.GetUserSetting<int>(UserSettingConstants.DaysBetweenUpdateCheck, typeof(int));
if (this.CheckForUpdatesFrequency > 1)
{
this.CheckForUpdatesFrequency = 1;
@@ -1380,7 +1380,7 @@ namespace HandBrakeWPF.ViewModels this.mp4ExtensionOptions.Add("Automatic");
this.mp4ExtensionOptions.Add("Always use MP4");
this.mp4ExtensionOptions.Add("Always use M4V");
- this.SelectedMp4Extension = this.userSettingService.GetUserSetting<int>(UserSettingConstants.UseM4v);
+ this.SelectedMp4Extension = this.userSettingService.GetUserSetting<int>(UserSettingConstants.UseM4v, typeof(int));
// Remove Underscores
this.RemoveUnderscores = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.AutoNameRemoveUnderscore);
@@ -1400,7 +1400,7 @@ namespace HandBrakeWPF.ViewModels // Video
// #############################
this.EnableQuickSyncDecoding = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableQuickSyncDecoding);
- this.SelectedScalingMode = this.userSettingService.GetUserSetting<VideoScaler>(UserSettingConstants.ScalingMode);
+ this.SelectedScalingMode = this.userSettingService.GetUserSetting<VideoScaler>(UserSettingConstants.ScalingMode, typeof(int));
this.UseQSVDecodeForNonQSVEnc = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.UseQSVDecodeForNonQSVEnc);
this.EnableQuickSyncEncoding = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableQuickSyncEncoding);
@@ -1429,7 +1429,7 @@ namespace HandBrakeWPF.ViewModels this.logVerbosityOptions.Add(0);
this.logVerbosityOptions.Add(1);
this.logVerbosityOptions.Add(2);
- this.SelectedVerbosity = userSettingService.GetUserSetting<int>(UserSettingConstants.Verbosity);
+ this.SelectedVerbosity = userSettingService.GetUserSetting<int>(UserSettingConstants.Verbosity, typeof(int));
// Logs
this.CopyLogToEncodeDirectory = userSettingService.GetUserSetting<bool>(UserSettingConstants.SaveLogWithVideo);
@@ -1462,7 +1462,7 @@ namespace HandBrakeWPF.ViewModels this.PreviewPicturesToScan.Add(50);
this.PreviewPicturesToScan.Add(55);
this.PreviewPicturesToScan.Add(60);
- this.SelectedPreviewCount = this.userSettingService.GetUserSetting<int>(UserSettingConstants.PreviewScanCount);
+ this.SelectedPreviewCount = this.userSettingService.GetUserSetting<int>(UserSettingConstants.PreviewScanCount, typeof(int));
// x264 step
this.ConstantQualityGranularity.Clear();
@@ -1472,7 +1472,7 @@ namespace HandBrakeWPF.ViewModels this.SelectedGranulairty = userSettingService.GetUserSetting<double>(UserSettingConstants.X264Step).ToString("0.00", CultureInfo.InvariantCulture);
// Min Title Length
- this.MinLength = this.userSettingService.GetUserSetting<int>(UserSettingConstants.MinScanDuration);
+ this.MinLength = this.userSettingService.GetUserSetting<int>(UserSettingConstants.MinScanDuration, typeof(int));
// Use dvdnav
this.DisableLibdvdNav = userSettingService.GetUserSetting<bool>(UserSettingConstants.DisableLibDvdNav);
diff --git a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs index f3e9593be..bbb60f878 100644 --- a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs @@ -151,7 +151,7 @@ namespace HandBrakeWPF.ViewModels this.CanPlay = true;
UseSystemDefaultPlayer = userSettingService.GetUserSetting<bool>(UserSettingConstants.DefaultPlayer);
- this.Duration = userSettingService.GetUserSetting<int>(UserSettingConstants.LastPreviewDuration);
+ this.Duration = userSettingService.GetUserSetting<int>(UserSettingConstants.LastPreviewDuration, typeof(int));
}
#endregion
@@ -238,7 +238,7 @@ namespace HandBrakeWPF.ViewModels {
get
{
- return this.userSettingService.GetUserSetting<int>(UserSettingConstants.PreviewScanCount) - 1;
+ return this.userSettingService.GetUserSetting<int>(UserSettingConstants.PreviewScanCount, typeof(int)) - 1;
}
}
@@ -345,7 +345,7 @@ namespace HandBrakeWPF.ViewModels {
List<int> startPoints = new List<int>();
for (int i = 1;
- i <= this.userSettingService.GetUserSetting<int>(UserSettingConstants.PreviewScanCount);
+ i <= this.userSettingService.GetUserSetting<int>(UserSettingConstants.PreviewScanCount, typeof(int));
i++)
{
startPoints.Add(i);
@@ -428,7 +428,7 @@ namespace HandBrakeWPF.ViewModels public void NextPreview()
{
- int maxPreview = this.userSettingService.GetUserSetting<int>(UserSettingConstants.PreviewScanCount);
+ int maxPreview = this.userSettingService.GetUserSetting<int>(UserSettingConstants.PreviewScanCount, typeof(int));
if ((this.SelectedPreviewImage + 1) == maxPreview)
{
return;
diff --git a/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs index 18260ec29..b3e176245 100644 --- a/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs @@ -368,7 +368,7 @@ namespace HandBrakeWPF.ViewModels public void NextPreview() { - int maxPreview = this.userSettingService.GetUserSetting<int>(UserSettingConstants.PreviewScanCount); + int maxPreview = this.userSettingService.GetUserSetting<int>(UserSettingConstants.PreviewScanCount, typeof(int)); if (this.selectedPreview == maxPreview) { return; @@ -384,7 +384,7 @@ namespace HandBrakeWPF.ViewModels public void PreviousPreview() { - int maxPreview = this.userSettingService.GetUserSetting<int>(UserSettingConstants.PreviewScanCount); + int maxPreview = this.userSettingService.GetUserSetting<int>(UserSettingConstants.PreviewScanCount, typeof(int)); if (this.selectedPreview <= 1) { return; @@ -409,7 +409,7 @@ namespace HandBrakeWPF.ViewModels this.IsPreviousPreviewControlVisible = false; } - if (this.selectedPreview < this.userSettingService.GetUserSetting<int>(UserSettingConstants.PreviewScanCount)) + if (this.selectedPreview < this.userSettingService.GetUserSetting<int>(UserSettingConstants.PreviewScanCount, typeof(int))) { this.IsNextPreviewControlVisible = true; } @@ -440,7 +440,7 @@ namespace HandBrakeWPF.ViewModels // Make sure the output extension is set correctly based on the users preferences and selection. if (newExtension == ".mp4" || newExtension == ".m4v") { - switch (this.userSettingService.GetUserSetting<int>(UserSettingConstants.UseM4v)) + switch (this.userSettingService.GetUserSetting<int>(UserSettingConstants.UseM4v, typeof(int))) { case 0: // Auto newExtension = MP4Helper.RequiresM4v(this.Task) ? ".m4v" : ".mp4"; @@ -506,7 +506,7 @@ namespace HandBrakeWPF.ViewModels this.NotifyOfPropertyChange(() => this.AspectInfo); // Preview - this.PreviewInfo = string.Format(ResourcesUI.SummaryView_PreviewInfo, this.selectedPreview, this.userSettingService.GetUserSetting<int>(UserSettingConstants.PreviewScanCount)); + this.PreviewInfo = string.Format(ResourcesUI.SummaryView_PreviewInfo, this.selectedPreview, this.userSettingService.GetUserSetting<int>(UserSettingConstants.PreviewScanCount, typeof(int))); this.NotifyOfPropertyChange(() => this.PreviewInfo); this.ShowPreview = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowPreviewOnSummaryTab); |