mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
72523ff0df
commit
f2e03022fa
2 changed files with 27 additions and 14 deletions
|
@ -95,7 +95,8 @@ Kirigami.ApplicationWindow {
|
||||||
titleIcon: "qrc:/qml/subsurface-mobile-icon.png"
|
titleIcon: "qrc:/qml/subsurface-mobile-icon.png"
|
||||||
|
|
||||||
bannerImageSource: "dive.jpg"
|
bannerImageSource: "dive.jpg"
|
||||||
actions: [
|
|
||||||
|
property list<QtObject> topActions: [
|
||||||
Kirigami.Action {
|
Kirigami.Action {
|
||||||
text: qsTr("Dive list")
|
text: qsTr("Dive list")
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
|
@ -127,16 +128,6 @@ Kirigami.ApplicationWindow {
|
||||||
},
|
},
|
||||||
Kirigami.Action {
|
Kirigami.Action {
|
||||||
text: qsTr("Manage dives")
|
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 {
|
Kirigami.Action {
|
||||||
text: qsTr("Add dive manually")
|
text: qsTr("Add dive manually")
|
||||||
enabled: manager.credentialStatus === QMLManager.VALID || manager.credentialStatus === QMLManager.VALID_EMAIL || manager.credentialStatus === QMLManager.NOCLOUD
|
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 {
|
Kirigami.Action {
|
||||||
text: qsTr("GPS")
|
text: qsTr("GPS")
|
||||||
enabled: manager.credentialStatus === QMLManager.VALID || manager.credentialStatus === QMLManager.VALID_EMAIL
|
enabled: manager.credentialStatus === QMLManager.VALID || manager.credentialStatus === QMLManager.VALID_EMAIL
|
||||||
|
@ -227,8 +220,10 @@ Kirigami.ApplicationWindow {
|
||||||
detailsWindow.endEditMode()
|
detailsWindow.endEditMode()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
|
] // end gpsActions
|
||||||
|
|
||||||
|
property list<QtObject> bottomActions: [
|
||||||
Kirigami.Action {
|
Kirigami.Action {
|
||||||
text: qsTr("Developer")
|
text: qsTr("Developer")
|
||||||
Kirigami.Action {
|
Kirigami.Action {
|
||||||
|
@ -258,7 +253,21 @@ Kirigami.ApplicationWindow {
|
||||||
detailsWindow.endEditMode()
|
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 {
|
MouseArea {
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
|
|
|
@ -1111,7 +1111,11 @@ void QMLManager::setLocationServiceEnabled(bool locationServiceEnabled)
|
||||||
|
|
||||||
bool QMLManager::locationServiceAvailable() const
|
bool QMLManager::locationServiceAvailable() const
|
||||||
{
|
{
|
||||||
|
#if defined(Q_OS_IOS)
|
||||||
|
return false;
|
||||||
|
#else
|
||||||
return m_locationServiceAvailable;
|
return m_locationServiceAvailable;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void QMLManager::setLocationServiceAvailable(bool locationServiceAvailable)
|
void QMLManager::setLocationServiceAvailable(bool locationServiceAvailable)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue