void SceneEditor::removeFixtureItem(Fixture* fixture) { QTreeWidgetItem* item; Q_ASSERT(fixture != NULL); item = fixtureItem(fixture->id()); delete item; }
void EFXEditor::removeFixtureItem(EFXFixture* ef) { QTreeWidgetItem* item; int from; Q_ASSERT(ef != NULL); item = fixtureItem(ef); Q_ASSERT(item != NULL); from = m_tree->indexOfTopLevelItem(item); delete item; updateIndices(from, m_tree->topLevelItemCount() - 1); }
void VCXYPadProperties::slotEditClicked() { /* Get a list of selected fixtures */ QList <VCXYPadFixture> list(selectedFixtures()); /* Start editor */ VCXYPadFixtureEditor editor(this, list); if (editor.exec() == QDialog::Accepted) { QListIterator <VCXYPadFixture> it(editor.fixtures()); while (it.hasNext() == true) { VCXYPadFixture fxi(it.next()); QTreeWidgetItem* item = fixtureItem(fxi); updateFixtureItem(item, fxi); } } }
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; }