X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Ftoolbars%2Fmainbar.cpp;h=dcc35ecee8f4e42800354080e0b2b34d047ebbcb;hb=7c8b6ad299f4b4cfd5299953aff932316893a372;hp=a1761291ddb835a4ba84c1bcc176849d676e821e;hpb=c7b03d9daa9574bd633fbac2d5976716f58027f5;p=pulseview.git diff --git a/pv/toolbars/mainbar.cpp b/pv/toolbars/mainbar.cpp index a176129..dcc35ec 100644 --- a/pv/toolbars/mainbar.cpp +++ b/pv/toolbars/mainbar.cpp @@ -232,6 +232,14 @@ void MainBar::set_capture_state(pv::Session::capture_state state) run_stop_button_.setText((state == pv::Session::Stopped) ? tr("Run") : tr("Stop")); run_stop_button_.setShortcut(QKeySequence(Qt::Key_Space)); + + bool ui_enabled = (state == pv::Session::Stopped) ? true : false; + + device_selector_.setEnabled(ui_enabled); + configure_button_.setEnabled(ui_enabled); + channels_button_.setEnabled(ui_enabled); + sample_count_.setEnabled(ui_enabled); + sample_rate_.setEnabled(ui_enabled); } void MainBar::update_sample_rate_selector() @@ -576,10 +584,11 @@ bool MainBar::eventFilter(QObject *watched, QEvent *event) { if ((watched == &sample_count_ || watched == &sample_rate_) && (event->type() == QEvent::ToolTip)) { - double sec = (double)sample_count_.value() / sample_rate_.value(); + auto sec = pv::util::Timestamp(sample_count_.value()) / sample_rate_.value(); QHelpEvent *help_event = static_cast(event); - QString str = tr("Total sampling time: %1").arg(pv::util::format_second(sec)); + QString str = tr("Total sampling time: %1").arg( + pv::util::format_time_si(sec, pv::util::SIPrefix::unspecified, 0, "s", false)); QToolTip::showText(help_event->globalPos(), str); return true;