Fix not updating out gate if only segment changed but not the gate
itself. This scenario happens when database is corrupted (maybe because
segment changed track number while jobs where already set on it)
When deleting all session's jobs we do not emit signals for every single
job, so we need to manually reload things.
Close jobs views of rollingstock, shift and stations because they would
be empty.
clearJobs() needs to update() SSPViewer view in order to show changes.
Since we call it also from reloadJobs(), instead of having 2 calls to
update view, we split in public and internal function.
Delay LineGraphScene reload
When we will have multiple line views, updating should be done in event loop to avoid freezing the UI.
- Do batch updates, cumulate all changes to every scene and then update only once (saves time)
- Fix scene not correctly updated in some cases (e.g. changing Job ID without other modifications didn't trigger update)
- LineGraphScene: light update when only station names change but not the rest.
Do not select also RS which are correctly uncoupled at last stop, so
they are not needlessly updated.
Select rollingstock item which are coupled at last stop, which need to
be uncoupled (or removed by user)
So REPLACE instead of IGNORE for such cases.
Renamed stationJobsPlanChanged()
Added stationTrackPlanChanged()
When only Jobs change there is no need to fully reload graphs.
LineGraphManager: use common implementation to react to this new signal
- Renamed stationPlanChanged() to onStationJobPlanChanged()
- Schedule update instad of updating immediatly so we can do cumulative
updates on a single scene
- Added some comments
If we skip a stop, arrival of next stops might get shifted wrongly.
Insetead just do not set Transit type on stops which (un)couple
rollingstock items but still shift them as needed.
Modify StopModel::loadJobStops() to return false for invalid jobs.
Clear JobPathEditor, disable it and show error to user.
This avoids confusing empty job which does not exist, but for which
JobPathEditor would ask user to save changes or delete because it has no
stops.
But the job does not exist so it cannot be removed nor it's changes
saved which would produce further error messages and really confuse the
user about what is happening.
When user forgets to add segment name, on save try to build a default
one and let user decide if it's good otherwise go back and let user
choose a different name
Update model explicitly when segment is set, so it gets called only once
at end of dialog setup.
Then call it when user changes data rather than also when program
changes data.
When database gets corrupted, or there is some bug in program logic,
user would be unable to add a connection and thus unable to close dialog
because railway segment cannot have zero connections.
This is quite frustrating behaviour, expecially for user with low
understanding of program internals