diff options
Diffstat (limited to 'client/widgets')
-rw-r--r-- | client/widgets/dbwidget.cc | 3 | ||||
-rw-r--r-- | client/widgets/metawidget.cc | 26 | ||||
-rw-r--r-- | client/widgets/widget.h | 3 |
3 files changed, 8 insertions, 24 deletions
diff --git a/client/widgets/dbwidget.cc b/client/widgets/dbwidget.cc index 4d6240c..08107b1 100644 --- a/client/widgets/dbwidget.cc +++ b/client/widgets/dbwidget.cc @@ -36,7 +36,6 @@ #include <QLineEdit> #include <QComboBox> -#include "formatparser.h" #include "common.h" #define EMPTY_STRING "Write something in the searchfield" @@ -160,7 +159,7 @@ void DBWidget::update_list(QString prefix) QStringList lst; while(query.next()) { - lst << format_parser(format, query); + // lst << format_parser(format, query); } lst.sort(); 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() diff --git a/client/widgets/widget.h b/client/widgets/widget.h index 3315c2e..d172543 100644 --- a/client/widgets/widget.h +++ b/client/widgets/widget.h @@ -95,6 +95,8 @@ protected: void addChildren(QDomNode &xml_node, QLayout *layout); + LUA *lua; + private: QVector< Widget* > children; void createWidget(QDomNode &xml_node, QLayout *layout); @@ -109,7 +111,6 @@ private: QString widget_type; bool widget_local; - LUA *lua; MacroWindow *macrowindow; bool hasOnChangeEvent; |