int QLCFixtureEditor::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: slotManufacturerTextEdited((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 1: slotModelTextEdited((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 2: slotTypeActivated((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 3: slotChannelListSelectionChanged((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1]))); break;
        case 4: slotAddChannel(); break;
        case 5: slotRemoveChannel(); break;
        case 6: slotEditChannel(); break;
        case 7: slotCopyChannel(); break;
        case 8: slotPasteChannel(); break;
        case 9: slotExpandChannels(); break;
        case 10: slotChannelListContextMenuRequested(); break;
        case 11: slotModeListSelectionChanged((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1]))); break;
        case 12: slotAddMode(); break;
        case 13: slotRemoveMode(); break;
        case 14: slotEditMode(); break;
        case 15: slotCloneMode(); break;
        case 16: slotExpandModes(); break;
        case 17: slotModeListContextMenuRequested(); break;
        case 18: slotClipboardChanged(); break;
        default: ;
        }
        _id -= 19;
    }
    return _id;
}
void QLCFixtureEditor::init()
{
    /* General page */
    m_manufacturerEdit->setText(m_fixtureDef->manufacturer());
    m_manufacturerEdit->setValidator(CAPS_VALIDATOR(this));
    connect(m_manufacturerEdit, SIGNAL(textEdited(const QString&)),
            this, SLOT(slotManufacturerTextEdited(const QString&)));

    m_modelEdit->setText(m_fixtureDef->model());
    m_modelEdit->setValidator(CAPS_VALIDATOR(this));
    connect(m_modelEdit, SIGNAL(textEdited(const QString&)),
            this, SLOT(slotModelTextEdited(const QString&)));

    m_typeCombo->setCurrentIndex(m_typeCombo->findText(m_fixtureDef->type()));
    connect(m_typeCombo, SIGNAL(activated(const QString&)),
            this, SLOT(slotTypeActivated(const QString&)));

    // Display author name or suggest current user name if there isn't one.
    // When the def already has an author, disable the field to prevent modification.
    m_authorEdit->setText(m_fixtureDef->author());
    if (m_authorEdit->text().length() > 0)
    {
        // Temporarily allow editing author name since most definitions contain wrong name:
        // m_authorEdit->setEnabled(false); 
    }
    else
    {
        m_authorEdit->setText(QLCFile::currentUserName());
    }
    connect(m_authorEdit, SIGNAL(textEdited(const QString&)),
            this, SLOT(slotAuthorTextEdited(const QString&)));

    /* Channel page */
    connect(m_addChannelButton, SIGNAL(clicked()),
            this, SLOT(slotAddChannel()));
    connect(m_removeChannelButton, SIGNAL(clicked()),
            this, SLOT(slotRemoveChannel()));
    connect(m_editChannelButton, SIGNAL(clicked()),
            this, SLOT(slotEditChannel()));
    connect(m_copyChannelButton, SIGNAL(clicked()),
            this, SLOT(slotCopyChannel()));
    connect(m_pasteChannelButton, SIGNAL(clicked()),
            this, SLOT(slotPasteChannel()));
    connect(m_expandChannelsButton, SIGNAL(clicked()),
            this, SLOT(slotExpandChannels()));

    connect(m_channelList, SIGNAL(currentItemChanged(QTreeWidgetItem*,
                                  QTreeWidgetItem*)),
            this, SLOT(slotChannelListSelectionChanged(QTreeWidgetItem*)));
    connect(m_channelList, SIGNAL(customContextMenuRequested(const QPoint&)),
            this, SLOT(slotChannelListContextMenuRequested()));
    connect(m_channelList, SIGNAL(itemActivated(QTreeWidgetItem*,int)),
            this, SLOT(slotEditChannel()));
    connect(m_channelList, SIGNAL(expanded(QModelIndex)),
            this, SLOT(slotChannelItemExpanded()));

    m_channelList->setContextMenuPolicy(Qt::CustomContextMenu);
    m_channelList->setIconSize(QSize(24, 24));
    refreshChannelList();

    /* Mode page */
    connect(m_addModeButton, SIGNAL(clicked()),
            this, SLOT(slotAddMode()));
    connect(m_removeModeButton, SIGNAL(clicked()),
            this, SLOT(slotRemoveMode()));
    connect(m_editModeButton, SIGNAL(clicked()),
            this, SLOT(slotEditMode()));
    connect(m_cloneModeButton, SIGNAL(clicked()),
            this, SLOT(slotCloneMode()));
    connect(m_expandModesButton, SIGNAL(clicked()),
            this, SLOT(slotExpandModes()));

    connect(m_modeList, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)),
            this, SLOT(slotModeListSelectionChanged(QTreeWidgetItem*)));
    connect(m_modeList, SIGNAL(customContextMenuRequested(const QPoint&)),
            this, SLOT(slotModeListContextMenuRequested()));
    connect(m_modeList, SIGNAL(itemActivated(QTreeWidgetItem*,int)),
            this, SLOT(slotEditMode()));
    connect(m_modeList, SIGNAL(expanded(QModelIndex)),
            this, SLOT(slotModeItemExpanded()));

    m_modeList->setContextMenuPolicy(Qt::CustomContextMenu);
    refreshModeList();
}
Exemple #3
0
void QLCFixtureEditor::init()
{
	/* General page */
	m_manufacturerEdit->setText(m_fixtureDef->manufacturer());
	connect(m_manufacturerEdit, SIGNAL(textEdited(const QString&)),
		this, SLOT(slotManufacturerTextEdited(const QString&)));

	m_modelEdit->setText(m_fixtureDef->model());
	connect(m_modelEdit, SIGNAL(textEdited(const QString&)),
		this, SLOT(slotModelTextEdited(const QString&)));

	m_typeCombo->setCurrentIndex(
		m_typeCombo->findText(m_fixtureDef->type()));
	connect(m_typeCombo, SIGNAL(activated(const QString&)),
		this, SLOT(slotTypeActivated(const QString&)));

	/* Channel page */
	m_addChannelButton->setIcon(QIcon(":/edit_add.png"));
	connect(m_addChannelButton, SIGNAL(clicked()),
		this, SLOT(slotAddChannel()));

	m_removeChannelButton->setIcon(QIcon(":/edit_remove.png"));
	connect(m_removeChannelButton, SIGNAL(clicked()),
		this, SLOT(slotRemoveChannel()));

	m_editChannelButton->setIcon(QIcon(":/edit.png"));
	connect(m_editChannelButton, SIGNAL(clicked()),
		this, SLOT(slotEditChannel()));

	connect(m_channelList, SIGNAL(currentItemChanged(QTreeWidgetItem*,
							 QTreeWidgetItem*)),
		this, SLOT(slotChannelListSelectionChanged(QTreeWidgetItem*)));
	connect(m_channelList,
		SIGNAL(customContextMenuRequested(const QPoint&)),
		this,
		SLOT(slotChannelListContextMenuRequested(const QPoint&)));
	connect(m_channelList,
		SIGNAL(itemActivated(QTreeWidgetItem*,int)),
		this,
		SLOT(slotEditChannel()));
	
	m_channelList->header()->setResizeMode(QHeaderView::ResizeToContents);
	refreshChannelList();

	/* Mode page */
	m_addModeButton->setIcon(QIcon(":/edit_add.png"));
	connect(m_addModeButton, SIGNAL(clicked()),
		this, SLOT(slotAddMode()));

	m_removeModeButton->setIcon(QIcon(":/edit_remove.png"));
	connect(m_removeModeButton, SIGNAL(clicked()),
		this, SLOT(slotRemoveMode()));

	m_editModeButton->setIcon(QIcon(":/edit.png"));
	connect(m_editModeButton, SIGNAL(clicked()),
		this, SLOT(slotEditMode()));

	connect(m_modeList, SIGNAL(currentItemChanged(QTreeWidgetItem*,
						      QTreeWidgetItem*)),
		this, SLOT(slotModeListSelectionChanged(QTreeWidgetItem*)));
	connect(m_modeList,
		SIGNAL(customContextMenuRequested(const QPoint&)),
		this,
		SLOT(slotModeListContextMenuRequested(const QPoint&)));
	connect(m_modeList,
		SIGNAL(itemActivated(QTreeWidgetItem*,int)),
		this,
		SLOT(slotEditMode()));

	m_modeList->header()->setResizeMode(QHeaderView::ResizeToContents);
	refreshModeList();
}