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>
This commit is contained in:
parent
1819cc1ccc
commit
628f83d5cf
@ -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()
|
||||
|
||||
@ -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.")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user