summaryrefslogtreecommitdiff
path: root/client/pracro.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2011-11-03 11:07:10 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2011-11-03 11:07:10 +0100
commitf8e858a204bdcfc955ebcec20a78d7a41f6076f5 (patch)
tree604664e88d52dc0718fab27a674011f082eaee26 /client/pracro.cc
parent8910e356af01a11cf769b891c1aa51eed2cf960f (diff)
Show pcpviewer side-by-side with mainwindow and close it upon mainwindow close.
Diffstat (limited to 'client/pracro.cc')
-rw-r--r--client/pracro.cc21
1 files changed, 14 insertions, 7 deletions
diff --git a/client/pracro.cc b/client/pracro.cc
index 2c9c141..a2f06f3 100644
--- a/client/pracro.cc
+++ b/client/pracro.cc
@@ -182,15 +182,22 @@ int main(int argc, char *argv[])
}
*/
+ MainWindow mainwindow(cpr, course, templ, host, port, user);
+ mainwindow.show();
+
+ PCPViewer *pcpviewer = NULL;
if(show_viewer) {
- PCPViewer pcpviewer(cpr);
- pcpviewer.show();
- return app.exec();
- } else {
- MainWindow mainwindow(cpr, course, templ, host, port, user);
- mainwindow.show();
- return app.exec();
+ pcpviewer = new PCPViewer(cpr);
+ pcpviewer->show();
+ QObject::connect(&mainwindow, SIGNAL(isClosing()),
+ pcpviewer, SLOT(close()));
}
+
+ int ret = app.exec();
+
+ if(pcpviewer) delete pcpviewer;
+
+ return ret;
}
#endif/*TESTING*/