void FunctionManager::slotBusNameChanged(quint32 id, const QString& name) { /* Change the menu item's name to reflect the new bus name */ QListIterator <QAction*> it(m_busGroup->actions()); while (it.hasNext() == true) { QAction* action = it.next(); Q_ASSERT(action != NULL); if (action->data().toUInt() == id) { action->setText(QString("%1: %2") .arg(id + 1).arg(name)); break; } } /* Change all affected function item's bus names as well */ QListIterator <QTreeWidgetItem*> twit( m_tree->findItems(QString("%1: ").arg(id + 1), Qt::MatchStartsWith, KColumnBus)); while (twit.hasNext() == true) twit.next()->setText(KColumnBus, QString("%1: %2").arg(id + 1).arg(name)); }
void SceneEditor::slotAddFixtureClicked() { /* Put all fixtures already present into a list of fixtures that will be disabled in the fixture selection dialog */ QList <t_fixture_id> disabled; QTreeWidgetItemIterator twit(m_tree); while (*twit != NULL) { disabled.append((*twit)->text(KColumnID).toInt()); twit++; } /* Get a list of new fixtures to add to the scene */ FixtureSelection fs(this, _app->doc(), true, disabled); if (fs.exec() == QDialog::Accepted) { Fixture* fixture; QListIterator <t_fixture_id> it(fs.selection); while (it.hasNext() == true) { fixture = _app->doc()->fixture(it.next()); Q_ASSERT(fixture != NULL); addFixtureItem(fixture); addFixtureTab(fixture); } } }
void EFXEditor::slotAddFixtureClicked() { /* Put all fixtures already present into a list of fixtures that will be disabled in the fixture selection dialog */ QList <t_fixture_id> disabled; QTreeWidgetItemIterator twit(m_tree); while (*twit != NULL) { EFXFixture* ef = reinterpret_cast <EFXFixture*> ((*twit)->data(0, Qt::UserRole).toULongLong()); Q_ASSERT(ef != NULL); /* TODO: Disable all fixtures that don't have pan&tilt chans */ disabled.append(ef->fixture()); twit++; } /* Get a list of new fixtures to add to the scene */ FixtureSelection fs(this, _app->doc(), true, disabled); if (fs.exec() == QDialog::Accepted) { QListIterator <t_fixture_id> it(fs.selection); while (it.hasNext() == true) { EFXFixture* ef = new EFXFixture(m_efx); ef->setFixture(it.next()); if (m_efx->addFixture(ef) == true) addFixtureItem(ef); else delete ef; } } }
void EFXEditor::slotAddFixtureClicked() { /* Put all fixtures already present into a list of fixtures that will be disabled in the fixture selection dialog */ QList <t_fixture_id> disabled; QTreeWidgetItemIterator twit(m_tree); while (*twit != NULL) { EFXFixture* ef = reinterpret_cast <EFXFixture*> ((*twit)->data(0, Qt::UserRole).toULongLong()); Q_ASSERT(ef != NULL); disabled.append(ef->fixture()); twit++; } /* Disable all fixtures that don't have pan OR tilt channels */ for (t_fixture_id fxi_id = 0; fxi_id < KFixtureArraySize; fxi_id++) { Fixture* fixture = _app->doc()->fixture(fxi_id); if (fixture == NULL) continue; // If a channel with pan group exists, don't disable this fixture if (fixture->channel("", Qt::CaseSensitive, KQLCChannelGroupPan) != Fixture::invalidChannel()) { continue; } // If a channel with tilt group exists, don't disable this fixture if (fixture->channel("", Qt::CaseSensitive, KQLCChannelGroupTilt) != Fixture::invalidChannel()) { continue; } // Disable all fixtures without pan or tilt channels disabled << fxi_id; } /* Get a list of new fixtures to add to the scene */ FixtureSelection fs(this, _app->doc(), true, disabled); if (fs.exec() == QDialog::Accepted) { QListIterator <t_fixture_id> it(fs.selection); while (it.hasNext() == true) { EFXFixture* ef = new EFXFixture(m_efx); ef->setFixture(it.next()); if (m_efx->addFixture(ef) == true) addFixtureItem(ef); else delete ef; } } }
void VCXYPadProperties::slotAddClicked() { /* Put all fixtures already present into a list of fixtures that will be disabled in the fixture selection dialog */ QList <t_fixture_id> disabled; QTreeWidgetItemIterator twit(m_tree); while (*twit != NULL) { QVariant var((*twit)->data(KColumnFixture, Qt::UserRole)); VCXYPadFixture fxi(var); disabled << fxi.fixture(); ++twit; } /* Disable all fixtures that don't have pan OR tilt channels */ for (t_fixture_id fxi_id = 0; fxi_id < KFixtureArraySize; fxi_id++) { Fixture* fixture = _app->doc()->fixture(fxi_id); if (fixture == NULL) continue; // If a channel with pan group exists, don't disable this fixture if (fixture->channel("", Qt::CaseSensitive, QLCChannel::Pan) != QLCChannel::invalid()) { continue; } // If a channel with tilt group exists, don't disable this fixture if (fixture->channel("", Qt::CaseSensitive, QLCChannel::Tilt) != QLCChannel::invalid()) { continue; } // Disable all fixtures without pan or tilt channels disabled << fxi_id; } /* Get a list of new fixtures to add to the pad */ QTreeWidgetItem* item = NULL; FixtureSelection fs(this, _app->doc(), true, disabled); if (fs.exec() == QDialog::Accepted) { QListIterator <t_fixture_id> it(fs.selection); while (it.hasNext() == true) { VCXYPadFixture fxi; fxi.setFixture(it.next()); item = new QTreeWidgetItem(m_tree); updateFixtureItem(item, fxi); } } if (item != NULL) m_tree->setCurrentItem(item); }
void TwitterPage::sendReply () { const auto idx = Ui_.TwitList_->currentItem (); if (!idx) { qWarning () << Q_FUNC_INFO << "Malformed index"; return; } const auto twitid = idx->data (Qt::UserRole).value<Tweet_ptr> ()->GetId (); Interface_->Reply (twitid, Ui_.TwitEdit_->text ()); Ui_.TwitEdit_->clear (); disconnect (Ui_.TwitButton_, SIGNAL (clicked ()), 0, 0); connect (Ui_.TwitButton_, SIGNAL (clicked ()), this, SLOT (twit ())); }
void VCXYPadProperties::slotAddClicked() { /* Put all fixtures already present into a list of fixtures that will be disabled in the fixture selection dialog */ QList <GroupHead> disabled; QTreeWidgetItemIterator twit(m_tree); while (*twit != NULL) { QVariant var((*twit)->data(KColumnFixture, Qt::UserRole)); VCXYPadFixture fxi(m_doc, var); disabled << fxi.head(); ++twit; } /* Disable all fixtures that don't have pan OR tilt channels */ QListIterator <Fixture*> fxit(m_doc->fixtures()); while (fxit.hasNext() == true) { Fixture* fixture(fxit.next()); Q_ASSERT(fixture != NULL); // If a channel with pan or tilt group exists, don't disable this fixture if (fixture->channel(QLCChannel::Pan) == QLCChannel::invalid() && fixture->channel(QLCChannel::Tilt) == QLCChannel::invalid()) { // Disable all fixtures without pan or tilt channels disabled << fixture->id(); } else { QVector <QLCFixtureHead> const& heads = fixture->fixtureMode()->heads(); for (int i = 0; i < heads.size(); ++i) { if (heads[i].panMsbChannel() == QLCChannel::invalid() && heads[i].tiltMsbChannel() == QLCChannel::invalid() && heads[i].panLsbChannel() == QLCChannel::invalid() && heads[i].tiltLsbChannel() == QLCChannel::invalid()) { // Disable heads without pan or tilt channels disabled << GroupHead(fixture->id(), i); } } } } /* Get a list of new fixtures to add to the pad */ QTreeWidgetItem* item = NULL; FixtureSelection fs(this, m_doc); fs.setMultiSelection(true); fs.setSelectionMode(FixtureSelection::Heads); fs.setDisabledHeads(disabled); if (fs.exec() == QDialog::Accepted) { QListIterator <GroupHead> it(fs.selectedHeads()); while (it.hasNext() == true) { VCXYPadFixture fxi(m_doc); fxi.setHead(it.next()); item = new QTreeWidgetItem(m_tree); updateFixtureItem(item, fxi); } } if (item != NULL) m_tree->setCurrentItem(item); m_tree->resizeColumnToContents(KColumnFixture); m_tree->resizeColumnToContents(KColumnXAxis); m_tree->resizeColumnToContents(KColumnYAxis); }