summaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-11 18:13:55 +0900
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-11 18:13:55 +0900
commitcd1149e57fb077c2f3dbf0fce7a1a9478feb6743 (patch)
tree995a2715515608e9adbca6206b829f5ba75639e9 /qt-ui/diveplanner.cpp
parent0a8892379d20c0ee81dd4339019b5d4b1468194e (diff)
downloadsubsurface-cd1149e57fb077c2f3dbf0fce7a1a9478feb6743.tar.gz
When entering a new point, pick the previous gas by default
This is much more useful than always picking air. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r--qt-ui/diveplanner.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index e31d88583..14118c519 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -1169,7 +1169,10 @@ int DivePlannerPointsModel::addStop(int milimeters, int minutes, int o2, int he,
break;
}
}
-
+ if (row > 1 && o2 == -1) { // this means "take the current gas"
+ o2 = divepoints.at(row - 1).o2;
+ he = divepoints.at(row - 1).he;
+ }
// add the new stop
beginInsertRows(QModelIndex(), row, row);
divedatapoint point;