diff options
author | sr55 <[email protected]> | 2020-01-18 20:28:15 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2020-01-25 15:27:35 +0000 |
commit | 976acecc2e719560ad2b7833b63ba073ce187d77 (patch) | |
tree | 30f3ca4143c8bad372cb9281551b89ec1537c95e | |
parent | adc076e62dc1a448df5e83004238eec1a4d9ba4f (diff) |
WinGui: Clear queue options should not clear in-progress jobs. Fixes #2587
(cherry picked from commit 97424db9a6b116054ec31f4a6f1aee8a95e090da)
-rw-r--r-- | win/CS/HandBrakeWPF/Services/Queue/QueueService.cs | 5 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs b/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs index 5599953c1..27b66379e 100644 --- a/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs +++ b/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs @@ -222,11 +222,13 @@ namespace HandBrakeWPF.Services.Queue public void Clear() { - List<QueueTask> deleteList = this.queue.ToList(); + List<QueueTask> deleteList = this.queue.Where(i => i.Status != QueueItemStatus.InProgress).ToList(); + foreach (QueueTask item in deleteList) { this.queue.Remove(item); } + this.InvokeQueueChanged(EventArgs.Empty); } @@ -241,6 +243,7 @@ namespace HandBrakeWPF.Services.Queue { this.queue.Remove(item); } + this.InvokeQueueChanged(EventArgs.Empty); }); } diff --git a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs index 1a0c67b61..6d9ccdfec 100644 --- a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs @@ -305,7 +305,7 @@ namespace HandBrakeWPF.ViewModels public void Clear()
{
MessageBoxResult result = this.errorService.ShowMessageBox(
- Resources.QueueViewModel_ClearQueueConfrimation, Resources.Confirm, MessageBoxButton.YesNo, MessageBoxImage.Warning);
+ Resources.QueueViewModel_ClearQueueConfrimation, Resources.Confirm, MessageBoxButton.YesNo, MessageBoxImage.Question);
if (result == MessageBoxResult.Yes)
{
this.queueProcessor.Clear();
@@ -399,7 +399,7 @@ namespace HandBrakeWPF.ViewModels return;
}
- List<QueueTask> tasksToRemove = this.SelectedItems.ToList();
+ List<QueueTask> tasksToRemove = this.SelectedItems.Where(i => i.Status != QueueItemStatus.InProgress).ToList();
foreach (QueueTask job in tasksToRemove)
{
this.RemoveJob(job);
|