diff options
Diffstat (limited to 'client/pracro.cc')
-rw-r--r-- | client/pracro.cc | 21 |
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*/ |