diff options
author | deva <deva> | 2008-08-21 07:45:08 +0000 |
---|---|---|
committer | deva <deva> | 2008-08-21 07:45:08 +0000 |
commit | 475882356de5ac95c50cf7e7144117793eec6b2e (patch) | |
tree | 0d9deaa1b80835fef14365af80060b831b6750cf | |
parent | 346bb313cd27383b3c7e54da7750ee4f17758d12 (diff) |
Added aux widget list to macrowindow
-rw-r--r-- | client/macrowindow.cc | 14 | ||||
-rw-r--r-- | client/macrowindow.h | 2 | ||||
-rw-r--r-- | 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"); |