diff options
author | Jan Mulder <jlmulder@xs4all.nl> | 2018-01-02 17:02:19 +0100 |
---|---|---|
committer | Jan Mulder <jlmulder@xs4all.nl> | 2018-01-03 14:04:08 +0100 |
commit | a5b44362c62b303fa1cedaa633588243b264bfa0 (patch) | |
tree | 53627b511f3d2e75b496c0f0398965354d37d9ae /mobile-widgets/qml | |
parent | 7a48149868d4e0bda6e7930165722368224f596d (diff) | |
download | subsurface-a5b44362c62b303fa1cedaa633588243b264bfa0.tar.gz |
mobile: newer Kirigami SHA
This commit consists of the following 3 parts:
1. There are 2 source files added, adapt our build process
accordingly.
2. Due to a change in icon and kirigami QML prefixes, we need to
adapt for this as well. Changed mobile-resources.qrc for that.
When this would not be changed, the icons will not be found.
3. To further prepare for the future, abandon the iconName
property in favour of the new icon grouped property, which
can have more attributes than only the name. But currently
it is only a syntactic change.
Tested on Android device, and no visible changes.
Signedoff-by: Jan Mulder <jlmulder@xs4all.nl
Diffstat (limited to 'mobile-widgets/qml')
-rw-r--r-- | mobile-widgets/qml/DiveDetails.qml | 16 | ||||
-rw-r--r-- | mobile-widgets/qml/DiveList.qml | 16 | ||||
-rw-r--r-- | mobile-widgets/qml/GpsList.qml | 8 | ||||
-rw-r--r-- | mobile-widgets/qml/main.qml | 68 | ||||
-rw-r--r-- | mobile-widgets/qml/mobile-resources.qrc | 2 |
5 files changed, 83 insertions, 27 deletions
diff --git a/mobile-widgets/qml/DiveDetails.qml b/mobile-widgets/qml/DiveDetails.qml index 001aed3a1..1db5efc36 100644 --- a/mobile-widgets/qml/DiveDetails.qml +++ b/mobile-widgets/qml/DiveDetails.qml @@ -138,7 +138,9 @@ Kirigami.Page { property QtObject deleteAction: Kirigami.Action { text: qsTr("Delete dive") - iconName: "trash-empty" + icon { + name: "trash-empty" + } onTriggered: { var deletedId = currentItem.modelData.dive.id var deletedIndex = diveDetailsListView.currentIndex @@ -153,7 +155,9 @@ Kirigami.Page { property QtObject cancelAction: Kirigami.Action { text: qsTr("Cancel edit") - iconName: "dialog-cancel" + icon { + name: "dialog-cancel" + } onTriggered: { endEditMode() } @@ -161,14 +165,18 @@ Kirigami.Page { property QtObject mapAction: Kirigami.Action { text: qsTr("Show on map") - iconName: "gps" + icon { + name: "gps" + } onTriggered: { showMap(currentItem.modelData.dive.gps_decimal) } } actions.main: Kirigami.Action { - iconName: state !== "view" ? "document-save" : "document-edit" + icon { + name: state !== "view" ? "document-save" : "document-edit" + } onTriggered: { manager.appendTextToLog("save/edit button triggered") if (state === "edit" || state === "add") { diff --git a/mobile-widgets/qml/DiveList.qml b/mobile-widgets/qml/DiveList.qml index 8eff644dc..263820a46 100644 --- a/mobile-widgets/qml/DiveList.qml +++ b/mobile-widgets/qml/DiveList.qml @@ -332,7 +332,9 @@ Kirigami.ScrollablePage { } property QtObject downloadFromDCAction: Kirigami.Action { - iconName: "downloadDC" + icon { + name: "downloadDC" + } onTriggered: { downloadFromDc.dcImportModel.clearTable() stackView.push(downloadFromDc) @@ -340,14 +342,18 @@ Kirigami.ScrollablePage { } property QtObject addDiveAction: Kirigami.Action { - iconName: "list-add" + icon { + name: "list-add" + } onTriggered: { startAddDive() } } property QtObject saveAction: Kirigami.Action { - iconName: "document-save" + icon { + name: "document-save" + } onTriggered: { Qt.inputMethod.hide() startPage.saveCredentials(); @@ -355,7 +361,9 @@ Kirigami.ScrollablePage { } property QtObject offlineAction: Kirigami.Action { - iconName: "qrc:/qml/nocloud.svg" + icon { + name: "qrc:/qml/nocloud.svg" + } onTriggered: { manager.syncToCloud = false manager.credentialStatus = QMLManager.CS_NOCLOUD diff --git a/mobile-widgets/qml/GpsList.qml b/mobile-widgets/qml/GpsList.qml index 1313da4ec..8db0566cc 100644 --- a/mobile-widgets/qml/GpsList.qml +++ b/mobile-widgets/qml/GpsList.qml @@ -72,14 +72,18 @@ Kirigami.ScrollablePage { } actions: [ Kirigami.Action { - iconName: "trash-empty" + icon { + name: "trash-empty" + } onTriggered: { print("delete this!") manager.deleteGpsFix(when) } }, Kirigami.Action { - iconName: "gps" + icon { + name: "gps" + } onTriggered: { showMap(latitude + " " + longitude) } diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml index 9582731d1..da7089d4f 100644 --- a/mobile-widgets/qml/main.qml +++ b/mobile-widgets/qml/main.qml @@ -115,7 +115,9 @@ Kirigami.ApplicationWindow { actions: [ Kirigami.Action { - iconName: "icons/ic_home.svg" + icon { + name: "icons/ic_home.svg" + } text: qsTr("Dive list") onTriggered: { manager.appendTextToLog("requested dive list with credential status " + manager.credentialStatus) @@ -131,10 +133,14 @@ Kirigami.ApplicationWindow { } }, Kirigami.Action { - iconName: "icons/ic_sync.svg" + icon { + name: "icons/ic_sync.svg" + } text: qsTr("Dive management") Kirigami.Action { - iconName: "icons/ic_add.svg" + icon { + name: "icons/ic_add.svg" + } text: qsTr("Add dive manually") enabled: manager.credentialStatus === QMLManager.CS_VERIFIED || manager.credentialStatus === QMLManager.CS_NOCLOUD onTriggered: { @@ -145,7 +151,9 @@ Kirigami.ApplicationWindow { } Kirigami.Action { // this of course assumes a white background - theming means this needs to change again - iconName: "icons/downloadDC-black.svg" + icon { + name: "icons/downloadDC-black.svg" + } text: qsTr("Download from DC") enabled: true onTriggered: { @@ -155,14 +163,18 @@ Kirigami.ApplicationWindow { } } Kirigami.Action { - iconName: "icons/ic_add_location.svg" + icon { + name: "icons/ic_add_location.svg" + } text: qsTr("Apply GPS fixes") onTriggered: { manager.applyGpsData(); } } Kirigami.Action { - iconName: "icons/cloud_sync.svg" + icon { + name: "icons/cloud_sync.svg" + } text: qsTr("Manual sync with cloud") enabled: manager.credentialStatus === QMLManager.CS_VERIFIED || manager.credentialStatus === QMLManager.CS_NOCLOUD onTriggered: { @@ -181,7 +193,9 @@ Kirigami.ApplicationWindow { } } Kirigami.Action { - iconName: syncToCloud ? "icons/ic_cloud_off.svg" : "icons/ic_cloud_done.svg" + icon { + name: syncToCloud ? "icons/ic_cloud_off.svg" : "icons/ic_cloud_done.svg" + } text: syncToCloud ? qsTr("Offline mode") : qsTr("Auto cloud sync enabled") enabled: manager.credentialStatus !== QMLManager.CS_NOCLOUD onTriggered: { @@ -195,12 +209,16 @@ if you have network connectivity and want to sync your data to cloud storage."), } }, Kirigami.Action { - iconName: "icons/ic_place.svg" + icon { + name: "icons/ic_place.svg" + } text: qsTr("GPS") visible: true Kirigami.Action { - iconName: "icons/ic_cloud_upload.svg" + icon { + name: "icons/ic_cloud_upload.svg" + } text: qsTr("Upload GPS data") onTriggered: { globalDrawer.close(); @@ -209,7 +227,9 @@ if you have network connectivity and want to sync your data to cloud storage."), } Kirigami.Action { - iconName: "icons/ic_cloud_download.svg" + icon { + name: "icons/ic_cloud_download.svg" + } text: qsTr("Download GPS data") onTriggered: { globalDrawer.close(); @@ -218,7 +238,9 @@ if you have network connectivity and want to sync your data to cloud storage."), } Kirigami.Action { - iconName: "icons/ic_gps_fixed.svg" + icon { + name:"icons/ic_gps_fixed.svg" + } text: qsTr("Show GPS fixes") onTriggered: { globalDrawer.close() @@ -229,7 +251,9 @@ if you have network connectivity and want to sync your data to cloud storage."), } Kirigami.Action { - iconName: "icons/ic_clear.svg" + icon { + name: "icons/ic_clear.svg" + } text: qsTr("Clear GPS cache") onTriggered: { globalDrawer.close(); @@ -238,7 +262,9 @@ if you have network connectivity and want to sync your data to cloud storage."), } Kirigami.Action { - iconName: locationServiceEnabled ? "icons/ic_location_off.svg" : "icons/ic_place.svg" + icon { + name: locationServiceEnabled ? "icons/ic_location_off.svg" : "icons/ic_place.svg" + } text: locationServiceEnabled ? qsTr("Disable location service") : qsTr("Run location service") onTriggered: { globalDrawer.close(); @@ -247,7 +273,9 @@ if you have network connectivity and want to sync your data to cloud storage."), } }, Kirigami.Action { - iconName: "icons/ic_info_outline.svg" + icon { + name: "icons/ic_info_outline.svg" + } text: qsTr("About") onTriggered: { globalDrawer.close() @@ -256,7 +284,9 @@ if you have network connectivity and want to sync your data to cloud storage."), } }, Kirigami.Action { - iconName: "icons/ic_settings.svg" + icon { + name: "icons/ic_settings.svg" + } text: qsTr("Settings") onTriggered: { globalDrawer.close() @@ -265,7 +295,9 @@ if you have network connectivity and want to sync your data to cloud storage."), } }, Kirigami.Action { - iconName: "icons/ic_adb.svg" + icon { + name: "icons/ic_adb.svg" + } text: qsTr("Developer") visible: manager.developer Kirigami.Action { @@ -285,7 +317,9 @@ if you have network connectivity and want to sync your data to cloud storage."), } }, Kirigami.Action { - iconName: "icons/ic_help_outline.svg" + icon { + name: "icons/ic_help_outline.svg" + } text: qsTr("Help") onTriggered: { Qt.openUrlExternally("https://subsurface-divelog.org/documentation/subsurface-mobile-v2-user-manual/") diff --git a/mobile-widgets/qml/mobile-resources.qrc b/mobile-widgets/qml/mobile-resources.qrc index 6bc667742..a1f65e78d 100644 --- a/mobile-widgets/qml/mobile-resources.qrc +++ b/mobile-widgets/qml/mobile-resources.qrc @@ -28,6 +28,8 @@ </qresource> <qresource prefix="/"> <file>qtquickcontrols2.conf</file> + </qresource> + <qresource prefix="/org/kde/kirigami"> <file alias="icons/go-next-symbolic.svg">kirigami/icons/go-next.svg</file> <file alias="icons/go-previous-symbolic.svg">kirigami/icons/go-previous.svg</file> <file alias="icons/go-up.svg">kirigami/icons/go-up.svg</file> |