From f8e858a204bdcfc955ebcec20a78d7a41f6076f5 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 3 Nov 2011 11:07:10 +0100 Subject: Show pcpviewer side-by-side with mainwindow and close it upon mainwindow close. --- client/pracro.cc | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'client/pracro.cc') 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*/ -- cgit v1.2.3