From 408c7c5b36e1058a76741a22876593ee8c042dd4 Mon Sep 17 00:00:00 2001 From: deva Date: Fri, 24 Jul 2009 13:59:36 +0000 Subject: Introduced a new template tag called 'header' to replace the macro-tag-with-header-attribute construct. --- client/macro.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'client/macro.cc') 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 ¯os, 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 ¯os, 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); -- cgit v1.2.3