Exemplo n.º 1
0
void EFXEditor::updateFixtureTree()
{
    m_tree->clear();
    QListIterator <EFXFixture*> it(m_efx->fixtures());
    while (it.hasNext() == true)
        addFixtureItem(it.next());
}
Exemplo n.º 2
0
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);
        }
    }
}
Exemplo n.º 3
0
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;
		}
	}
}
Exemplo n.º 4
0
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;
		}
	}
}
Exemplo n.º 5
0
void EFXEditor::updateFixtureTree()
{
    m_tree->clear();
    QListIterator <EFXFixture*> it(m_efx->fixtures());
    while (it.hasNext() == true)
        addFixtureItem(it.next());
    m_tree->header()->resizeSections(QHeaderView::ResizeToContents);
}
Exemplo n.º 6
0
void EFXEditor::updateFixtureTree()
{
    m_tree->clear();
    QListIterator <EFXFixture*> it(m_efx->fixtures());
    while (it.hasNext() == true)
        addFixtureItem(it.next());
    m_tree->resizeColumnToContents(KColumnNumber);
    m_tree->resizeColumnToContents(KColumnName);
    m_tree->resizeColumnToContents(KColumnMode);
    m_tree->resizeColumnToContents(KColumnReverse);
    m_tree->resizeColumnToContents(KColumnStartOffset);
}
Exemplo n.º 7
0
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();
}
Exemplo n.º 8
0
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;
}