diff options
author | deva <deva> | 2009-07-24 13:59:36 +0000 |
---|---|---|
committer | deva <deva> | 2009-07-24 13:59:36 +0000 |
commit | 408c7c5b36e1058a76741a22876593ee8c042dd4 (patch) | |
tree | 2fa4fb2a1586a0019349f3da569cbb1fc86c3dc5 /client/macro.cc | |
parent | c0392425fbc024084da9c626fa47814a34eba3e7 (diff) |
Introduced a new template tag called 'header' to replace the macro-tag-with-header-attribute construct.
Diffstat (limited to 'client/macro.cc')
-rw-r--r-- | client/macro.cc | 12 |
1 files changed, 7 insertions, 5 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 ¯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); |