mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-27 20:58:47 +00:00
maps: disable link to Google maps on iOS and Android
It appears that on those two platforms you now need a paid API key in order to have this feature work. Certainly not something I'm going to do. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
cd47499694
commit
212da3d92f
1 changed files with 12 additions and 7 deletions
|
@ -6,16 +6,16 @@ Item {
|
|||
signal actionSelected(int action)
|
||||
|
||||
readonly property var actions: {
|
||||
"OPEN_LOCATION_IN_GOOGLE_MAPS": 0,
|
||||
"COPY_LOCATION_DECIMAL": 1,
|
||||
"COPY_LOCATION_SEXAGESIMAL": 2,
|
||||
"SELECT_VISIBLE_LOCATIONS": 3
|
||||
"COPY_LOCATION_DECIMAL": 0,
|
||||
"COPY_LOCATION_SEXAGESIMAL": 1,
|
||||
"SELECT_VISIBLE_LOCATIONS": 2,
|
||||
"OPEN_LOCATION_IN_GOOGLE_MAPS": 3
|
||||
}
|
||||
readonly property var menuItemData: [
|
||||
{ idx: actions.OPEN_LOCATION_IN_GOOGLE_MAPS, itemText: qsTr("Open in Google Maps") },
|
||||
{ idx: actions.COPY_LOCATION_DECIMAL, itemText: qsTr("Copy coordinates to clipboard (decimal)") },
|
||||
{ idx: actions.COPY_LOCATION_SEXAGESIMAL, itemText: qsTr("Copy coordinates to clipboard (sexagesimal)") },
|
||||
{ idx: actions.SELECT_VISIBLE_LOCATIONS, itemText: qsTr("Select visible dive locations") }
|
||||
{ idx: actions.SELECT_VISIBLE_LOCATIONS, itemText: qsTr("Select visible dive locations") },
|
||||
{ idx: actions.OPEN_LOCATION_IN_GOOGLE_MAPS, itemText: qsTr("Open in Google Maps") }
|
||||
]
|
||||
readonly property real itemTextPadding: 10.0
|
||||
readonly property real itemHeight: 34.0
|
||||
|
@ -52,7 +52,12 @@ Item {
|
|||
id: listModel
|
||||
property int selectedIdx: -1
|
||||
Component.onCompleted: {
|
||||
for (var i = 0; i < menuItemData.length; i++)
|
||||
var l = menuItemData.length
|
||||
// don't offer Google map on iOS or Android (as the link doesn't
|
||||
// work on those platforms without a paid API key)
|
||||
if (Qt.platform.os === "android" || Qt.platform.os === "ios")
|
||||
l--
|
||||
for (var i = 0; i < l; i++)
|
||||
append(menuItemData[i]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue