From 77272458e7a8906d871b241b5385bbd0f783d861 Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 30 Jul 2009 08:36:12 +0000 Subject: Removed the term 'course' everywhere, and replaced it by 'template'. This reduced/simplified the Template class structure a bit. --- client/mainwindow.cc | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'client/mainwindow.cc') diff --git a/client/mainwindow.cc b/client/mainwindow.cc index 14ed60b..beef88c 100644 --- a/client/mainwindow.cc +++ b/client/mainwindow.cc @@ -40,7 +40,7 @@ #include "macrodrawer.h" -MainWindow::MainWindow(QString cpr, QString course, QString host, quint16 port, QString user) +MainWindow::MainWindow(QString cpr, QString templ, QString host, quint16 port, QString user) : QMainWindow(0, Qt::WindowContextHelpButtonHint), netcom(host, port, user, cpr) { @@ -58,7 +58,7 @@ MainWindow::MainWindow(QString cpr, QString course, QString host, quint16 port, s->setWidgetResizable(true); w->setLayout(new QVBoxLayout()); - this->course = course; + this->templ = templ; setStatusBar(status); @@ -93,15 +93,15 @@ void MainWindow::init() initialising = false; } -void MainWindow::updateCourseHeaders(QDomNode coursenode) +void MainWindow::updateTemplateHeaders(QDomNode templatenode) { - QDomElement course_elem = coursenode.toElement(); - QString course_title = course_elem.attribute("title"); - QString course_name = course_elem.attribute("name"); + QDomElement template_elem = templatenode.toElement(); + QString template_title = template_elem.attribute("title"); + QString template_name = template_elem.attribute("name"); if(!header) { header = new QLabel(); - header->setText(course_title); + header->setText(template_title); QFont headerfont = header->font(); headerfont.setBold(true); headerfont.setPointSize(headerfont.pointSize() + 4); @@ -110,20 +110,20 @@ void MainWindow::updateCourseHeaders(QDomNode coursenode) w->layout()->addWidget(header); } - statusBar()->showMessage(course_title + " (" + course_name + ")"); + statusBar()->showMessage(template_title + " (" + template_name + ")"); } void MainWindow::update() { - QDomDocument xml_doc = netcom.send(course); + QDomDocument xml_doc = netcom.send(templ); - QDomNodeList courses = xml_doc.documentElement().childNodes(); - QDomNode coursenode = courses.at(0); // There can be only one! (Swush, flomp) + QDomNodeList templates = xml_doc.documentElement().childNodes(); + QDomNode templatenode = templates.at(0); // There can be only one! (Swush, flomp) - updateCourseHeaders(coursenode); + updateTemplateHeaders(templatenode); - QDomNodeList macronodes = coursenode.childNodes(); + QDomNodeList macronodes = templatenode.childNodes(); for(int j = 0; j < macronodes.count(); j++) { QDomNode macronode = macronodes.at(j); @@ -165,7 +165,7 @@ void MainWindow::update() Macros::iterator i = macros.begin(); while(i != macros.end()) { Macro ¯o = i.value(); - macro.init((QBoxLayout*)w->layout(), macros, initialising, netcom, course); + macro.init((QBoxLayout*)w->layout(), macros, initialising, netcom, templ); if(macro.window != NULL) { // Remove old connection (if any), to avoid multiple connections. disconnect(macro.window, SIGNAL(updateOnCommit()), this, SLOT(update())); -- cgit v1.2.3