diff options
author | sr55 <[email protected]> | 2020-01-18 20:28:15 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2020-01-18 20:29:34 +0000 |
commit | 97424db9a6b116054ec31f4a6f1aee8a95e090da (patch) | |
tree | 38555ef780c3e5f9a91b5ae8d4a43e04dc3f411e | |
parent | 2a64670a88521b33fcad02b8ab5752a7d0c60e0c (diff) |
WinGui: Clear queue options should not clear in-progress jobs. Fixes #2587
-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 477aacba3..c231e65ec 100644 --- a/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs +++ b/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs @@ -223,11 +223,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); } @@ -242,6 +244,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);
|