diff options
author | sr55 <[email protected]> | 2013-05-24 19:13:09 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2013-05-24 19:13:09 +0000 |
commit | 0a535389348c04fb8f2ccae1fcf37215d2072f80 (patch) | |
tree | bbd34872576979d16f8193cc31d112bffc25fede /win/CS/HandBrake.ApplicationServices | |
parent | 70ea64b335ed39cb8e2584b64229ab3a9ee6d21f (diff) |
WinGui: Some usability improvements and bug fixes around the queue window.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5510 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices')
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs b/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs index 92f69142c..a8cb55f58 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs @@ -51,6 +51,11 @@ namespace HandBrake.ApplicationServices.Services /// </summary>
private string queueFile;
+ /// <summary>
+ /// The is paused.
+ /// </summary>
+ private bool isPaused;
+
#endregion
#region Constructors and Destructors
@@ -236,15 +241,15 @@ namespace HandBrake.ApplicationServices.Services {
Execute.OnUIThread(
() =>
+ {
+ List<QueueTask> deleteList =
+ this.queue.Where(task => task.Status == QueueItemStatus.Completed).ToList();
+ foreach (QueueTask item in deleteList)
{
- List<QueueTask> deleteList =
- this.queue.Where(task => task.Status == QueueItemStatus.Completed).ToList();
- foreach (QueueTask item in deleteList)
- {
- this.queue.Remove(item);
- }
- this.InvokeQueueChanged(EventArgs.Empty);
- });
+ this.queue.Remove(item);
+ }
+ this.InvokeQueueChanged(EventArgs.Empty);
+ });
}
/// <summary>
@@ -379,8 +384,8 @@ namespace HandBrake.ApplicationServices.Services catch (Exception exc)
{
throw new GeneralApplicationException(
- "Unable to restore queue file.",
- "The file may be corrupted or from an older incompatible version of HandBrake",
+ "Unable to restore queue file.",
+ "The file may be corrupted or from an older incompatible version of HandBrake",
exc);
}
@@ -419,6 +424,7 @@ namespace HandBrake.ApplicationServices.Services {
this.InvokeQueuePaused(EventArgs.Empty);
this.IsProcessing = false;
+ this.isPaused = true;
}
/// <summary>
@@ -432,9 +438,16 @@ namespace HandBrake.ApplicationServices.Services throw new Exception("Already Processing the Queue");
}
- this.IsProcessing = true;
+ this.EncodeService.EncodeCompleted -= this.EncodeServiceEncodeCompleted;
this.EncodeService.EncodeCompleted += this.EncodeServiceEncodeCompleted;
- this.ProcessNextJob();
+
+ if (!this.EncodeService.IsEncoding)
+ {
+ this.ProcessNextJob();
+ }
+
+ this.IsProcessing = true;
+ this.isPaused = false;
}
#endregion
|