if ((sr_config_list(drivers[i], SR_CONF_DEVICE_OPTIONS,
(const void **)&hwopts, NULL) == SR_OK) && hwopts)
for (int j = 0; hwopts[j]; j++)
- if(hwopts[j] == SR_CONF_SAMPLERATE) {
+ if (hwopts[j] == SR_CONF_SAMPLERATE) {
supported_device = true;
break;
}
- if(supported_device)
+ if (supported_device)
_drivers.addItem(QString("%1 (%2)").arg(
drivers[i]->longname).arg(drivers[i]->name),
qVariantFromValue((void*)drivers[i]));
_device_list.clear();
_serial_device.hide();
_form_layout.labelForField(&_serial_device)->hide();
+ _button_box.button(QDialogButtonBox::Ok)->setDisabled(true);
}
void Connect::set_serial_connection()
_device_list.clear();
const int index = _drivers.currentIndex();
- if(index == -1)
+ if (index == -1)
return;
sr_dev_driver *const driver = (sr_dev_driver*)_drivers.itemData(
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)