summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/macro.cc12
-rw-r--r--client/mainwindow.cc6
2 files changed, 12 insertions, 6 deletions
diff --git a/client/macro.cc b/client/macro.cc
index bd7393f..2777cf5 100644
--- a/client/macro.cc
+++ b/client/macro.cc
@@ -45,8 +45,8 @@ void Macro::update(QDomNode &n)
QDomElement xml_elem = node.toElement();
- if(xml_elem.tagName() != "macro") return;
- if(xml_elem.hasAttribute("header")) return;
+ if(xml_elem.tagName() != "macro" && xml_elem.tagName() != "header") return;
+ // if(xml_elem.hasAttribute("header")) return;
name = xml_elem.attribute("name");
@@ -57,7 +57,7 @@ void Macro::init(QBoxLayout *layout, Macros &macros, bool initialising, NetCom &
{
QDomElement xml_elem = node.toElement();
- if(xml_elem.tagName() != "macro") return;
+ if(xml_elem.tagName() != "macro" && xml_elem.tagName() != "header") return;
isstatic = xml_elem.attribute("static", "false") == "true";
iscompact = xml_elem.attribute("compact", "false") == "true";
@@ -67,14 +67,16 @@ void Macro::init(QBoxLayout *layout, Macros &macros, bool initialising, NetCom &
requires = xml_elem.attribute("requires").split(",");
}
- if(xml_elem.hasAttribute("header")) {
+ // if(xml_elem.hasAttribute("header")) {
+ if(xml_elem.tagName() == "header") {
// Macro is a special headline macro.
// Simply create a headline, and ignore the rest.
// Only add header on initial contruction.
if(initialising == true) {
QLabel *header = new QLabel();
- header->setText(xml_elem.attribute("header"));
+ // header->setText(xml_elem.attribute("header"));
+ header->setText(xml_elem.attribute("caption"));
QFont headerfont = header->font();
headerfont.setBold(true);
headerfont.setPointSize(headerfont.pointSize() + 2);
diff --git a/client/mainwindow.cc b/client/mainwindow.cc
index 91d87a7..14ed60b 100644
--- a/client/mainwindow.cc
+++ b/client/mainwindow.cc
@@ -125,9 +125,12 @@ void MainWindow::update()
QDomNodeList macronodes = coursenode.childNodes();
for(int j = 0; j < macronodes.count(); j++) {
+
QDomNode macronode = macronodes.at(j);
QDomElement macroelement = macronode.toElement();
+ // printf("%s\n", macroelement.tagName().toStdString().c_str());
+
QString macroname = macroelement.attribute("name");
bool found = false;
@@ -137,7 +140,8 @@ void MainWindow::update()
i++;
}
- if(found == false || macroelement.hasAttribute("header")) {
+ // if(found == false || macroelement.hasAttribute("header")) {
+ if(found == false || macroelement.tagName() == "header") {
QString num;
num.sprintf("%04d", j);
Macro macro(macronode);