summaryrefslogtreecommitdiff
path: root/client/widgetbuilder.cc
diff options
context:
space:
mode:
authordeva <deva>2008-12-01 15:30:17 +0000
committerdeva <deva>2008-12-01 15:30:17 +0000
commit4ef42a9bae0bd8c17391d1fbb5aa21d78fbe92ce (patch)
tree31f2c7d0f2c63d6681fd86c94ebfae36784a5968 /client/widgetbuilder.cc
parent3ab207d95e47f81cf75effee3822cd787979cae7 (diff)
Added two new widgets: metawidget and altcombobox. Modified multilist to use 'innerwidget' attribute instead of format string.
Diffstat (limited to 'client/widgetbuilder.cc')
-rw-r--r--client/widgetbuilder.cc26
1 files changed, 22 insertions, 4 deletions
diff --git a/client/widgetbuilder.cc b/client/widgetbuilder.cc
index e688f60..3d47d41 100644
--- a/client/widgetbuilder.cc
+++ b/client/widgetbuilder.cc
@@ -107,8 +107,26 @@ QVector< Widget* > widgetBuilder(QDomNode xml_node, QWidget *parent, MacroWindow
widgets.push_back(multilist);
widget = multilist;
- if(parent != NULL && widget != NULL) parent->layout()->addWidget(widget);
- if(widget != NULL) widget->show();
+ if(parent && widget && parent->layout()) parent->layout()->addWidget(widget);
+ if(widget) widget->show();
+
+ return widgets; // Don't iterate children
+ } else if(xml_elem.tagName() == "altcombobox") {
+ AltComboBox *altcombobox = new AltComboBox(xml_elem, macrowindow);
+ widgets.push_back(altcombobox);
+ widget = altcombobox;
+
+ if(parent && widget && parent->layout()) parent->layout()->addWidget(widget);
+ if(widget) widget->show();
+
+ return widgets; // Don't iterate children
+ } else if(xml_elem.tagName() == "metawidget") {
+ MetaWidget *metawidget = new MetaWidget(xml_elem, macrowindow);
+ widgets.push_back(metawidget);
+ widget = metawidget;
+
+ if(parent && widget && parent->layout()) parent->layout()->addWidget(widget);
+ if(widget) widget->show();
return widgets; // Don't iterate children
}
@@ -120,8 +138,8 @@ QVector< Widget* > widgetBuilder(QDomNode xml_node, QWidget *parent, MacroWindow
widgets += widgetBuilder(child, widget, macrowindow);
}
- if(parent != NULL && widget != NULL) parent->layout()->addWidget(widget);
- if(widget != NULL) widget->show();
+ if(parent && widget && parent->layout()) parent->layout()->addWidget(widget);
+ if(widget) widget->show();
return widgets;
}