diff options
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 6c5576442..80b56edea 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -24,6 +24,7 @@ namespace HandBrakeWPF.ViewModels using Caliburn.Micro;
using HandBrake.ApplicationServices;
+ using HandBrake.ApplicationServices.Exceptions;
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Model.Encoding;
using HandBrake.ApplicationServices.Parsing;
@@ -290,7 +291,7 @@ namespace HandBrakeWPF.ViewModels // File Menu Item
- MenuItem titleSpecific = new MenuItem {Header = new TextBlock { Text = "Title Specific Scan", Margin = new Thickness(8, 0, 0, 0), VerticalAlignment = VerticalAlignment.Center }};
+ MenuItem titleSpecific = new MenuItem { Header = new TextBlock { Text = "Title Specific Scan", Margin = new Thickness(8, 0, 0, 0), VerticalAlignment = VerticalAlignment.Center } };
MenuItem titleSpecificFolder = new MenuItem
{
@@ -599,7 +600,10 @@ namespace HandBrakeWPF.ViewModels this.SelectedPointToPoint = PointToPointMode.Chapters;
this.SelectedAngle = 1;
- this.CurrentTask.Destination = AutoNameHelper.AutoName(this.CurrentTask, this.SourceName);
+ if (this.UserSettingService.GetUserSetting<bool>(UserSettingConstants.AutoNaming))
+ {
+ this.CurrentTask.Destination = AutoNameHelper.AutoName(this.CurrentTask, this.SourceName);
+ }
this.NotifyOfPropertyChange(() => this.CurrentTask);
this.Duration = selectedTitle.Duration.ToString();
@@ -813,7 +817,7 @@ namespace HandBrakeWPF.ViewModels QueueTask task = new QueueTask
{
- Task = this.CurrentTask,
+ Task = new EncodeTask(this.CurrentTask),
Query = QueryGeneratorUtility.GenerateQuery(this.CurrentTask)
};
this.queueProcessor.QueueManager.Add(task);
@@ -825,6 +829,30 @@ namespace HandBrakeWPF.ViewModels }
/// <summary>
+ /// Add all Items to the queue
+ /// </summary>
+ public void AddAllToQueue()
+ {
+ if (this.ScannedSource == null || this.ScannedSource.Titles == null || this.ScannedSource.Titles.Count == 0)
+ {
+ this.errorService.ShowMessageBox("You must first scan a source and setup your job before adding to the queue.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
+ return;
+ }
+
+ if (!AutoNameHelper.IsAutonamingEnabled())
+ {
+ this.errorService.ShowMessageBox("You must turn on automatic file naming in preferences before you can add to the queue.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
+ return;
+ }
+
+ foreach (Title title in this.ScannedSource.Titles)
+ {
+ this.SelectedTitle = title;
+ this.AddToQueue();
+ }
+ }
+
+ /// <summary>
/// Folder Scan
/// </summary>
public void FolderScan()
@@ -888,7 +916,6 @@ namespace HandBrakeWPF.ViewModels }
}
-
/// <summary>
/// Cancel a Scan
/// </summary>
|