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());
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)));
}
}
shared_ptr<Session> session = make_shared<Session>(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<view::View> main_view =
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();
}
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<Session> s : sessions_)
+ if (s.get() == session)
+ add_view(title, type, *s);
+}
+
void MainWindow::on_actionViewStickyScrolling_triggered()
{
shared_ptr<pv::view::View> view = get_active_view();