mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 21:23:24 +00:00
mobile: delay combobox selection for download.
Set index of comboboxes in Download screen when the page becomes visible instead of when it is created. The pages is created before QBluetoothDeviceDiscoveryAgent on iOS and desktop, therefore combobox indexes cannot be set during page creation. Signed-off-by: Jan Iversen <jani@apache.org>
This commit is contained in:
parent
36b9e5e31e
commit
03f30f6281
1 changed files with 10 additions and 4 deletions
|
@ -67,12 +67,11 @@ Kirigami.Page {
|
|||
}
|
||||
columns: 2
|
||||
Controls.Label { text: qsTr(" Vendor name: ") }
|
||||
property var vendoridx: downloadThread.data().getDetectedVendorIndex()
|
||||
Controls.ComboBox {
|
||||
id: comboVendor
|
||||
Layout.fillWidth: true
|
||||
model: vendorList
|
||||
currentIndex: parent.vendoridx
|
||||
currentIndex: -1
|
||||
delegate: Controls.ItemDelegate {
|
||||
width: comboVendor.width
|
||||
contentItem: Text {
|
||||
|
@ -100,10 +99,9 @@ Kirigami.Page {
|
|||
Controls.Label { text: qsTr(" Dive Computer:") }
|
||||
Controls.ComboBox {
|
||||
id: comboProduct
|
||||
property var productidx: downloadThread.data().getDetectedProductIndex(comboVendor.currentText)
|
||||
Layout.fillWidth: true
|
||||
model: null
|
||||
currentIndex: productidx
|
||||
currentIndex: -1
|
||||
delegate: Controls.ItemDelegate {
|
||||
width: comboProduct.width
|
||||
contentItem: Text {
|
||||
|
@ -305,5 +303,13 @@ Kirigami.Page {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
onVisibleChanged: {
|
||||
if (visible) {
|
||||
comboVendor.currentIndex = downloadThread.data().getDetectedVendorIndex()
|
||||
comboProduct.currentIndex = downloadThread.data().getDetectedProductIndex(comboVendor.currentText)
|
||||
comboDevice.currentIndex = downloadThread.data().getMatchingAddress(comboVendor.currentText, comboProduct.currentText)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue