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>
This commit is contained in:
Dirk Hohndel 2017-06-27 21:45:17 -07:00
parent 344b9e3234
commit b459ccbff7
3 changed files with 13 additions and 3 deletions

View file

@ -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: {