From 475882356de5ac95c50cf7e7144117793eec6b2e Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 21 Aug 2008 07:45:08 +0000 Subject: Added aux widget list to macrowindow --- client/macrowindow.cc | 14 +++++++++++++- client/macrowindow.h | 2 ++ client/widgets/multilist.cc | 3 ++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/client/macrowindow.cc b/client/macrowindow.cc index ddaf905..b0eab65 100644 --- a/client/macrowindow.cc +++ b/client/macrowindow.cc @@ -205,14 +205,26 @@ bool MacroWindow::isClosed() Widget *MacroWindow::getWidget(QString name) { - QVector< Widget* >::iterator i=widgets.begin(); + QVector< Widget* >::iterator i = widgets.begin(); while (i != widgets.end()) { Widget* w = *i; if(name == w->getName()) return w; i++; } + + QVector< Widget* >::iterator j = auxwidgets.begin(); + while (j != auxwidgets.end()) { + Widget* w = *j; + if(name == w->getName()) return w; + j++; + } printf("WARNING: Widget %s not found\n", name.toStdString().c_str()); return NULL; } + +void MacroWindow::addAuxWidgets(QVector< Widget* > ws) +{ + auxwidgets += ws; +} diff --git a/client/macrowindow.h b/client/macrowindow.h index 9386f35..322d514 100644 --- a/client/macrowindow.h +++ b/client/macrowindow.h @@ -51,6 +51,7 @@ public: LUA *lua; Widget *getWidget(QString name); + void addAuxWidgets(QVector< Widget* >); public slots: void commit(); @@ -63,6 +64,7 @@ private: bool doCommit(); QVector< Widget* > widgets; + QVector< Widget* > auxwidgets; QString macro; QString version; QWidget *mainwidget; diff --git a/client/widgets/multilist.cc b/client/widgets/multilist.cc index 5f795b3..cbda305 100644 --- a/client/widgets/multilist.cc +++ b/client/widgets/multilist.cc @@ -70,7 +70,8 @@ MultiList::MultiList(QDomNode &node, MacroWindow *macrowindow) QDomNode child = children.at(i); widgets += widgetBuilder(child, inputbox, macrowindow); } - + macrowindow->addAuxWidgets(widgets); + QPushButton *add = new QPushButton(this); connect(add, SIGNAL(clicked()), this, SLOT(add())); add->setText("Tilføj"); -- cgit v1.2.3