]> sigrok.org Git - pulseview.git/commitdiff
Scan: Don't enable "OK" button if no device is found.
authorUlf Lamping <redacted>
Fri, 3 Jan 2014 21:59:36 +0000 (22:59 +0100)
committerUwe Hermann <redacted>
Fri, 3 Jan 2014 22:07:32 +0000 (23:07 +0100)
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.

pv/dialogs/connect.cpp

index 52530beb5d391815233f8a11140bde1c2d5ad20b..9cd712508d463e0711ede42b79d399c219a1e956 100644 (file)
@@ -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)