void EFXEditor::initGeneralPage() { m_addFixtureButton->setIcon(QIcon(":/edit_add.png")); m_removeFixtureButton->setIcon(QIcon(":/edit_remove.png")); m_raiseFixtureButton->setIcon(QIcon(":/up.png")); m_lowerFixtureButton->setIcon(QIcon(":/down.png")); connect(m_nameEdit, SIGNAL(textEdited(const QString&)), this, SLOT(slotNameEdited(const QString&))); connect(m_addFixtureButton, SIGNAL(clicked()), this, SLOT(slotAddFixtureClicked())); connect(m_removeFixtureButton, SIGNAL(clicked()), this, SLOT(slotRemoveFixtureClicked())); connect(m_raiseFixtureButton, SIGNAL(clicked()), this, SLOT(slotRaiseFixtureClicked())); connect(m_lowerFixtureButton, SIGNAL(clicked()), this, SLOT(slotLowerFixtureClicked())); connect(m_parallelRadio, SIGNAL(toggled(bool)), this, SLOT(slotParallelRadioToggled(bool))); connect(m_busCombo, SIGNAL(activated(int)), this, SLOT(slotBusComboActivated(int))); /* Set the EFX's name to the name field */ m_nameEdit->setText(m_efx->name()); slotNameEdited(m_efx->name()); /* Put all of the EFX's fixtures to the tree view */ QListIterator <t_fixture_id> it(*m_efx->fixtures()); while (it.hasNext() == true) addFixtureItem(_app->doc()->fixture(it.next())); /* Set propagation mode */ if (m_efx->propagationMode() == EFX::Serial) m_serialRadio->setChecked(true); else m_parallelRadio->setChecked(true); /* Init bus combo and select the EFX's bus */ fillBusCombo(); }
void EFXEditor::initGeneralPage() { connect(m_nameEdit, SIGNAL(textEdited(const QString&)), this, SLOT(slotNameEdited(const QString&))); connect(m_tree, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(slotFixtureItemChanged(QTreeWidgetItem*,int))); connect(m_addFixtureButton, SIGNAL(clicked()), this, SLOT(slotAddFixtureClicked())); connect(m_removeFixtureButton, SIGNAL(clicked()), this, SLOT(slotRemoveFixtureClicked())); connect(m_raiseFixtureButton, SIGNAL(clicked()), this, SLOT(slotRaiseFixtureClicked())); connect(m_lowerFixtureButton, SIGNAL(clicked()), this, SLOT(slotLowerFixtureClicked())); connect(m_parallelRadio, SIGNAL(toggled(bool)), this, SLOT(slotParallelRadioToggled(bool))); connect(m_serialRadio, SIGNAL(toggled(bool)), this, SLOT(slotSerialRadioToggled(bool))); connect(m_asymmetricRadio, SIGNAL(toggled(bool)), this, SLOT(slotAsymmetricRadioToggled(bool))); // Test slots connect(m_testButton, SIGNAL(clicked()), this, SLOT(slotTestClicked())); connect(m_raiseFixtureButton, SIGNAL(clicked()), this, SLOT(slotRestartTest())); connect(m_lowerFixtureButton, SIGNAL(clicked()), this, SLOT(slotRestartTest())); connect(m_parallelRadio, SIGNAL(toggled(bool)), this, SLOT(slotRestartTest())); connect(m_serialRadio, SIGNAL(toggled(bool)), this, SLOT(slotRestartTest())); connect(m_asymmetricRadio, SIGNAL(toggled(bool)), this, SLOT(slotRestartTest())); // Doc connect(m_doc, SIGNAL(fixtureRemoved(quint32)), this, SLOT(slotFixtureRemoved())); connect(m_doc, SIGNAL(fixtureChanged(quint32)), this, SLOT(slotFixtureChanged())); /* Set the EFX's name to the name field */ m_nameEdit->setText(m_efx->name()); m_nameEdit->setSelection(0, m_nameEdit->text().length()); /* Resize columns to fit contents */ m_tree->header()->setResizeMode(QHeaderView::ResizeToContents); /* Put all of the EFX's fixtures to the tree view */ updateFixtureTree(); /* Set propagation mode */ if (m_efx->propagationMode() == EFX::Serial) m_serialRadio->setChecked(true); else if (m_efx->propagationMode() == EFX::Asymmetric) m_asymmetricRadio->setChecked(true); else m_parallelRadio->setChecked(true); /* Disable test button if we're in operate mode */ if (m_doc->mode() == Doc::Operate) m_testButton->setEnabled(false); }
void SceneEditor::init() { QToolBar* toolBar; /* Actions */ m_enableCurrentAction = new QAction(QIcon(":/check.png"), tr("Enable all channels in current fixture"), this); m_disableCurrentAction = new QAction(QIcon(":/uncheck.png"), tr("Disable all channels in current fixture"), this); m_copyAction = new QAction(QIcon(":/editcopy.png"), tr("Copy current values to clipboard"), this); m_pasteAction = new QAction(QIcon(":/editpaste.png"), tr("Paste clipboard values to current fixture"), this); m_copyToAllAction = new QAction(QIcon(":/editcopyall.png"), tr("Copy current values to all fixtures"), this); m_colorToolAction = new QAction(QIcon(":/color.png"), tr("Color tool for CMY/RGB-capable fixtures"), this); connect(m_enableCurrentAction, SIGNAL(triggered(bool)), this, SLOT(slotEnableCurrent())); connect(m_disableCurrentAction, SIGNAL(triggered(bool)), this, SLOT(slotDisableCurrent())); connect(m_copyAction, SIGNAL(triggered(bool)), this, SLOT(slotCopy())); connect(m_pasteAction, SIGNAL(triggered(bool)), this, SLOT(slotPaste())); connect(m_copyToAllAction, SIGNAL(triggered(bool)), this, SLOT(slotCopyToAll())); connect(m_colorToolAction, SIGNAL(triggered(bool)), this, SLOT(slotColorTool())); /* Toolbar */ toolBar = new QToolBar(this); layout()->setMenuBar(toolBar); toolBar->addAction(m_enableCurrentAction); toolBar->addAction(m_disableCurrentAction); toolBar->addSeparator(); toolBar->addAction(m_copyAction); toolBar->addAction(m_pasteAction); toolBar->addAction(m_copyToAllAction); toolBar->addSeparator(); toolBar->addAction(m_colorToolAction); /* Tab widget */ connect(m_tab, SIGNAL(currentChanged(int)), this, SLOT(slotTabChanged(int))); /* Add & remove buttons */ connect(m_addFixtureButton, SIGNAL(clicked()), this, SLOT(slotAddFixtureClicked())); connect(m_removeFixtureButton, SIGNAL(clicked()), this, SLOT(slotRemoveFixtureClicked())); m_nameEdit->setText(m_scene->name()); connect(m_nameEdit, SIGNAL(textEdited(const QString&)), this, SLOT(slotNameEdited(const QString&))); slotNameEdited(m_scene->name()); /* Bus */ connect(m_busCombo, SIGNAL(activated(int)), this, SLOT(slotBusComboActivated(int))); fillBusCombo(); m_initializing = true; QListIterator <SceneValue> it(m_scene->values()); while (it.hasNext() == true) { SceneValue scv(it.next()); if (fixtureItem(scv.fxi) == NULL) { Fixture* fixture = _app->doc()->fixture(scv.fxi); if (fixture == NULL) continue; addFixtureItem(fixture); addFixtureTab(fixture); } setSceneValue(scv); } m_initializing = false; }