mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Planner: Autom. move first datapoint gas to first gaslist position
In the planner it is best practise to start the dive with the first gas in the gaslist. Otherwise one would get a gaschange event at the very beginning of a dive. This change implements the following feature: Automatically move a gas to position 0 in the gaslist if the user selects this gas for the first dive data point. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
parent
73d2ab8099
commit
24bd5a8dce
3 changed files with 25 additions and 0 deletions
|
@ -337,6 +337,9 @@ bool DivePlannerPointsModel::setData(const QModelIndex &index, const QVariant &v
|
|||
case GAS:
|
||||
if (value.toInt() >= 0 && value.toInt() < MAX_CYLINDERS)
|
||||
p.cylinderid = value.toInt();
|
||||
/* Did we change the start (dp 0) cylinder to another cylinderid than 0? */
|
||||
if (value.toInt() != 0 && index.row() == 0)
|
||||
CylindersModel::instance()->moveAtFirst(value.toInt());
|
||||
CylindersModel::instance()->updateTrashIcon();
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue