summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2018-09-24 21:07:56 +0100
committersr55 <[email protected]>2018-09-24 21:07:56 +0100
commitb115733f3a3e898fb53690f8562872bc0e1fe9f5 (patch)
treef08ec3bb0478b05fdff8bcd70fe6b9d8c1aca420 /win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
parentf4e9383fd7a26831995f84542ec83254c708c0e3 (diff)
WinGui: When Deleting a job, select the nearest or first item in the list to allow faster keyboard operations to manage the queue.
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
index 42dc2fef4..9ff7e6b40 100644
--- a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
@@ -405,6 +405,9 @@ namespace HandBrakeWPF.ViewModels
return;
}
+ bool removed = false;
+ int index = this.QueueTasks.IndexOf(task);
+
if (task.Status == QueueItemStatus.InProgress)
{
MessageBoxResult result =
@@ -418,11 +421,18 @@ namespace HandBrakeWPF.ViewModels
{
this.queueProcessor.EncodeService.Stop();
this.queueProcessor.Remove(task);
+ removed = true;
}
}
else
{
this.queueProcessor.Remove(task);
+ removed = true;
+ }
+
+ if (this.QueueTasks.Any() && removed)
+ {
+ this.SelectedTask = index > 1 ? this.QueueTasks[index - 1] : this.QueueTasks.FirstOrDefault();
}
}