mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
QML UI: handle editing of depth
Getting closer to being able to really edit / add dives in the mobile UI. This works for manually added dives - needs a bit more thought for dives downloaded from dive computers as we don't necessarily want to change the maxdepth in conflict with the samples. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
2c28b16b26
commit
a0aa27e864
6 changed files with 45 additions and 1 deletions
|
@ -361,6 +361,16 @@ void QMLManager::commitChanges(QString diveId, QString location, QString gps, QS
|
|||
}
|
||||
d->duration.seconds = h * 3600 + m * 60 + s;
|
||||
}
|
||||
if (get_depth_string(d->maxdepth.mm, true, true) != depth) {
|
||||
diveChanged = true;
|
||||
if (depth.contains(tr("ft")))
|
||||
prefs.units.length = units::FEET;
|
||||
else if (depth.contains(tr("m")))
|
||||
prefs.units.length = units::METERS;
|
||||
d->maxdepth.mm = parseLengthToMm(depth);
|
||||
if (same_string(d->dc.model, "manually added dive"))
|
||||
d->dc.maxdepth.mm = d->maxdepth.mm;
|
||||
}
|
||||
if (get_temperature_string(d->airtemp) != airtemp) {
|
||||
diveChanged = true;
|
||||
if (airtemp.contains(tr("C")))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue