From: Soeren Apel Date: Mon, 24 Aug 2015 14:56:05 +0000 (+0200) Subject: Fix #597 by disabling device-related toolbar buttons as necessary X-Git-Tag: pulseview-0.3.0~134 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=73e170f93ce9deb7bba04966564dcd8af8dfe7e1;p=pulseview.git Fix #597 by disabling device-related toolbar buttons as necessary --- diff --git a/pv/toolbars/mainbar.cpp b/pv/toolbars/mainbar.cpp index a1761291..de476e04 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()