X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fmainwindow.cpp;h=4a98e4081b68e9999a2f07b3f17d78fdd9276951;hb=e0ba4f6fb263b4cc1dae96df2a0ff1e1ef8984ce;hp=e213f511e7b1f92419d5154f337d524dbfc40c73;hpb=4d1ec09aed2931962808a2b103de8bf1d26e4a60;p=pulseview.git diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index e213f51..4a98e40 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -44,6 +44,7 @@ #include "dialogs/about.hpp" #include "toolbars/mainbar.hpp" #include "view/view.hpp" +#include "views/trace/standardbar.hpp" #include #include @@ -87,7 +88,7 @@ MainWindow::MainWindow(DeviceManager &device_manager, if (!open_file_name.empty()) { shared_ptr session = add_session(); - session->main_bar()->load_init_file(open_file_name, open_file_format); + session->load_init_file(open_file_name, open_file_format); } // Add empty default session if there aren't any sessions @@ -107,8 +108,7 @@ MainWindow::MainWindow(DeviceManager &device_manager, } // ...and if there isn't any, just use demo then - session->main_bar()->select_device(other_device ? - other_device : demo_device); + session->select_device(other_device ? other_device : demo_device); } } @@ -205,12 +205,17 @@ shared_ptr MainWindow::add_view(const QString &title, shared_ptr main_bar = session.main_bar(); if (!main_bar) { - main_bar = make_shared(session, *this); + /* Initial view, create the main bar */ + main_bar = make_shared(session, this, v.get()); dock_main->addToolBar(main_bar.get()); session.set_main_bar(main_bar); connect(main_bar.get(), SIGNAL(new_view(Session*)), this, SLOT(on_new_view(Session*))); + } else { + /* Additional view, create a standard bar */ + dock_main->addToolBar( + new pv::views::trace::StandardBar(session, this, v.get())); } main_bar->action_view_show_cursors()->setChecked(v->cursors_shown()); @@ -578,6 +583,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);