From fe81dbb0a0dfc9c3808df9576dfe9a8f0b7520be Mon Sep 17 00:00:00 2001 From: deva Date: Wed, 2 Jul 2008 09:42:38 +0000 Subject: Made all setValue calls in a second pass, to the construction of the widgets. --- client/lua.cc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'client/lua.cc') diff --git a/client/lua.cc b/client/lua.cc index 22249a4..65d0188 100644 --- a/client/lua.cc +++ b/client/lua.cc @@ -28,6 +28,8 @@ #include "macrowindow.h" +#include "widgets/widget.h" + #define GLOBAL_POINTER "_pracroGlobalLUAObjectPointerThisShouldBeANameThatIsNotAccidentallyOverwritten" static int _enable(lua_State *L) @@ -170,22 +172,27 @@ LUA::~LUA() QString LUA::getValue(QString name) { - return macrowindow->getValue(name); + Widget *widget = macrowindow->getWidget(name); + if(widget) return widget->getValue(); + return ""; } void LUA::setValue(QString name, QString value) { - macrowindow->setValue(name, value); + Widget *widget = macrowindow->getWidget(name); + if(widget) return widget->setValue(value); } void LUA::enable(QString name) { - return macrowindow->enable(name); + Widget *widget = macrowindow->getWidget(name); + if(widget) return widget->enable(); } void LUA::disable(QString name) { - return macrowindow->disable(name); + Widget *widget = macrowindow->getWidget(name); + if(widget) return widget->disable(); } bool LUA::run(QString program, QString name, QString value) -- cgit v1.2.3