From: Ulf Lamping Date: Fri, 3 Jan 2014 21:59:36 +0000 (+0100) Subject: Scan: Don't enable "OK" button if no device is found. X-Git-Tag: pulseview-0.2.0~163 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=f44133787621a589cfd65b8726a2433df01e2c6c;p=pulseview.git Scan: Don't enable "OK" button if no device is found. Even when no devices were found after "Scan for Devices", a user could click on the active "OK" button. This fixes the behaviour so that the "OK" button only gets enabled when a device has actually been found. This fixes bug #237. --- diff --git a/pv/dialogs/connect.cpp b/pv/dialogs/connect.cpp index 52530beb..9cd71250 100644 --- a/pv/dialogs/connect.cpp +++ b/pv/dialogs/connect.cpp @@ -177,7 +177,7 @@ void Connect::scan_pressed() } _device_list.setCurrentRow(0); - _button_box.button(QDialogButtonBox::Ok)->setDisabled(false); + _button_box.button(QDialogButtonBox::Ok)->setDisabled(_device_list.count() == 0); } void Connect::device_selected(int index)