]> sigrok.org Git - pulseview.git/commitdiff
Fix #597 by disabling device-related toolbar buttons as necessary
authorSoeren Apel <redacted>
Mon, 24 Aug 2015 14:56:05 +0000 (16:56 +0200)
committerUwe Hermann <redacted>
Tue, 25 Aug 2015 16:11:16 +0000 (18:11 +0200)
pv/toolbars/mainbar.cpp

index a1761291ddb835a4ba84c1bcc176849d676e821e..de476e04c94444eaf58c0d3317297efc7b3a5ea3 100644 (file)
@@ -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()