From: Soeren Apel Date: Sun, 25 Oct 2020 20:46:47 +0000 (+0100) Subject: MainWindow: Make on_run_stop_clicked() public X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=ab10caf9278808284c922f8df58a1cc9165d6501;p=pulseview.git MainWindow: Make on_run_stop_clicked() public --- 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_); diff --git a/pv/mainwindow.hpp b/pv/mainwindow.hpp index 5808a2f2..e10d1817 100644 --- a/pv/mainwindow.hpp +++ b/pv/mainwindow.hpp @@ -115,6 +115,9 @@ private: virtual bool restoreState(const QByteArray &state, int version = 0); +public Q_SLOTS: + void on_run_stop_clicked(); + private Q_SLOTS: void on_add_view(ViewType type, Session *session); @@ -122,7 +125,6 @@ private Q_SLOTS: void on_focused_session_changed(shared_ptr session); void on_new_session_clicked(); - void on_run_stop_clicked(); void on_settings_clicked(); void on_session_name_changed(); @@ -145,9 +147,6 @@ private Q_SLOTS: void on_close_current_tab(); -public Q_SLOTS: - void on_external_trigger(); - private: DeviceManager &device_manager_;