diff options
Diffstat (limited to 'client/macrowindow.cc')
-rw-r--r-- | client/macrowindow.cc | 57 |
1 files changed, 11 insertions, 46 deletions
diff --git a/client/macrowindow.cc b/client/macrowindow.cc index ad85c6f..764bf79 100644 --- a/client/macrowindow.cc +++ b/client/macrowindow.cc @@ -85,10 +85,18 @@ void MacroWindow::initMacro(QDomNode &node) QDomNodeList children = node.childNodes(); + // Build widgets for (int i=0; i<children.count();i++) { QDomNode child = children.at(i); widgets += widgetBuilder(child, mainwidget, this); } + + // Insert their values (this must be done last for lua progs to work properly) + for (int i=0; i<children.count();i++) { + QDomNode child = children.at(i); + setValues(child, this); + } + return; } @@ -98,7 +106,6 @@ void MacroWindow::initMacro(QDomNode &node) QDomNode child = children.at(i); initMacro(child); } - } bool MacroWindow::doCommit() @@ -221,55 +228,13 @@ bool MacroWindow::isClosed() return isclosed; } -QString MacroWindow::getValue(QString name) -{ - // Iterate the different entries, and append their results to the commit string - QVector< Widget* >::iterator i=widgets.begin(); - while (i != widgets.end()) { - Widget* w = *i; - if(name == w->getName()) return w->getValue(); - i++; - } - return name + " - No such field!"; -} - -void MacroWindow::setValue(QString name, QString value) -{ - // Iterate the different entries, and append their results to the commit string - QVector< Widget* >::iterator i = widgets.begin(); - while (i != widgets.end()) { - Widget* w = *i; - if(name == w->getName()) w->setValue(value); - i++; - } -} - -void MacroWindow::enable(QString name) -{ - // Iterate the different entries, and append their results to the commit string - QVector< Widget* >::iterator i=widgets.begin(); - while (i != widgets.end()) { - Widget* w = *i; - if(name == w->getName()) { - w->enable(); - return; - } - i++; - } - printf("widget not found!\n"); -} - -void MacroWindow::disable(QString name) +Widget *MacroWindow::getWidget(QString name) { - // Iterate the different entries, and append their results to the commit string QVector< Widget* >::iterator i=widgets.begin(); while (i != widgets.end()) { Widget* w = *i; - if(name == w->getName()) { - w->disable(); - return; - } + if(name == w->getName()) return w; i++; } - printf("widget not found!\n"); + return NULL; } |