diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2018-09-21 15:42:34 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-09-23 11:49:30 -0700 |
commit | 52c70a3594b96198baf55e8d673369d32f136e8d (patch) | |
tree | 21dd8cbbd873291f019e951e1d565ace34234f82 | |
parent | 0d7c1e99185427ffac1c81e9bfc440ed291cfc6b (diff) | |
download | subsurface-52c70a3594b96198baf55e8d673369d32f136e8d.tar.gz |
Mobile/remember DCs: add UI for the mobile app
This uses the same backend as the desktop version.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | mobile-widgets/qml/DownloadFromDiveComputer.qml | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/mobile-widgets/qml/DownloadFromDiveComputer.qml b/mobile-widgets/qml/DownloadFromDiveComputer.qml index 44822193a..2d925fe42 100644 --- a/mobile-widgets/qml/DownloadFromDiveComputer.qml +++ b/mobile-widgets/qml/DownloadFromDiveComputer.qml @@ -169,6 +169,59 @@ Kirigami.Page { } } + GridLayout { + id: rememberedDCsGrid + visible: PrefDiveComputer.vendor1 !== "" + Layout.alignment: Qt.AlignTop + Layout.topMargin: Kirigami.Units.smallSpacing * 4 + columns: 2 + function setDC(vendor, product, device) { + comboVendor.currentIndex = comboVendor.find(vendor); + comboProduct.currentIndex = comboProduct.find(product); + comboConnection.currentIndex = comboConnection.find(device); + } + Controls.Label { + Layout.columnSpan: 2 + text: qsTr(" Previously used dive computers: ") + } + SsrfButton { + id: dc1 + visible: PrefDiveComputer.vendor1 !== "" + text: PrefDiveComputer.vendor1 + " - " + PrefDiveComputer.product1 + onClicked: { + // update comboboxes + rememberedDCsGrid.setDC(PrefDiveComputer.vendor1, PrefDiveComputer.product1, PrefDiveComputer.device1) + } + } + SsrfButton { + id: dc2 + visible: PrefDiveComputer.vendor2 !== "" + text: PrefDiveComputer.vendor2 + " - " + PrefDiveComputer.product2 + onClicked: { + // update comboboxes + rememberedDCsGrid.setDC(PrefDiveComputer.vendor2, PrefDiveComputer.product2, PrefDiveComputer.device2) + } + } + SsrfButton { + id: dc3 + visible: PrefDiveComputer.vendor3 !== "" + text: PrefDiveComputer.vendor3 + " - " + PrefDiveComputer.product3 + onClicked: { + // update comboboxes + rememberedDCsGrid.setDC(PrefDiveComputer.vendor3, PrefDiveComputer.product3, PrefDiveComputer.device3) + } + } + SsrfButton { + id: dc4 + visible: PrefDiveComputer.vendor4 !== "" + text: PrefDiveComputer.vendor4 + " - " + PrefDiveComputer.product4 + onClicked: { + // update comboboxes + rememberedDCsGrid.setDC(PrefDiveComputer.vendor4, PrefDiveComputer.product4, PrefDiveComputer.device4) + } + } + } + Controls.ProgressBar { id: progressBar Layout.topMargin: Kirigami.Units.smallSpacing * 4 |