summaryrefslogtreecommitdiffstats
path: root/qt-mobile/qmlmanager.cpp
diff options
context:
space:
mode:
authorGravatar Joakim Bygdell <j.bygdell@gmail.com>2016-02-13 18:34:31 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-02-13 10:04:05 -0800
commitae116c5bc80f152f4eb5061252f52e70903398c6 (patch)
tree0d52f673e387b6e47f7c93757e990a1750e19c25 /qt-mobile/qmlmanager.cpp
parent8cc4463a1af4bbce2dd5ea61d6ab8a5b107fb3b7 (diff)
downloadsubsurface-ae116c5bc80f152f4eb5061252f52e70903398c6.tar.gz
QML UI: enable edit of gasmix
First cylinder only, show warning if there are more than one cylinder defined. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile/qmlmanager.cpp')
-rw-r--r--qt-mobile/qmlmanager.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp
index cd45d304a..422a77e06 100644
--- a/qt-mobile/qmlmanager.cpp
+++ b/qt-mobile/qmlmanager.cpp
@@ -353,7 +353,7 @@ void QMLManager::refreshDiveList()
// update the dive and return the notes field, stripped of the HTML junk
QString QMLManager::commitChanges(QString diveId, QString date, QString location, QString gps, QString duration, QString depth,
QString airtemp, QString watertemp, QString suit, QString buddy, QString diveMaster, QString weight, QString notes,
- QString startpressure, QString endpressure)
+ QString startpressure, QString endpressure, QString gasmix)
{
#define DROP_EMPTY_PLACEHOLDER(_s) if ((_s) == QLatin1Literal("--")) (_s).clear()
@@ -366,6 +366,7 @@ QString QMLManager::commitChanges(QString diveId, QString date, QString location
DROP_EMPTY_PLACEHOLDER(buddy);
DROP_EMPTY_PLACEHOLDER(diveMaster);
DROP_EMPTY_PLACEHOLDER(weight);
+ DROP_EMPTY_PLACEHOLDER(gasmix);
DROP_EMPTY_PLACEHOLDER(startpressure);
DROP_EMPTY_PLACEHOLDER(endpressure);
DROP_EMPTY_PLACEHOLDER(notes);
@@ -514,6 +515,12 @@ QString QMLManager::commitChanges(QString diveId, QString date, QString location
d->cylinder[0].start.mbar = parsePressureToMbar(startpressure);
d->cylinder[0].end.mbar = parsePressureToMbar(endpressure);
}
+ // gasmix for first cylinder
+ if (get_gas_string(d->cylinder[0].gasmix) != gasmix) {
+ diveChanged = true;
+ d->cylinder[0].gasmix.o2.permille = parseGasMixO2(gasmix);
+ d->cylinder[0].gasmix.he.permille = parseGasMixHE(gasmix);
+ }
if (!same_string(d->suit, qPrintable(suit))) {
diveChanged = true;
free(d->suit);