diff options
author | sr55 <[email protected]> | 2013-11-19 22:41:36 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2013-11-19 22:41:36 +0000 |
commit | f0dbe6e2a2af173e60a20da86c78692757e69112 (patch) | |
tree | 5c7e67c77449b3839654e2d34e1105faec5ed114 /win/CS/HandBrakeWPF/ViewModels | |
parent | 830bb18b173a1c68720eb0df2ed860daea7d4c7e (diff) |
WinGui: Finish off moving the User Settings service to the UI Layer.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5898 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels')
9 files changed, 59 insertions, 54 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs index 61c2d4a22..296b1faa4 100644 --- a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs @@ -26,6 +26,7 @@ namespace HandBrakeWPF.ViewModels using HandBrakeWPF.Commands;
using HandBrakeWPF.Model;
+ using HandBrakeWPF.Services.Interfaces;
using HandBrakeWPF.ViewModels.Interfaces;
/// <summary>
diff --git a/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs index 6344e262b..b8f2a265b 100644 --- a/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs @@ -22,6 +22,7 @@ namespace HandBrakeWPF.ViewModels using HandBrake.ApplicationServices.Parsing;
using HandBrake.ApplicationServices.Services.Interfaces;
+ using HandBrakeWPF.Services.Interfaces;
using HandBrakeWPF.ViewModels.Interfaces;
using LumenWorks.Framework.IO.Csv;
diff --git a/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs index de08398bb..e5d825ba4 100644 --- a/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs @@ -19,6 +19,7 @@ namespace HandBrakeWPF.ViewModels using HandBrake.ApplicationServices.Utilities;
using HandBrake.Interop.Model.Encoding;
+ using HandBrakeWPF.Services.Interfaces;
using HandBrakeWPF.ViewModels.Interfaces;
/// <summary>
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index d20657728..dc87292d9 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -1258,7 +1258,7 @@ namespace HandBrakeWPF.ViewModels // Check if we already have jobs, and if we do, just start the queue.
if (this.queueProcessor.Count != 0)
{
- this.queueProcessor.Start();
+ this.queueProcessor.Start(UserSettingService.GetUserSetting<bool>(UserSettingConstants.ClearCompletedFromQueue));
return;
}
@@ -1287,7 +1287,7 @@ namespace HandBrakeWPF.ViewModels // Create the Queue Task and Start Processing
QueueTask task = new QueueTask(new EncodeTask(this.CurrentTask), HBConfigurationFactory.Create());
this.queueProcessor.Add(task);
- this.queueProcessor.Start();
+ this.queueProcessor.Start(UserSettingService.GetUserSetting<bool>(UserSettingConstants.ClearCompletedFromQueue));
this.IsEncoding = true;
}
@@ -1572,8 +1572,7 @@ namespace HandBrakeWPF.ViewModels PlistUtility.Export(
savefiledialog.FileName,
this.selectedPreset,
- this.userSettingService.GetUserSetting<int>(ASUserSettingConstants.HandBrakeBuild)
- .ToString(CultureInfo.InvariantCulture));
+ this.userSettingService.GetUserSetting<int>(UserSettingConstants.HandBrakeBuild).ToString(CultureInfo.InvariantCulture));
}
}
else
diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index 122914d13..f8a86494e 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -1953,7 +1953,7 @@ namespace HandBrakeWPF.ViewModels // Minimise to Tray
this.MinimiseToTray = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.MainWindowMinimize);
this.DisablePresetUpdateCheckNotification = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.PresetNotification);
- this.ClearQueueOnEncodeCompleted = userSettingService.GetUserSetting<bool>(ASUserSettingConstants.ClearCompletedFromQueue);
+ this.ClearQueueOnEncodeCompleted = userSettingService.GetUserSetting<bool>(UserSettingConstants.ClearCompletedFromQueue);
this.ShowAdvancedTab = userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowAdvancedTab);
// Set the preview count
@@ -2052,7 +2052,7 @@ namespace HandBrakeWPF.ViewModels /* Advanced */
userSettingService.SetUserSetting(UserSettingConstants.MainWindowMinimize, this.MinimiseToTray);
userSettingService.SetUserSetting(UserSettingConstants.PresetNotification, this.DisablePresetUpdateCheckNotification);
- userSettingService.SetUserSetting(ASUserSettingConstants.ClearCompletedFromQueue, this.ClearQueueOnEncodeCompleted);
+ userSettingService.SetUserSetting(UserSettingConstants.ClearCompletedFromQueue, this.ClearQueueOnEncodeCompleted);
userSettingService.SetUserSetting(UserSettingConstants.PreviewScanCount, this.SelectedPreviewCount);
userSettingService.SetUserSetting(UserSettingConstants.X264Step, double.Parse(this.SelectedGranulairty, CultureInfo.InvariantCulture));
userSettingService.SetUserSetting(UserSettingConstants.ShowAdvancedTab, this.ShowAdvancedTab);
diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs index aa390eaa6..59ce20942 100644 --- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs @@ -22,6 +22,7 @@ namespace HandBrakeWPF.ViewModels using HandBrake.Interop.Model.Encoding;
using HandBrakeWPF.Helpers;
+ using HandBrakeWPF.Services.Interfaces;
using HandBrakeWPF.ViewModels.Interfaces;
using Size = System.Drawing.Size;
diff --git a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs index 972c46d94..e89ecc4cd 100644 --- a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs @@ -304,7 +304,7 @@ namespace HandBrakeWPF.ViewModels this.JobsPending = string.Format("{0} jobs pending", this.queueProcessor.Count);
this.IsEncoding = true;
- this.queueProcessor.Start();
+ this.queueProcessor.Start(UserSettingService.GetUserSetting<bool>(UserSettingConstants.ClearCompletedFromQueue));
}
/// <summary>
diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs index a40e76a46..d12798fef 100644 --- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs @@ -30,6 +30,7 @@ namespace HandBrakeWPF.ViewModels using HandBrakeWPF.Commands.Interfaces;
using HandBrakeWPF.Properties;
+ using HandBrakeWPF.Services.Interfaces;
using HandBrakeWPF.ViewModels.Interfaces;
/// <summary>
@@ -983,53 +984,53 @@ namespace HandBrakeWPF.ViewModels this.NotifyOfPropertyChange(() => this.Task);
- if (preset.Task != null) - { - this.SetEncoder(preset.Task.VideoEncoder); - - // applies to both x264 and QSV - if (preset.Task.VideoEncoder == VideoEncoder.X264 || - preset.Task.VideoEncoder == VideoEncoder.QuickSync) - { - this.H264Profile = preset.Task.H264Profile; - this.H264Level = preset.Task.H264Level; - } - else - { - this.H264Profile = x264Profile.None; - this.H264Level = "Auto"; - } - - // x264 Only - if (preset.Task.VideoEncoder == VideoEncoder.X264) - { - this.X264PresetValue = (int)preset.Task.X264Preset; - this.X264Tune = preset.Task.X264Tune; - this.FastDecode = preset.Task.FastDecode; - } - else - { - this.X264PresetValue = (int)x264Preset.Medium; - this.X264Tune = x264Tune.None; - this.FastDecode = false; - } - - // QSV Only - if (preset.Task.VideoEncoder == VideoEncoder.QuickSync) - { - this.QsvPresetValue = (int)preset.Task.QsvPreset; - } - else - { - this.QsvPresetValue = SystemInfo.IsHswOrNewer - ? (int)QsvPreset.Quality - : (int)QsvPreset.Balanced; - } - - this.ExtraArguments = preset.Task.ExtraAdvancedArguments; - this.UseAdvancedTab = !string.IsNullOrEmpty(preset.Task.AdvancedEncoderOptions) && this.ShowAdvancedTab; - } - } + if (preset.Task != null)
+ {
+ this.SetEncoder(preset.Task.VideoEncoder);
+
+ // applies to both x264 and QSV
+ if (preset.Task.VideoEncoder == VideoEncoder.X264 ||
+ preset.Task.VideoEncoder == VideoEncoder.QuickSync)
+ {
+ this.H264Profile = preset.Task.H264Profile;
+ this.H264Level = preset.Task.H264Level;
+ }
+ else
+ {
+ this.H264Profile = x264Profile.None;
+ this.H264Level = "Auto";
+ }
+
+ // x264 Only
+ if (preset.Task.VideoEncoder == VideoEncoder.X264)
+ {
+ this.X264PresetValue = (int)preset.Task.X264Preset;
+ this.X264Tune = preset.Task.X264Tune;
+ this.FastDecode = preset.Task.FastDecode;
+ }
+ else
+ {
+ this.X264PresetValue = (int)x264Preset.Medium;
+ this.X264Tune = x264Tune.None;
+ this.FastDecode = false;
+ }
+
+ // QSV Only
+ if (preset.Task.VideoEncoder == VideoEncoder.QuickSync)
+ {
+ this.QsvPresetValue = (int)preset.Task.QsvPreset;
+ }
+ else
+ {
+ this.QsvPresetValue = SystemInfo.IsHswOrNewer
+ ? (int)QsvPreset.Quality
+ : (int)QsvPreset.Balanced;
+ }
+
+ this.ExtraArguments = preset.Task.ExtraAdvancedArguments;
+ this.UseAdvancedTab = !string.IsNullOrEmpty(preset.Task.AdvancedEncoderOptions) && this.ShowAdvancedTab;
+ }
+ }
/// <summary>
/// Update all the UI controls based on the encode task passed in.
diff --git a/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs b/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs index 7a13881dc..301e161dd 100644 --- a/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs +++ b/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs @@ -14,6 +14,7 @@ namespace HandBrakeWPF.ViewModels using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrakeWPF.Helpers;
+ using HandBrakeWPF.Services.Interfaces;
using HandBrakeWPF.ViewModels.Interfaces;
/// <summary>
|