X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fmainwindow.cpp;h=f1493667b766787100f9e8e07a3b9f1107fcb613;hb=5b7cf66c34d7beeef055b06b95d72f9d7a3de680;hp=c8c091d8938d5c863bd9cd1508df20f557ed146f;hpb=c19bccc8c0ce0f788f06258e3cec12c85517e026;p=pulseview.git diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index c8c091d..f149366 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -184,10 +184,18 @@ void MainWindow::on_actionAbout_triggered() void MainWindow::run_stop() { - _session.start_capture( - _sampling_bar->get_selected_device(), - _sampling_bar->get_record_length(), - _sampling_bar->get_sample_rate()); + switch(_session.get_capture_state()) { + case SigSession::Stopped: + _session.start_capture( + _sampling_bar->get_selected_device(), + _sampling_bar->get_record_length(), + _sampling_bar->get_sample_rate()); + break; + + case SigSession::Running: + _session.stop_capture(); + break; + } } } // namespace pv