X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fmainwindow.cpp;h=7fe09fb732e9789ca8be26a958a4057a50e5a0fe;hb=8d466c03419819b02bbbcd591ff6c2847f507d6f;hp=4a98e4081b68e9999a2f07b3f17d78fdd9276951;hpb=e0ba4f6fb263b4cc1dae96df2a0ff1e1ef8984ce;p=pulseview.git diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 4a98e408..7fe09fb7 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -161,7 +161,7 @@ shared_ptr MainWindow::get_active_view() const shared_ptr MainWindow::add_view(const QString &title, views::ViewType type, Session &session) { - QMainWindow *main_window; + QMainWindow *main_window = nullptr; for (auto entry : session_windows_) if (entry.first.get() == &session) main_window = entry.second; @@ -212,15 +212,16 @@ shared_ptr MainWindow::add_view(const QString &title, connect(main_bar.get(), SIGNAL(new_view(Session*)), this, SLOT(on_new_view(Session*))); + + main_bar->action_view_show_cursors()->setChecked(v->cursors_shown()); } 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()); + pv::views::trace::StandardBar *standard_bar = + new pv::views::trace::StandardBar(session, this, v.get()); + dock_main->addToolBar(standard_bar); - connect(v.get(), SIGNAL(always_zoom_to_fit_changed(bool)), - main_bar.get(), SLOT(on_always_zoom_to_fit_changed(bool))); + standard_bar->action_view_show_cursors()->setChecked(v->cursors_shown()); + } } return v;