summaryrefslogtreecommitdiff
path: root/client/widgets/metawidget.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/widgets/metawidget.cc')
-rw-r--r--client/widgets/metawidget.cc26
1 files changed, 5 insertions, 21 deletions
diff --git a/client/widgets/metawidget.cc b/client/widgets/metawidget.cc
index a179138..a866445 100644
--- a/client/widgets/metawidget.cc
+++ b/client/widgets/metawidget.cc
@@ -31,10 +31,11 @@
#include <QFrame>
#include "messagebox.h"
-#include "formatparser.h"
#include "macrowindow.h"
#include "common.h"
+#include "debug.h"
+
MetaWidget::MetaWidget(QDomNode &node, MacroWindow *macrowindow)
: Widget(node, macrowindow)
{
@@ -59,24 +60,7 @@ MetaWidget::MetaWidget(QDomNode &node, MacroWindow *macrowindow)
*/
// addChildren(node);
- // Setup format string
- if(elem.hasAttribute("formatlanguage")) {
- formatlanguage = elem.attribute("formatlanguage");
- } else {
- formatlanguage = "pracro";
- }
-
- if(elem.hasAttribute("format")) {
- format = elem.attribute("format");
- } else {
- QVector< Widget* >::iterator i = widgets.begin();
- while (i != widgets.end()) {
- Widget* w = *i;
- if(format != "") format += ", ";
- format += "${" + w->name() + "}";
- i++;
- }
- }
+ format = elem.attribute("format", "");
addChildren(node, frame->layout());
@@ -101,12 +85,12 @@ void MetaWidget::changed()
QString MetaWidget::value()
{
- return format_parser(format, this, formatlanguage);
+ return lua->runScriptS(format, this, "format");
}
void MetaWidget::setValue(QString, QString)
{
- // Nothing reasonable we can do here.
+ WARN(metawidget, "setValue was attempted on this widget.");
}
bool MetaWidget::preValid()