X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Ftoolbars%2Fmainbar.cpp;h=e6beb2b3ba704e198c8aff0076787a9d96798fe9;hp=b9eda07787c912ccdef99e7fa55d38fc3aa1d0a2;hb=f4ab4b5c657e5613caba82feaa81a8a400e4f331;hpb=c78081004d8d7c6440358ccbf9278826a0fdb568 diff --git a/pv/toolbars/mainbar.cpp b/pv/toolbars/mainbar.cpp index b9eda07..e6beb2b 100644 --- a/pv/toolbars/mainbar.cpp +++ b/pv/toolbars/mainbar.cpp @@ -302,6 +302,7 @@ void MainBar::update_sample_rate_selector() const shared_ptr sr_dev = device->device(); + sample_rate_.allow_user_entered_values(false); if (sr_dev->config_check(ConfigKey::EXTERNAL_CLOCK, Capability::GET)) { try { auto gvar = sr_dev->config_get(ConfigKey::EXTERNAL_CLOCK); @@ -383,7 +384,7 @@ void MainBar::update_sample_rate_selector_value() sample_rate_.set_value(samplerate); updating_sample_rate_ = false; } catch (Error& error) { - qDebug() << tr("Failed to get value of sample rate:") << error.what(); + qDebug() << tr("Failed to get sample rate:") << error.what(); } } @@ -508,8 +509,6 @@ void MainBar::commit_sample_rate() const shared_ptr sr_dev = device->device(); sample_rate = sample_rate_.value(); - if (sample_rate == 0) - return; try { sr_dev->config_set(ConfigKey::SAMPLERATE, @@ -606,9 +605,9 @@ void MainBar::export_file(shared_ptr format, bool selection_only) const pv::util::Timestamp& end_time = trace_view->cursors()->second()->time(); const uint64_t start_sample = (uint64_t)max( - (double)0, start_time.convert_to() * samplerate); + 0.0, start_time.convert_to() * samplerate); const uint64_t end_sample = (uint64_t)max( - (double)0, end_time.convert_to() * samplerate); + 0.0, end_time.convert_to() * samplerate); if ((start_sample == 0) && (end_sample == 0)) { // Both cursors are negative and were clamped to 0