+ using namespace pv::popups;
+
+ const shared_ptr<Device> device = get_selected_device();
+ if (!device)
+ return;
+
+ // Update the configure popup
+ DeviceOptions *const opts = new DeviceOptions(device, this);
+ configure_button_action_->setVisible(
+ !opts->binding().properties().empty());
+ configure_button_.set_popup(opts);
+
+ // Update the channels popup
+ Channels *const channels = new Channels(session_, this);
+ channels_button_.set_popup(channels);
+
+ // Update supported options.
+ sample_count_supported_ = false;
+
+ try {
+ for (auto entry : device->config_keys(ConfigKey::DEVICE_OPTIONS))
+ {
+ auto key = entry.first;
+ auto capabilities = entry.second;
+ switch (key->id()) {
+ case SR_CONF_LIMIT_SAMPLES:
+ if (capabilities.count(Capability::SET))
+ sample_count_supported_ = true;
+ break;
+ case SR_CONF_LIMIT_FRAMES:
+ if (capabilities.count(Capability::SET))
+ {
+ device->config_set(ConfigKey::LIMIT_FRAMES,
+ Glib::Variant<guint64>::create(1));
+ on_config_changed();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ } catch (Error error) {}
+
+ // Add notification of reconfigure events
+ disconnect(this, SLOT(on_config_changed()));
+ connect(&opts->binding(), SIGNAL(config_changed()),
+ this, SLOT(on_config_changed()));
+
+ // Update sweep timing widgets.
+ update_sample_count_selector();
+ update_sample_rate_selector();
+}
+
+void SamplingBar::commit_sample_count()
+{
+ uint64_t sample_count = 0;