From fa338a26b8b4e390c6acc391e159dff8859dd519 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 1 Jan 2016 17:23:29 -0800 Subject: 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 --- qt-mobile/qml/DiveDetailsEdit.qml | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'qt-mobile/qml/DiveDetailsEdit.qml') 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 -- cgit v1.2.3-70-g09d2