diff options
-rw-r--r-- | client/mainwindow.cc | 22 | ||||
-rw-r--r-- | client/mainwindow.h | 2 |
2 files changed, 15 insertions, 9 deletions
diff --git a/client/mainwindow.cc b/client/mainwindow.cc index 884ecf2..6ba72e0 100644 --- a/client/mainwindow.cc +++ b/client/mainwindow.cc @@ -44,6 +44,8 @@ MainWindow::MainWindow(QString cpr, QString course, QString host, quint16 port, : QMainWindow(0, Qt::WindowContextHelpButtonHint), netcom(host, port, user, cpr) { + header = NULL; + setWindowTitle("Pracro - " + cpr); QStatusBar *status = statusBar(); @@ -103,15 +105,17 @@ void MainWindow::update() QString course_title = course_elem.attribute("title"); QString course_name = course_elem.attribute("name"); - QLabel *header = new QLabel(); - header->setText(course_title); - QFont headerfont = header->font(); - headerfont.setBold(true); - headerfont.setPointSize(headerfont.pointSize() + 4); - header->setFont(headerfont); - header->setAlignment(Qt::AlignHCenter); - w->layout()->addWidget(header); - + if(!header) { + header = new QLabel(); + header->setText(course_title); + QFont headerfont = header->font(); + headerfont.setBold(true); + headerfont.setPointSize(headerfont.pointSize() + 4); + header->setFont(headerfont); + header->setAlignment(Qt::AlignHCenter); + w->layout()->addWidget(header); + } + statusBar()->showMessage(course_title + " (" + course_name + ")"); QDomNodeList macronodes = coursenode.childNodes(); diff --git a/client/mainwindow.h b/client/mainwindow.h index f23ade1..00300f4 100644 --- a/client/mainwindow.h +++ b/client/mainwindow.h @@ -51,6 +51,8 @@ private: QMap< QString, MacroWindow* > macros; QWidget *w; + QLabel *header; + bool initialising; void init(); |