mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
QML UI: ensure we track vendor/product for download
This is based on something that Anton Ludin sent to the mailing list. Reading through the code it seemed that there were scenarios in which DC_vendor and DC_product were not updated correctly. That's one of the problems of the declarative approach in QML - it can be very hard to figure out which code is run when in certain situations. This may help address the issue with FTDI downloads no longer working on Android. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
1ccf21f08d
commit
7f7e7cf51d
1 changed files with 3 additions and 1 deletions
|
@ -79,6 +79,7 @@ Kirigami.Page {
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
}
|
}
|
||||||
onCurrentTextChanged: {
|
onCurrentTextChanged: {
|
||||||
|
manager.DC_vendor = currentText
|
||||||
comboProduct.model = manager.getProductListFromVendor(currentText)
|
comboProduct.model = manager.getProductListFromVendor(currentText)
|
||||||
if (currentIndex == manager.getDetectedVendorIndex())
|
if (currentIndex == manager.getDetectedVendorIndex())
|
||||||
comboProduct.currentIndex = manager.getDetectedProductIndex(currentText)
|
comboProduct.currentIndex = manager.getDetectedProductIndex(currentText)
|
||||||
|
@ -109,6 +110,7 @@ Kirigami.Page {
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
}
|
}
|
||||||
onCurrentTextChanged: {
|
onCurrentTextChanged: {
|
||||||
|
manager.DC_product = currentText
|
||||||
var newIdx = manager.getMatchingAddress(comboVendor.currentText, currentText)
|
var newIdx = manager.getMatchingAddress(comboVendor.currentText, currentText)
|
||||||
if (newIdx != -1)
|
if (newIdx != -1)
|
||||||
comboConnection.currentIndex = newIdx
|
comboConnection.currentIndex = newIdx
|
||||||
|
@ -188,7 +190,7 @@ Kirigami.Page {
|
||||||
// strip any BT Name from the address
|
// strip any BT Name from the address
|
||||||
var devName = manager.DC_devName
|
var devName = manager.DC_devName
|
||||||
manager.DC_devName = devName.replace(/^(.*) /, "")
|
manager.DC_devName = devName.replace(/^(.*) /, "")
|
||||||
manager.appendTextToLog("DCDownloadThread started for " + manager.product + " on "+ manager.DC_devName)
|
manager.appendTextToLog("DCDownloadThread started for " + manager.DC_vendor + " " + manager.DC_product + " on "+ manager.DC_devName)
|
||||||
progressBar.visible = true
|
progressBar.visible = true
|
||||||
downloadThread.start()
|
downloadThread.start()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue