From ccd024f0ee4c1e8ba66605eacc40db101ee72dc4 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 16 Mar 2020 09:42:46 -0700 Subject: mobile/DC-download: select reasonable connection after rescanning This seems to make more sense than to not select anything (which was the previous behavior). If the same connection is still available, select it again. Otherwise pick the top connection (which is the right thing to do if the user has just plugged in a USB device and refreshes the list -- that device will show up as top entry). Based on a suggestion by Christof Arnosti Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/DownloadFromDiveComputer.qml | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mobile-widgets/qml') diff --git a/mobile-widgets/qml/DownloadFromDiveComputer.qml b/mobile-widgets/qml/DownloadFromDiveComputer.qml index 5a732b73f..dfe254143 100644 --- a/mobile-widgets/qml/DownloadFromDiveComputer.qml +++ b/mobile-widgets/qml/DownloadFromDiveComputer.qml @@ -366,7 +366,14 @@ Kirigami.Page { text: qsTr("Rescan") enabled: manager.btEnabled onClicked: { + // refresh both USB and BT/BLE and make sure a reasonable entry is selected + var current = comboConnection.currentText manager.rescanConnections() + // check if the same entry is still available; if not pick the first entry + var idx = comboConnection.find(current) + if (idx === -1) + idx = 0 + comboConnection.currentIndex = idx } } -- cgit v1.2.3-70-g09d2