diff options
author | deva <deva> | 2009-08-06 13:41:25 +0000 |
---|---|---|
committer | deva <deva> | 2009-08-06 13:41:25 +0000 |
commit | 11591030b43932140fc2e3d4cc922e58f8bb7c6d (patch) | |
tree | cf403a8e2062ed0064cb5e0be085bf50d3414362 /client/widgetbuilder.cc | |
parent | e3fa5da963ba88b64b4aaf83ca53bb3d7aeb1f70 (diff) |
Made macros with prefilled values commitable. Fixed bug, where innerwidget of altcombobox didn't get its value set.
Diffstat (limited to 'client/widgetbuilder.cc')
-rw-r--r-- | client/widgetbuilder.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/client/widgetbuilder.cc b/client/widgetbuilder.cc index 144b2a1..0c9f3b3 100644 --- a/client/widgetbuilder.cc +++ b/client/widgetbuilder.cc @@ -35,6 +35,11 @@ QVector< Widget* > widgetBuilder(QDomNode xml_node, QWidget *parent, QDomElement xml_elem = xml_node.toElement(); + if(xml_elem.hasAttribute("prefilled") && + xml_elem.attribute("prefilled") != "pracro") { + macrowindow->macroChanged(); + } + QWidget *widget = NULL; if(xml_elem.tagName() == "spacer") { if(parent && parent->layout()) { @@ -179,11 +184,13 @@ void setValues(QDomNode xml_node, MacroWindow *macrowindow) { QDomElement xml_elem = xml_node.toElement(); - if(xml_elem.tagName() == "item" || xml_elem.tagName() == "radiobutton") return; + if(xml_elem.tagName() == "item" || + xml_elem.tagName() == "radiobutton") return; 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"), xml_elem.attribute("prefilled", "")); + if(widget && widget->hasInitialValue() == false) // Don't set the value if it is already set indirectly (altcombobox) + widget->setValue(xml_elem.attribute("value"), xml_elem.attribute("prefilled", "")); } QDomNodeList children = xml_node.childNodes(); |