X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Ftoolbars%2Fmainbar.cpp;h=16888624bc2f124030005fc481ae6838f5adbba5;hp=3c8b71e2f7b59a8162fcf39f23135c2d819cd46b;hb=bc4b9ccfc78d9d0987525360fa6d93bed681951a;hpb=1ae18301848d741a7a17888af9e1b10171a6ccc4 diff --git a/pv/toolbars/mainbar.cpp b/pv/toolbars/mainbar.cpp index 3c8b71e2..16888624 100644 --- a/pv/toolbars/mainbar.cpp +++ b/pv/toolbars/mainbar.cpp @@ -302,6 +302,17 @@ void MainBar::update_sample_rate_selector() const shared_ptr sr_dev = device->device(); + try { + auto gvar = sr_dev->config_get(ConfigKey::EXTERNAL_CLOCK); + if (gvar.gobj()) { + bool value = Glib::VariantBase::cast_dynamic>( + gvar).get(); + sample_rate_.allow_user_entered_values(value); + } + } catch (Error& error) { + // Do nothing + } + if (sr_dev->config_check(ConfigKey::SAMPLERATE, Capability::LIST)) { try { gvar_dict = sr_dev->config_list(ConfigKey::SAMPLERATE); @@ -729,6 +740,10 @@ void MainBar::on_sample_rate_changed() void MainBar::on_config_changed() { + // We want to also call update_sample_rate_selector() here in case + // the user changed the SR_CONF_EXTERNAL_CLOCK option. However, + // commit_sample_rate() does this already, so we don't call it here + commit_sample_count(); commit_sample_rate(); }