mobile UI: move code to open download page on device plug-in

This makes the code easier to reuse and uses the helper we just added.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-03-09 10:46:17 -07:00
parent 93080f129d
commit 174bb91326
2 changed files with 29 additions and 23 deletions

View file

@ -508,20 +508,6 @@ Kirigami.ScrollablePage {
}
}
function showDownloadPage(vendor, product, connection) {
downloadFromDc.dcImportModel.clearTable()
pageStack.push(downloadFromDc)
if (vendor !== undefined && product !== undefined && connection !== undefined) {
/* set up the correct values on the download page */
if (vendor !== -1)
downloadFromDc.vendor = vendor
if (product !== -1)
downloadFromDc.product = product
if (connection !== -1)
downloadFromDc.connection = connection
}
}
property QtObject downloadFromDCAction: Kirigami.Action {
icon {
name: ":/icons/downloadDC"
@ -529,7 +515,7 @@ Kirigami.ScrollablePage {
}
text: qsTr("Download dives")
onTriggered: {
showDownloadPage()
rootItem.showDownloadPage()
}
}