summaryrefslogtreecommitdiff
path: root/client/macrowindow.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/macrowindow.cc')
-rw-r--r--client/macrowindow.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/client/macrowindow.cc b/client/macrowindow.cc
index 7641fdc..ca76b46 100644
--- a/client/macrowindow.cc
+++ b/client/macrowindow.cc
@@ -42,6 +42,9 @@
extern MainWindow *gmainwindow;
+extern QString cpr;
+extern QString user;
+
MacroWindow::MacroWindow(NetCom &n, QString templ,
bool is_static, bool compact,
QScrollArea *scrollarea)
@@ -52,7 +55,7 @@ MacroWindow::MacroWindow(NetCom &n, QString templ,
DEBUG(macrowindow, "Constructor %p\n", this);
mainwidget = NULL;
- lua = new LUA(&mainwidget);
+ lua = new LUA(&mainwidget, templ, "", user, cpr);
waschanged = false;
@@ -80,6 +83,8 @@ void MacroWindow::update(QDomNode &node)
if(macro == "") macro = elem.attribute("name", "");
if(version == "") version = elem.attribute("version", "");
+ lua->macro = macro;
+
if(macro != elem.attribute("name", "")) return;
if(version != elem.attribute("version", "")) return;
@@ -133,14 +138,15 @@ void MacroWindow::initMacro(QDomNode &node)
if(elem.tagName() == "widgets") {
Window *window = new Window(elem, this);
+ mainwidget = window;
connect(window, SIGNAL(wasChanged()), this, SLOT(macroChanged()));
macrotitle = elem.attribute("caption");
window->setValues();
+ window->runEventOnInit(true);
if(waschanged == true) macroChanged();
- WARN(macrowindow, "New window.");
- mainwidget = window;
+ WARN(macrowindow, "New window.\n");
animateToWidget(mainwidget->qwidget());
return; // No further recursion here.