summaryrefslogtreecommitdiff
path: root/client/widgetbuilder.cc
diff options
context:
space:
mode:
authordeva <deva>2008-07-02 09:42:38 +0000
committerdeva <deva>2008-07-02 09:42:38 +0000
commitfe81dbb0a0dfc9c3808df9576dfe9a8f0b7520be (patch)
tree33281ee07a3fef90dfca8fbe330cbd7f16b79967 /client/widgetbuilder.cc
parent4d7617cbf20985b7cf2231675d8aadd01f77c3d2 (diff)
Made all setValue calls in a second pass, to the construction of the widgets.
Diffstat (limited to 'client/widgetbuilder.cc')
-rw-r--r--client/widgetbuilder.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/client/widgetbuilder.cc b/client/widgetbuilder.cc
index d458379..f1011e5 100644
--- a/client/widgetbuilder.cc
+++ b/client/widgetbuilder.cc
@@ -112,3 +112,20 @@ QVector< Widget* > widgetBuilder(QDomNode xml_node, QWidget *parent, MacroWindow
return widgets;
}
+
+void setValues(QDomNode xml_node, MacroWindow *macrowindow)
+{
+ QDomElement xml_elem = xml_node.toElement();
+
+ if(xml_elem.hasAttribute("name") && xml_elem.hasAttribute("value")) {
+ Widget *widget = macrowindow->getWidget(xml_elem.attribute("name"));
+ if(widget) widget->setValue(xml_elem.attribute("value"));
+ }
+
+ QDomNodeList children = xml_node.childNodes();
+
+ for (int i=0; i<children.count();i++) {
+ QDomNode child = children.at(i);
+ setValues(child, macrowindow);
+ }
+}