X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fmainwindow.cpp;h=6749b5f0343517a6c0afb467f8907f7878dcd38f;hb=ab10caf9278808284c922f8df58a1cc9165d6501;hp=4bf4f127cb9b91925711b72a1756764351160f6a;hpb=f1e9295aa5b9ff538c30b7c799a9c6b0efbfca3b;p=pulseview.git diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 4bf4f127..6749b5f0 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -659,6 +659,25 @@ bool MainWindow::restoreState(const QByteArray &state, int version) return false; } +void MainWindow::on_run_stop_clicked() +{ + shared_ptr session = last_focused_session_; + + if (!session) + return; + + switch (session->get_capture_state()) { + case Session::Stopped: + session->start_capture([&](QString message) { + show_session_error("Capture failed", message); }); + break; + case Session::AwaitingTrigger: + case Session::Running: + session->stop_capture(); + break; + } +} + void MainWindow::on_add_view(views::ViewType type, Session *session) { // We get a pointer and need a reference @@ -709,30 +728,6 @@ void MainWindow::on_new_session_clicked() add_session(); } -void MainWindow::on_run_stop_clicked() -{ - shared_ptr session = last_focused_session_; - - if (!session) - return; - - switch (session->get_capture_state()) { - case Session::Stopped: - session->start_capture([&](QString message) { - show_session_error("Capture failed", message); }); - break; - case Session::AwaitingTrigger: - case Session::Running: - session->stop_capture(); - break; - } -} - -void MainWindow::on_external_trigger() -{ - on_run_stop_clicked(); -} - void MainWindow::on_settings_clicked() { dialogs::Settings dlg(device_manager_);