From: Robert J. <spa...@us...> - 2006-01-08 22:45:06
|
Update of /cvsroot/lmuse/muse/muse In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15255/muse Modified Files: plugingui.cpp plugingui.h Log Message: plugin gui additions Index: plugingui.h =================================================================== RCS file: /cvsroot/lmuse/muse/muse/plugingui.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** plugingui.h 26 Dec 2005 16:24:00 -0000 1.16 --- plugingui.h 8 Jan 2006 22:44:55 -0000 1.17 *************** *** 54,57 **** --- 54,58 ---- QToolButton* onOff; + void connectPrebuiltGui(QWidget* wContainer); private slots: Index: plugingui.cpp =================================================================== RCS file: /cvsroot/lmuse/muse/muse/plugingui.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** plugingui.cpp 8 Jan 2006 15:11:20 -0000 1.30 --- plugingui.cpp 8 Jan 2006 22:44:55 -0000 1.31 *************** *** 371,410 **** setCentralWidget(mw); - QObjectList l = mw->children(); - for (int i = 0; i < l.size(); ++i) { - QObject* obj = l.at(i); - - const char* name = obj->objectName().toLatin1().data(); - if (*name !='P') - continue; - GuiWidget w; - w.widget = (QWidget*)obj; - if (strcmp(obj->metaObject()->className(), "Awl::Slider") == 0) { - connect((Slider*)obj, SIGNAL(valueChanged(float,int)), SLOT(setController(float,int))); - w.type = GuiWidget::SLIDER; - w.parameter = ((Slider*)obj)->id(); - } - else if (strcmp(obj->metaObject()->className(), "Awl::FloatEntry") == 0) { - connect((FloatEntry*)obj, SIGNAL(valueChanged(float,int)), SLOT(setController(float,int))); - w.type = GuiWidget::FLOAT_ENTRY; - w.parameter = ((FloatEntry*)obj)->id(); - } - else if (strcmp(obj->metaObject()->className(), "Awl::CheckBox") == 0) { - w.type = GuiWidget::CHECKBOX; - w.parameter = ((CheckBox*)obj)->id(); - connect(obj, SIGNAL(valueChanged(float, int)), SLOT(setController(float, int))); - } - else if (strcmp(obj->metaObject()->className(), "Awl::ComboBox") == 0) { - w.type = GuiWidget::COMBOBOX; - w.parameter = ((ComboBox*)obj)->id(); - connect(obj, SIGNAL(valueChanged(float, int)), SLOT(setController(float,int))); - } - else { - printf("PluginGui::unknown widget class %s\n", obj->metaObject()->className()); - continue; - } - gw.push_back(w); - } } else { --- 371,376 ---- setCentralWidget(mw); + connectPrebuiltGui(mw); } else { *************** *** 510,513 **** --- 476,526 ---- } + + + void PluginGui::connectPrebuiltGui(QWidget* wContainer) + { + QObjectList l = wContainer->children(); + for (int i = 0; i < l.size(); ++i) { + + QObject* obj = l.at(i); + + const char* name = obj->objectName().toLatin1().data(); + + if (strcmp(obj->metaObject()->className(), "QFrame") == 0) { + connectPrebuiltGui((QWidget *)obj); + } + if (*name !='P') + continue; + GuiWidget w; + w.widget = (QWidget*)obj; + if (strcmp(obj->metaObject()->className(), "Awl::Slider") == 0) { + connect((Slider*)obj, SIGNAL(valueChanged(float,int)), SLOT(setController(float,int))); + w.type = GuiWidget::SLIDER; + w.parameter = ((Slider*)obj)->id(); + } + else if (strcmp(obj->metaObject()->className(), "Awl::FloatEntry") == 0) { + connect((FloatEntry*)obj, SIGNAL(valueChanged(float,int)), SLOT(setController(float,int))); + w.type = GuiWidget::FLOAT_ENTRY; + w.parameter = ((FloatEntry*)obj)->id(); + } + else if (strcmp(obj->metaObject()->className(), "Awl::CheckBox") == 0) { + w.type = GuiWidget::CHECKBOX; + w.parameter = ((CheckBox*)obj)->id(); + connect(obj, SIGNAL(valueChanged(float, int)), SLOT(setController(float, int))); + } + else if (strcmp(obj->metaObject()->className(), "Awl::ComboBox") == 0) { + w.type = GuiWidget::COMBOBOX; + w.parameter = ((ComboBox*)obj)->id(); + connect(obj, SIGNAL(valueChanged(float, int)), SLOT(setController(float,int))); + } + else { + printf("PluginGui::unknown widget class %s\n", obj->metaObject()->className()); + continue; + } + gw.push_back(w); + } + } + + //--------------------------------------------------------- // PluginGui |