summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels
diff options
context:
space:
mode:
authorsr55 <[email protected]>2012-05-20 01:11:36 +0000
committersr55 <[email protected]>2012-05-20 01:11:36 +0000
commit332f03f3f68dca799a2e50ceb7e34578ac0bcd5f (patch)
tree8763d26c3f7b77fe2a0e1b4aaf59497da720d87d /win/CS/HandBrakeWPF/ViewModels
parenta8c98d2da676d507a0754ec191d53a1122a40220 (diff)
WinGui: Initial Implementation of Add All to Queue. Fix the Queue so that it processes everything correctly rather than just the last job added.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4689 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs35
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>