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); }