diff options
author | sr55 <[email protected]> | 2018-09-24 21:07:56 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2018-09-24 21:07:56 +0100 |
commit | b115733f3a3e898fb53690f8562872bc0e1fe9f5 (patch) | |
tree | f08ec3bb0478b05fdff8bcd70fe6b9d8c1aca420 /win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs | |
parent | f4e9383fd7a26831995f84542ec83254c708c0e3 (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.cs | 10 |
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();
}
}
|