Feature: Ctrl-Click on vehicle list in GB_SHARED_ORDERS opens order window #9325
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation / Problem
To figure out which vehicle group we want (e.g. to clone) when looking at a vehicle list (e.g. at a station), we need to look at the order list. However, it takes 3 clicks (from "Bardingstone Heights - 48 trains" to "Train #83 (Orders)"), which is a bit unsatisfactory:
Description
Ctrl-Click on vehicle list window
This PR implements Ctrl-Click in the vehicle list window. Ctrl-Clicking on a vehicle in the vehicle list window (when "Group by" is set to "Shared orders") will open the order list of the first vehicle sharing those orders.
Issues with group GUI window
There is a slight change in behaviour for the group GUI window:
Ctrl-Clicking on a vehicle in the group window used to select the group in which the vehicle is in, but now it doesn't do that (when "Group by" is set to "Shared orders"). Well I think that was previously a bug - since vehicles from different groups could share orders, there may not be a unique group to select.
Issues with shared order list window
The shared orders window can't be grouped by shared orders, and it is pointless to do so anyway. But it still makes sense to want to open the order window to see the list of orders. Hence this PR adds a button at the top right corner to open the order list. The button is in a similar position to the the "Orders" button in the timetable window.
Unanswered questions
Should the order window have a title that feels more like the orders are shared, such as "Shared orders of Train #83 and 9 other vehicles" instead of "Train #83 (Orders)"? Since with shared orders, we no longer think of the order list as a property of a single vehicle, but instead logically each vehicle subscribes to some (shared) order list. Apart from the "Skip" button (and possibly the "Timetable" button which I'm not too familiar with), everything else pertains to things that are shared.
Note
With the addition of this PR, it is now possible to open the orders window without first opening the associated vehicle window. When closing a vehicle window, the associated orders window is automatically closed too, so it seems that previously such a situation could never happen. This PR doesn't seem to break anything though. But it does raise the question of whether we should head towards further decoupling between the order window and the vehicle window in the future, at least when the vehicle has shared orders.
In any case, this PR can be merged without answering the unanswered questions yet, so it isn't a blocking issue.
Limitations
Not that I know of.
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.