]> sigrok.org Git - pulseview.git/blobdiff - pv/mainwindow.cpp
Fix #849 by making sure no references to the DecodeTrace instance remain
[pulseview.git] / pv / mainwindow.cpp
index f0840bca8372c445d7851e0245c67c5397820bf2..1738f9b16cfea0adfcfa65d6018c0bbffab68bf4 100644 (file)
@@ -346,14 +346,23 @@ void MainWindow::setup_ui()
        run_stop_button_->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
        run_stop_button_->setShortcut(QKeySequence(Qt::Key_Space));
 
-       QFrame *separator = new QFrame();
-       separator->setFrameStyle(QFrame::VLine | QFrame::Raised);
+       settings_button_ = new QToolButton();
+       settings_button_->setIcon(QIcon::fromTheme("configure",
+               QIcon(":/icons/configure.png")));
+       settings_button_->setAutoRaise(true);
+
+       QFrame *separator1 = new QFrame();
+       separator1->setFrameStyle(QFrame::VLine | QFrame::Raised);
+       QFrame *separator2 = new QFrame();
+       separator2->setFrameStyle(QFrame::VLine | QFrame::Raised);
 
        QHBoxLayout* layout = new QHBoxLayout();
        layout->setContentsMargins(2, 2, 2, 2);
        layout->addWidget(new_session_button_);
-       layout->addWidget(separator);
+       layout->addWidget(separator1);
        layout->addWidget(run_stop_button_);
+       layout->addWidget(separator2);
+       layout->addWidget(settings_button_);
 
        static_tab_widget_ = new QWidget();
        static_tab_widget_->setLayout(layout);
@@ -569,6 +578,14 @@ void MainWindow::on_session_name_changed()
                        }
        }
 
+       // Update the tab widget by finding the main window and the tab from that
+       for (auto entry : session_windows_)
+               if (entry.first.get() == session) {
+                       QMainWindow *window = entry.second;
+                       const int index = session_selector_.indexOf(window);
+                       session_selector_.setTabText(index, session->name());
+               }
+
        // Refresh window title if the affected session has focus
        if (session == last_focused_session_.get())
                setWindowTitle(session->name() + " - " + WindowTitle);