+void DeviceOptions::setup_probes()
+{
+ using namespace Qt;
+
+ for (const GSList *l = _sdi->probes; l; l = l->next) {
+ sr_probe *const probe = (sr_probe*)l->data;
+ assert(probe);
+ QListWidgetItem *const item = new QListWidgetItem(
+ probe->name, &_probes);
+ assert(item);
+ item->setCheckState(probe->enabled ?
+ Checked : Unchecked);
+ item->setData(UserRole,
+ qVariantFromValue((void*)probe));
+ _probes.addItem(item);
+ }
+}
+
+void DeviceOptions::set_all_probes(bool set)
+{
+ for (int i = 0; i < _probes.count(); i++) {
+ QListWidgetItem *const item = _probes.item(i);
+ assert(item);
+ item->setCheckState(set ? Qt::Checked : Qt::Unchecked);
+ }
+}
+
+void DeviceOptions::enable_all_probes()
+{
+ set_all_probes(true);
+}
+
+void DeviceOptions::disable_all_probes()
+{
+ set_all_probes(false);
+}
+