aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml/DownloadFromDiveComputer.qml
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-20 14:00:16 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-21 13:27:00 -0700
commit559547b7e6459b4af6902e802fc344bf0ccdea0f (patch)
tree24ad8ac75e65ae84ff172df1d61b17e948b945d2 /mobile-widgets/qml/DownloadFromDiveComputer.qml
parent98ef01b2e4c21f15ddf92059fa7fdd77acd883ec (diff)
downloadsubsurface-559547b7e6459b4af6902e802fc344bf0ccdea0f.tar.gz
mobile/DCdownload: try harder to get the right elements selected
The number of possible sequences of events when the user is connecting a USB device is rather surprising. These changes try to ensure that in every case we get USB connection information we do in fact show the correct (or best guess) connection. See #2686 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qml/DownloadFromDiveComputer.qml')
-rw-r--r--mobile-widgets/qml/DownloadFromDiveComputer.qml10
1 files changed, 10 insertions, 0 deletions
diff --git a/mobile-widgets/qml/DownloadFromDiveComputer.qml b/mobile-widgets/qml/DownloadFromDiveComputer.qml
index dfe254143..4fbeb525b 100644
--- a/mobile-widgets/qml/DownloadFromDiveComputer.qml
+++ b/mobile-widgets/qml/DownloadFromDiveComputer.qml
@@ -157,6 +157,16 @@ Kirigami.Page {
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
}
+ onCountChanged: {
+ // ensure that pick the first entry once we have any
+ // entries in the connection list
+ if (count === 0)
+ currentIndex = -1
+ else if (currentIndex === -1)
+ currentIndex = 0
+
+ }
+
onCurrentTextChanged: {
var curVendor
var curProduct