Scan: Don't enable "OK" button if no device is found.
[pulseview.git] / pv / dialogs / connect.cpp
index b7efe4f3442a875bd40dc37c2ea01d56852ff2d2..9cd712508d463e0711ede42b79d399c219a1e956 100644 (file)
@@ -31,7 +31,8 @@ extern "C" {
 #include <libsigrok/libsigrok.h>
 }
 
-using namespace std;
+using std::list;
+using std::string;
 
 extern sr_context *sr_ctx;
 
@@ -176,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)