summaryrefslogtreecommitdiffstats
path: root/qt-mobile/qml/DiveDetailsEdit.qml
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-01-01 17:23:29 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-01-01 17:26:26 -0800
commitfa338a26b8b4e390c6acc391e159dff8859dd519 (patch)
tree308b43a85884b069cc207c565a4d731097c1f421 /qt-mobile/qml/DiveDetailsEdit.qml
parent14a09689a421a32e812094b5fb99f33b99443266 (diff)
downloadsubsurface-fa338a26b8b4e390c6acc391e159dff8859dd519.tar.gz
QML UI: add feature to add current position when editing dive
This isn't quite perfect yet. If it takes too long to get the GPS fix (i.e., if you save it before you get the fix), this will simply fail and not store a position. But in normal conditions (you check the box, you edit the data, you save), especially when outside on a dive boat, this should work fine. For the other cases we need to implement some kind of callback to still collect the data. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile/qml/DiveDetailsEdit.qml')
-rw-r--r--qt-mobile/qml/DiveDetailsEdit.qml11
1 files changed, 11 insertions, 0 deletions
diff --git a/qt-mobile/qml/DiveDetailsEdit.qml b/qt-mobile/qml/DiveDetailsEdit.qml
index 051e38676..9a639ddb7 100644
--- a/qt-mobile/qml/DiveDetailsEdit.qml
+++ b/qt-mobile/qml/DiveDetailsEdit.qml
@@ -49,6 +49,17 @@ Item {
// to add the current location as the dive location
// (think of someone adding a dive while on the boat or
// at the dive site)
+ MobileComponents.Label {
+ Layout.alignment: Qt.AlignRight
+ text: "Use current\nGPS location:"
+ }
+ CheckBox {
+ id: checkboxGPS
+ onCheckedChanged: {
+ if (checked)
+ gpsText = manager.getCurrentPosition()
+ }
+ }
MobileComponents.Label {
Layout.alignment: Qt.AlignRight