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/macrowindow.cc | 57 ++++++++++----------------------------------------- 1 file changed, 11 insertions(+), 46 deletions(-) (limited to 'client/macrowindow.cc') 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::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; } -- cgit v1.2.3