From: Joel Holdsworth Date: Thu, 7 Mar 2013 23:25:02 +0000 (+0000) Subject: Prevent Ok being pressed when no device is selected X-Git-Tag: pulseview-0.1.0~95 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=f60ec39f5639064290a788a508a542e0f043ae08;p=pulseview.git Prevent Ok being pressed when no device is selected Disable Ok until a device has been selected, and select the first device when scan is pressed --- diff --git a/pv/dialogs/connect.cpp b/pv/dialogs/connect.cpp index 87fc451a..51de735e 100644 --- a/pv/dialogs/connect.cpp +++ b/pv/dialogs/connect.cpp @@ -112,6 +112,7 @@ void Connect::unset_connection() _device_list.clear(); _serial_device.hide(); _form_layout.labelForField(&_serial_device)->hide(); + _button_box.button(QDialogButtonBox::Ok)->setDisabled(true); } void Connect::set_serial_connection() @@ -167,6 +168,9 @@ void Connect::scan_pressed() g_slist_free(devices); g_slist_free_full(drvopts, (GDestroyNotify)free_drvopts); + + _device_list.setCurrentRow(0); + _button_box.button(QDialogButtonBox::Ok)->setDisabled(false); } void Connect::device_selected(int index)