From 8034af5ad5726846ea0d227d8fa3d13aebde7e36 Mon Sep 17 00:00:00 2001 From: Jan Mulder Date: Wed, 10 Oct 2018 10:01:02 +0200 Subject: QML UI: do not try to download from DC with empty vendor/product Disable the Download button when one of the fields vendor, product, connection is not filled in. The app will crash when trying. In addition, make the underlying core code to actual download more safe by checking this, and silently fail instead of crash. And, yes, this is a double fix in this scenario, but the core code is used in more places, so better safe than sorry. Signed-off-by: Jan Mulder --- mobile-widgets/qml/DownloadFromDiveComputer.qml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mobile-widgets/qml/DownloadFromDiveComputer.qml') diff --git a/mobile-widgets/qml/DownloadFromDiveComputer.qml b/mobile-widgets/qml/DownloadFromDiveComputer.qml index 8a8bf2d74..729fe3c20 100644 --- a/mobile-widgets/qml/DownloadFromDiveComputer.qml +++ b/mobile-widgets/qml/DownloadFromDiveComputer.qml @@ -273,6 +273,8 @@ Kirigami.Page { SsrfButton { id: download text: qsTr("Download") + enabled: comboVendor.currentIndex != -1 && comboProduct.currentIndex != -1 && + comboConnection.currentIndex != -1 onClicked: { text = qsTr("Retry") // strip any BT Name from the address -- cgit v1.2.3-70-g09d2