diff options
Diffstat (limited to 'client/widgetbuilder.cc')
-rw-r--r-- | client/widgetbuilder.cc | 17 |
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); + } +} |