]> sigrok.org Git - pulseview.git/commitdiff
MainWindow: Make on_run_stop_clicked() public
authorSoeren Apel <redacted>
Sun, 25 Oct 2020 20:46:47 +0000 (21:46 +0100)
committerSoeren Apel <redacted>
Sun, 25 Oct 2020 20:47:05 +0000 (21:47 +0100)
pv/mainwindow.cpp
pv/mainwindow.hpp

index 4bf4f127cb9b91925711b72a1756764351160f6a..6749b5f0343517a6c0afb467f8907f7878dcd38f 100644 (file)
@@ -659,6 +659,25 @@ bool MainWindow::restoreState(const QByteArray &state, int version)
        return false;
 }
 
+void MainWindow::on_run_stop_clicked()
+{
+       shared_ptr<Session> 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> 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_);
index 5808a2f289c711d82f4a0fb08323674b499c3f97..e10d1817f947ecb68387cf2f8bd154a3736050cf 100644 (file)
@@ -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> 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_;