X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fmainwindow.cpp;h=a99ba35298c39080930e764adcb699e0feb6d707;hb=956a945e4d42d0d7718e6f1364d567f5e25ebf49;hp=6e408583a52d0cb1e7e2c45870c950cbedc4094f;hpb=101e7a9b40cc97fcd94aca7a1bed086b1f56f269;p=pulseview.git diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 6e40858..a99ba35 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -191,10 +191,6 @@ shared_ptr MainWindow::add_view(const QString &title, if (type == view::TraceView) { connect(&session, SIGNAL(trigger_event(util::Timestamp)), v.get(), SLOT(trigger_event(util::Timestamp))); - connect(v.get(), SIGNAL(sticky_scrolling_changed(bool)), this, - SLOT(sticky_scrolling_changed(bool))); - connect(v.get(), SIGNAL(always_zoom_to_fit_changed(bool)), this, - SLOT(always_zoom_to_fit_changed(bool))); v->enable_sticky_scrolling(action_view_sticky_scrolling_->isChecked()); v->enable_coloured_bg(action_view_coloured_bg_->isChecked()); @@ -206,6 +202,9 @@ shared_ptr MainWindow::add_view(const QString &title, session.set_main_bar(main_bar); } main_bar->action_view_show_cursors()->setChecked(v->cursors_shown()); + + connect(v.get(), SIGNAL(always_zoom_to_fit_changed(bool)), + main_bar.get(), SLOT(on_always_zoom_to_fit_changed(bool))); } } @@ -219,6 +218,9 @@ shared_ptr MainWindow::add_session() shared_ptr session = make_shared(device_manager_, name); + connect(session.get(), SIGNAL(add_view(const QString&, view::ViewType, Session*)), + this, SLOT(on_add_view(const QString&, view::ViewType, Session*))); + sessions_.push_back(session); shared_ptr main_view = @@ -253,6 +255,8 @@ void MainWindow::setup_ui() action_about_->setObjectName(QString::fromUtf8("actionAbout")); action_about_->setText(tr("&About...")); + setDockNestingEnabled(true); + // Set the title setWindowTitle(tr("PulseView")); } @@ -274,11 +278,13 @@ void MainWindow::save_ui_settings() dynamic_pointer_cast< devices::HardwareDevice > (session->device()); - if (device->hardware_device()->driver()->name() == "demo") + if (device && + device->hardware_device()->driver()->name() == "demo") continue; } settings.beginGroup("Session" + QString::number(id++)); + settings.remove(""); // Remove all keys in this group session->save_settings(settings); settings.endGroup(); } @@ -333,6 +339,15 @@ bool MainWindow::restoreState(const QByteArray &state, int version) return false; } +void MainWindow::on_add_view(const QString &title, view::ViewType type, + Session *session) +{ + // We get a pointer and need a reference + for (std::shared_ptr s : sessions_) + if (s.get() == session) + add_view(title, type, *s); +} + void MainWindow::on_actionViewStickyScrolling_triggered() { shared_ptr view = get_active_view();