int CollectionEditor::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QDialog::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: slotNameEdited((*reinterpret_cast< const QString(*)>(_a[1]))); break; case 1: slotAdd(); break; case 2: slotRemove(); break; case 3: accept(); break; default: ; } _id -= 4; } return _id; }
CollectionEditor::CollectionEditor(QWidget* parent, Collection* fc) : QDialog(parent) { Q_ASSERT(fc != NULL); m_original = fc; setupUi(this); m_add->setIcon(QIcon(":/edit_add.png")); m_remove->setIcon(QIcon(":/edit_remove.png")); connect(m_nameEdit, SIGNAL(textEdited(const QString&)), this, SLOT(slotNameEdited(const QString&))); connect(m_add, SIGNAL(clicked()), this, SLOT(slotAdd())); connect(m_remove, SIGNAL(clicked()), this, SLOT(slotRemove())); m_fc = new Collection(this); m_fc->copyFrom(fc); Q_ASSERT(m_fc != NULL); m_nameEdit->setText(m_fc->name()); slotNameEdited(m_fc->name()); updateFunctionList(); }
int InputChannelEditor::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QDialog::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: slotNumberChanged((*reinterpret_cast< int(*)>(_a[1]))); break; case 1: slotNameEdited((*reinterpret_cast< const QString(*)>(_a[1]))); break; case 2: slotTypeActivated((*reinterpret_cast< const QString(*)>(_a[1]))); break; default: ; } _id -= 3; } return _id; }
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(); }
int ChaserEditor::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QDialog::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: accept(); break; case 1: slotNameEdited((*reinterpret_cast< const QString(*)>(_a[1]))); break; case 2: slotBusComboActivated((*reinterpret_cast< int(*)>(_a[1]))); break; case 3: slotAddClicked(); break; case 4: slotRemoveClicked(); break; case 5: slotRaiseClicked(); break; case 6: slotLowerClicked(); break; default: ; } _id -= 7; } return _id; }
int AddFixture::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QDialog::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: slotModeActivated((*reinterpret_cast< const QString(*)>(_a[1]))); break; case 1: slotUniverseActivated((*reinterpret_cast< int(*)>(_a[1]))); break; case 2: slotAddressChanged((*reinterpret_cast< int(*)>(_a[1]))); break; case 3: slotChannelsChanged((*reinterpret_cast< int(*)>(_a[1]))); break; case 4: slotSelectionChanged(); break; case 5: slotTreeDoubleClicked((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1]))); break; case 6: slotNameEdited((*reinterpret_cast< const QString(*)>(_a[1]))); break; case 7: slotAmountSpinChanged((*reinterpret_cast< int(*)>(_a[1]))); break; case 8: slotGapSpinChanged((*reinterpret_cast< int(*)>(_a[1]))); break; default: ; } _id -= 9; } return _id; }
AddFixture::AddFixture(QWidget* parent, const Doc* doc, const Fixture* fxi) : QDialog(parent) , m_doc(doc) { m_addressValue = 0; m_universeValue = 0; m_amountValue = 1; m_gapValue = 0; m_channelsValue = 1; m_fixtureDef = NULL; m_mode = NULL; m_fxiCount = 0; m_fixtureID = Fixture::invalidId(); m_invalidAddressFlag = false; setupUi(this); m_addrErrorLabel->hide(); QAction* action = new QAction(this); action->setShortcut(QKeySequence(QKeySequence::Close)); connect(action, SIGNAL(triggered(bool)), this, SLOT(reject())); addAction(action); connect(m_tree, SIGNAL(itemSelectionChanged()), this, SLOT(slotSelectionChanged())); connect(m_tree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(slotTreeDoubleClicked(QTreeWidgetItem*))); connect(m_modeCombo, SIGNAL(activated(const QString&)), this, SLOT(slotModeActivated(const QString&))); connect(m_universeCombo, SIGNAL(activated(int)), this, SLOT(slotUniverseActivated(int))); connect(m_addressSpin, SIGNAL(valueChanged(int)), this, SLOT(slotAddressChanged(int))); connect(m_channelsSpin, SIGNAL(valueChanged(int)), this, SLOT(slotChannelsChanged(int))); connect(m_nameEdit, SIGNAL(textEdited(const QString&)), this, SLOT(slotNameEdited(const QString&))); connect(m_gapSpin, SIGNAL(valueChanged(int)), this, SLOT(slotGapSpinChanged(int))); connect(m_amountSpin, SIGNAL(valueChanged(int)), this, SLOT(slotAmountSpinChanged(int))); connect(m_searchEdit, SIGNAL(textChanged(QString)), this, SLOT(slotSearchFilterChanged(QString))); connect(m_diptoolButton, SIGNAL(clicked()), this, SLOT(slotDiptoolButtonClicked())); /* Fill fixture definition tree (and select a fixture def) */ if (fxi != NULL) { fillTree(fxi->fixtureDef()->manufacturer(), fxi->fixtureDef()->model()); m_fixtureID = fxi->id(); } else fillTree(KXMLFixtureGeneric, KXMLFixtureGeneric); m_fixturesCount->setText(tr("Fixtures found: %1").arg(m_fxiCount)); /* Fill universe combo with available universes */ m_universeCombo->addItems(m_doc->inputOutputMap()->universeNames()); /* Simulate first selection and find the next free address */ slotSelectionChanged(); if (fxi != NULL) { // Universe m_universeCombo->setCurrentIndex(fxi->universe()); slotUniverseActivated(fxi->universe()); m_addressSpin->setValue(fxi->address() + 1); m_addressValue = fxi->address(); m_multipleGroup->setEnabled(false); // Name m_nameEdit->setText(fxi->name()); slotNameEdited(fxi->name()); m_nameEdit->setModified(true); // Prevent auto-naming // Mode int index = m_modeCombo->findText(fxi->fixtureMode()->name()); if (index != -1) { m_channelsSpin->setValue(fxi->channels()); m_modeCombo->setCurrentIndex(index); slotModeActivated(m_modeCombo->itemText(index)); } } else { slotUniverseActivated(0); findAddress(); m_channelsSpin->setValue(1); } QSettings settings; QVariant var = settings.value(SETTINGS_GEOMETRY); if (var.isValid() == true) restoreGeometry(var.toByteArray()); AppUtil::ensureWidgetIsVisible(this); }
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; }
AddFixture::AddFixture(QWidget* parent, const QLCFixtureDefCache& fixtureDefCache, const Doc& doc, const OutputMap& outputMap, const QString& selectManufacturer, const QString& selectModel, const QString& selectMode, const QString& selectName, int selectUniverse, int selectAddress, int selectChannels) : QDialog(parent), m_fixtureDefCache(fixtureDefCache), m_doc(doc), m_outputMap(outputMap) { m_addressValue = 0; m_universeValue = 0; m_amountValue = 1; m_gapValue = 0; m_channelsValue = 1; m_fixtureDef = NULL; m_mode = NULL; setupUi(this); m_tree->header()->setResizeMode(QHeaderView::ResizeToContents); connect(m_tree, SIGNAL(itemSelectionChanged()), this, SLOT(slotSelectionChanged())); connect(m_tree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(slotTreeDoubleClicked(QTreeWidgetItem*))); connect(m_modeCombo, SIGNAL(activated(const QString&)), this, SLOT(slotModeActivated(const QString&))); connect(m_universeCombo, SIGNAL(activated(int)), this, SLOT(slotUniverseActivated(int))); connect(m_addressSpin, SIGNAL(valueChanged(int)), this, SLOT(slotAddressChanged(int))); connect(m_channelsSpin, SIGNAL(valueChanged(int)), this, SLOT(slotChannelsChanged(int))); connect(m_nameEdit, SIGNAL(textEdited(const QString&)), this, SLOT(slotNameEdited(const QString&))); connect(m_gapSpin, SIGNAL(valueChanged(int)), this, SLOT(slotGapSpinChanged(int))); connect(m_amountSpin, SIGNAL(valueChanged(int)), this, SLOT(slotAmountSpinChanged(int))); /* Fill fixture definition tree */ fillTree(selectManufacturer, selectModel); /* Fill universe combo with available universes */ m_universeCombo->addItems(m_outputMap.universeNames()); /* Simulate first selection and find the next free address */ slotSelectionChanged(); if (selectAddress == -1 && selectUniverse == -1) { slotUniverseActivated(0); findAddress(); } else { m_universeCombo->setCurrentIndex(selectUniverse); slotUniverseActivated(selectUniverse); if (m_outputMap.isDMXZeroBased(m_universeValue) == true) m_addressSpin->setValue(selectAddress); else m_addressSpin->setValue(selectAddress + 1); m_addressValue = selectAddress; m_multipleGroup->setEnabled(false); } if (selectName.isEmpty() == false) { m_nameEdit->setText(selectName); slotNameEdited(selectName); } if (selectMode.isEmpty() == false) { int index = m_modeCombo->findText(selectMode); if (index != -1) { m_modeCombo->setCurrentIndex(index); slotModeActivated(m_modeCombo->itemText(index)); } } else { m_channelsSpin->setValue(selectChannels); } QSettings settings; QVariant var = settings.value(SETTINGS_GEOMETRY); if (var.isValid() == true) restoreGeometry(var.toByteArray()); }