summaryrefslogtreecommitdiffstats
path: root/mobile-widgets
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-04-17 22:57:14 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-04-17 22:59:19 -0700
commit628f83d5cf8a5ebaf04925709520e821042b2a6c (patch)
treee5de6d1c919e9165c48001909c6ff03243371b91 /mobile-widgets
parent1819cc1ccc45192359321a09bb734a4d6ca40b2d (diff)
downloadsubsurface-628f83d5cf8a5ebaf04925709520e821042b2a6c.tar.gz
QML UI: only show GPS service / use current location if GPS accessible
If there is no GPS source or if permission to use it was denied, don't offer to run the GPS service or to detect the current location when adding or editing dives. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets')
-rw-r--r--mobile-widgets/qml/DiveDetailsEdit.qml2
-rw-r--r--mobile-widgets/qml/main.qml3
2 files changed, 4 insertions, 1 deletions
diff --git a/mobile-widgets/qml/DiveDetailsEdit.qml b/mobile-widgets/qml/DiveDetailsEdit.qml
index 3e32a2ac9..6ef006a6b 100644
--- a/mobile-widgets/qml/DiveDetailsEdit.qml
+++ b/mobile-widgets/qml/DiveDetailsEdit.qml
@@ -102,9 +102,11 @@ Item {
Kirigami.Label {
Layout.alignment: Qt.AlignRight
text: "Use current\nGPS location:"
+ visible: manager.locationServiceAvailable
}
CheckBox {
id: checkboxGPS
+ visible: manager.locationServiceAvailable
onCheckedChanged: {
if (checked)
gpsText = manager.getCurrentPosition()
diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml
index c950fd316..62a94bd0e 100644
--- a/mobile-widgets/qml/main.qml
+++ b/mobile-widgets/qml/main.qml
@@ -246,6 +246,7 @@ Kirigami.ApplicationWindow {
CheckBox {
//text: "Run location service"
id: locationCheckbox
+ visible: manager.locationServiceAvailable
anchors {
left: parent.left
top: parent.top
@@ -262,7 +263,7 @@ Kirigami.ApplicationWindow {
//leftMargin: units.smallSpacing
verticalCenter: locationCheckbox.verticalCenter
}
- text: "Run location service"
+ text: manager.locationServiceAvailable ? "Run location service" : "No GPS source available"
}
onClicked: {
print("Click.")