projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Save/restore view states and signal settings
[pulseview.git]
/
pv
/
mainwindow.cpp
diff --git
a/pv/mainwindow.cpp
b/pv/mainwindow.cpp
index 77dc946213ef20850247fc0b5acf15f51b820df3..874f66ce7c2cd8e0fb07d326affa837b7d976d9f 100644
(file)
--- a/
pv/mainwindow.cpp
+++ b/
pv/mainwindow.cpp
@@
-218,6
+218,9
@@
shared_ptr<Session> MainWindow::add_session()
shared_ptr<Session> session = make_shared<Session>(device_manager_, name);
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 =
sessions_.push_back(session);
shared_ptr<view::View> main_view =
@@
-334,6
+337,15
@@
bool MainWindow::restoreState(const QByteArray &state, int version)
return false;
}
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();
void MainWindow::on_actionViewStickyScrolling_triggered()
{
shared_ptr<pv::view::View> view = get_active_view();