aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-06-12 12:09:49 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-06-12 12:09:49 -0700
commitf2e03022fa420309c268221cf75b41f176526455 (patch)
tree3a239722c7690453569f809b071e592c599a001d /mobile-widgets
parent72523ff0dfc6f8e2ecd9ef07f72cdce2af527e3d (diff)
downloadsubsurface-f2e03022fa420309c268221cf75b41f176526455.tar.gz
QML UI: disable GPS functionality on iOS
I still haven't figured out how to make GPS work on iOS. So let's not pretend this works. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets')
-rw-r--r--mobile-widgets/qml/main.qml37
-rw-r--r--mobile-widgets/qmlmanager.cpp4
2 files changed, 27 insertions, 14 deletions
diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml
index b4c6f3610..f3db1b297 100644
--- a/mobile-widgets/qml/main.qml
+++ b/mobile-widgets/qml/main.qml
@@ -95,7 +95,8 @@ Kirigami.ApplicationWindow {
titleIcon: "qrc:/qml/subsurface-mobile-icon.png"
bannerImageSource: "dive.jpg"
- actions: [
+
+ property list<QtObject> topActions: [
Kirigami.Action {
text: qsTr("Dive list")
onTriggered: {
@@ -127,16 +128,6 @@ Kirigami.ApplicationWindow {
},
Kirigami.Action {
text: qsTr("Manage dives")
- /*
- * disable for the beta to avoid confusion
- Action {
- text: qsTr("Download from computer")
- onTriggered: {
- detailsWindow.endEditMode()
- stackView.push(downloadDivesWindow)
- }
- }
- */
Kirigami.Action {
text: qsTr("Add dive manually")
enabled: manager.credentialStatus === QMLManager.VALID || manager.credentialStatus === QMLManager.VALID_EMAIL || manager.credentialStatus === QMLManager.NOCLOUD
@@ -179,8 +170,10 @@ Kirigami.ApplicationWindow {
}
}
}
- },
+ }
+ ] // end topActions
+ property list<QtObject> gpsActions: [
Kirigami.Action {
text: qsTr("GPS")
enabled: manager.credentialStatus === QMLManager.VALID || manager.credentialStatus === QMLManager.VALID_EMAIL
@@ -227,8 +220,10 @@ Kirigami.ApplicationWindow {
detailsWindow.endEditMode()
}
}
- },
+ }
+ ] // end gpsActions
+ property list<QtObject> bottomActions: [
Kirigami.Action {
text: qsTr("Developer")
Kirigami.Action {
@@ -258,7 +253,21 @@ Kirigami.ApplicationWindow {
detailsWindow.endEditMode()
}
}
- ] // end actions
+ ] // end bottonActions
+
+ Component.onCompleted: {
+ var createActions = new Array(0)
+ for (var i = 0; i < topActions.length; i++)
+ createActions.push(topActions[i])
+ if (Qt.platform !== "ios") {
+ for (var i = 0; i < gpsActions.length; i++)
+ createActions.push(gpsActions[i])
+ }
+ for (var i = 0; i < bottomActions.length; i++)
+ createActions.push(bottomActions[i])
+ actions = createActions
+ print(actions)
+ }
MouseArea {
height: childrenRect.height
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index 1c3e1210e..669072321 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -1111,7 +1111,11 @@ void QMLManager::setLocationServiceEnabled(bool locationServiceEnabled)
bool QMLManager::locationServiceAvailable() const
{
+#if defined(Q_OS_IOS)
+ return false;
+#else
return m_locationServiceAvailable;
+#endif
}
void QMLManager::setLocationServiceAvailable(bool locationServiceAvailable)