diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2017-07-17 06:06:22 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-07-17 07:35:22 -0700 |
commit | ec1b22b4871338cf74066a97811731b97e44277b (patch) | |
tree | 43f66ff651b2497795df499944feedb2e6ec33fc /mobile-widgets/qml | |
parent | 2ccfce7cf062d2ef83d111e343bff4fbd67c1598 (diff) | |
download | subsurface-ec1b22b4871338cf74066a97811731b97e44277b.tar.gz |
QML UI: only change connection when finding a match
If we can't find a match, just leave it unchanged. This way, if we
mis-recognize a device, the user can correct the product (or even
vendor) without losing the correct connection.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qml')
-rw-r--r-- | mobile-widgets/qml/DownloadFromDiveComputer.qml | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mobile-widgets/qml/DownloadFromDiveComputer.qml b/mobile-widgets/qml/DownloadFromDiveComputer.qml index d57068522..a4db5ef51 100644 --- a/mobile-widgets/qml/DownloadFromDiveComputer.qml +++ b/mobile-widgets/qml/DownloadFromDiveComputer.qml @@ -83,7 +83,9 @@ Kirigami.Page { model: null currentIndex: productidx onCurrentTextChanged: { - comboConnection.currentIndex = downloadThread.data().getMatchingAddress(comboVendor.currentText, currentText) + var newIdx = downloadThread.data().getMatchingAddress(comboVendor.currentText, currentText) + if (newIdx != -1) + comboConnection.currentIndex = newIdx } onModelChanged: { |