summaryrefslogtreecommitdiff
path: root/client/lua.cc
diff options
context:
space:
mode:
authordeva <deva>2008-07-02 09:42:38 +0000
committerdeva <deva>2008-07-02 09:42:38 +0000
commitfe81dbb0a0dfc9c3808df9576dfe9a8f0b7520be (patch)
tree33281ee07a3fef90dfca8fbe330cbd7f16b79967 /client/lua.cc
parent4d7617cbf20985b7cf2231675d8aadd01f77c3d2 (diff)
Made all setValue calls in a second pass, to the construction of the widgets.
Diffstat (limited to 'client/lua.cc')
-rw-r--r--client/lua.cc15
1 files changed, 11 insertions, 4 deletions
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)