diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2017-06-27 21:45:17 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-06-27 22:18:26 -0700 |
commit | b459ccbff75065d42c9dcf81472e515703c40903 (patch) | |
tree | b600a192dc65ee4dd47d52777263856f8e6ceb05 | |
parent | 344b9e3234bc3f0d64fb92d876425b5dc9a0a555 (diff) | |
download | subsurface-b459ccbff75065d42c9dcf81472e515703c40903.tar.gz |
QML UI: DiveList: make download from DC main action
Now that we support this for many dive computers, that seem reasonable.
I'm not happy with the icon, but couldn't figure out a better one in the
breeze icon set.
See #426
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | mobile-widgets/qml/DiveList.qml | 14 | ||||
-rw-r--r-- | mobile-widgets/qml/mobile-resources.qrc | 1 | ||||
-rwxr-xr-x | scripts/mobilecomponents.sh | 1 |
3 files changed, 13 insertions, 3 deletions
diff --git a/mobile-widgets/qml/DiveList.qml b/mobile-widgets/qml/DiveList.qml index 8ffaa0011..0bd9e81d8 100644 --- a/mobile-widgets/qml/DiveList.qml +++ b/mobile-widgets/qml/DiveList.qml @@ -274,11 +274,11 @@ Kirigami.ScrollablePage { page.actions.right = page.offlineAction title = qsTr("Cloud credentials") } else if(manager.credentialStatus === QMLManager.VALID || manager.credentialStatus === QMLManager.VALID_EMAIL || manager.credentialStatus === QMLManager.NOCLOUD) { - page.actions.main = page.addDiveAction - page.actions.right = null + page.actions.main = page.downloadFromDCAction + page.actions.right = page.addDiveAction title = qsTr("Dive list") if (diveListView.count === 0) - showPassiveNotification(qsTr("Please tap the '+' button to add a dive"), 3000) + showPassiveNotification(qsTr("Please tap the '+' button to add a dive (or download dives from a supported dive computer)"), 3000) } else { page.actions.main = null page.actions.right = null @@ -327,6 +327,14 @@ Kirigami.ScrollablePage { } } + property QtObject downloadFromDCAction: Kirigami.Action { + iconName: "document-import" + onTriggered: { + downloadFromDc.dcImportModel.clearTable() + stackView.push(downloadFromDc) + } + } + property QtObject addDiveAction: Kirigami.Action { iconName: "list-add" onTriggered: { diff --git a/mobile-widgets/qml/mobile-resources.qrc b/mobile-widgets/qml/mobile-resources.qrc index cd140f546..838464683 100644 --- a/mobile-widgets/qml/mobile-resources.qrc +++ b/mobile-widgets/qml/mobile-resources.qrc @@ -31,6 +31,7 @@ <file alias="icons/handle-left.svg">kirigami/icons/handle-left.svg</file> <file alias="icons/distribute-horizontal-x.svg">kirigami/icons/distribute-horizontal-x.svg</file> <file alias="icons/document-edit.svg">kirigami/icons/document-edit.svg</file> + <file alias="icons/document-import.svg">kirigami/icons/document-import.svg</file> <file alias="icons/document-save.svg">kirigami/icons/document-save.svg</file> <file alias="icons/view-readermode.svg">kirigami/icons/view-readermode.svg</file> <file alias="icons/dialog-cancel.svg">kirigami/icons/dialog-cancel.svg</file> diff --git a/scripts/mobilecomponents.sh b/scripts/mobilecomponents.sh index 267b44515..4bc5293f1 100755 --- a/scripts/mobilecomponents.sh +++ b/scripts/mobilecomponents.sh @@ -57,6 +57,7 @@ cp -R $PMMC/* $MC/ cp $BREEZE/icons/actions/24/dialog-cancel.svg $MC/icons cp $BREEZE/icons/actions/24/distribute-horizontal-x.svg $MC/icons cp $BREEZE/icons/actions/24/document-edit.svg $MC/icons +cp $BREEZE/icons/actions/24/document-import.svg $MC/icons cp $BREEZE/icons/actions/24/document-save.svg $MC/icons cp $BREEZE/icons/actions/24/go-next.svg $MC/icons cp $BREEZE/icons/actions/24/go-previous.svg $MC/icons |