mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Planner: Change segment setpoint according to divemode
When making a segment non-CCR, its setpoint should be 0. OTOH, when it becomes CCR, use the default setpoint (or should we try to find the last previous setpoint?) Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
parent
c64e4b159f
commit
0f77d73df2
1 changed files with 3 additions and 1 deletions
|
@ -337,8 +337,10 @@ bool DivePlannerPointsModel::setData(const QModelIndex &index, const QVariant &v
|
||||||
CylindersModel::instance()->updateTrashIcon();
|
CylindersModel::instance()->updateTrashIcon();
|
||||||
break;
|
break;
|
||||||
case DIVEMODE:
|
case DIVEMODE:
|
||||||
if (value.toInt() < FREEDIVE) // FIXME: I want to be a combo box and translate strings to enum values
|
if (value.toInt() < FREEDIVE) {
|
||||||
p.divemode = (enum divemode_t) value.toInt();
|
p.divemode = (enum divemode_t) value.toInt();
|
||||||
|
p.setpoint = p.divemode == CCR ? prefs.defaultsetpoint : 0;
|
||||||
|
}
|
||||||
if (index.row() == 0)
|
if (index.row() == 0)
|
||||||
displayed_dive.dc.divemode = (enum divemode_t) value.toInt();
|
displayed_dive.dc.divemode = (enum divemode_t) value.toInt();
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue