示例#1
0
void EditMode::init()
{
    /* Channels page */
    connect(m_addChannelButton, SIGNAL(clicked()), this, SLOT(slotAddChannelClicked()));
    connect(m_removeChannelButton, SIGNAL(clicked()), this, SLOT(slotRemoveChannelClicked()));
    connect(m_raiseChannelButton, SIGNAL(clicked()), this, SLOT(slotRaiseChannelClicked()));
    connect(m_lowerChannelButton, SIGNAL(clicked()), this, SLOT(slotLowerChannelClicked()));

    m_modeNameEdit->setText(m_mode->name());
    m_modeNameEdit->setValidator(CAPS_VALIDATOR(this));
    refreshChannelList();

    /* Heads page */
    connect(m_addHeadButton, SIGNAL(clicked()), this, SLOT(slotAddHeadClicked()));
    connect(m_removeHeadButton, SIGNAL(clicked()), this, SLOT(slotRemoveHeadClicked()));
    connect(m_editHeadButton, SIGNAL(clicked()), this, SLOT(slotEditHeadClicked()));
    connect(m_raiseHeadButton, SIGNAL(clicked()), this, SLOT(slotRaiseHeadClicked()));
    connect(m_lowerHeadButton, SIGNAL(clicked()), this, SLOT(slotLowerHeadClicked()));

    refreshHeadList();

    /* Physical page */
    m_phyEdit = new EditPhysical(m_mode->physical(), this);
    m_phyEdit->show();
    physicalLayout->addWidget(m_phyEdit);

    if (m_mode->useGlobalPhysical() == false)
        m_overridePhyCheck->setChecked(true);
    slotPhysicalModeChanged();

    connect(m_globalPhyCheck, SIGNAL(clicked(bool)), this, SLOT(slotPhysicalModeChanged()));
    connect(m_overridePhyCheck, SIGNAL(clicked(bool)), this, SLOT(slotPhysicalModeChanged()));
    /* Forward copy/paste requests up to reach the main FixtureEditor clipboard */
    connect(m_phyEdit, SIGNAL(copyToClipboard(QLCPhysical)), this, SIGNAL(copyToClipboard(QLCPhysical)));
    connect(m_phyEdit, SIGNAL(requestPasteFromClipboard()), this, SIGNAL(requestPasteFromClipboard()));

    // Close shortcut
    QAction* action = new QAction(this);
    action->setShortcut(QKeySequence(QKeySequence::Close));
    connect(action, SIGNAL(triggered(bool)), this, SLOT(reject()));
    addAction(action);

    // Geometry
    QSettings settings;
    QVariant var = settings.value(KSettingsGeometry);
    if (var.isValid() == true)
        restoreGeometry(var.toByteArray());
}
示例#2
0
int EditMode::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: slotAddChannelClicked(); break;
        case 1: slotRemoveChannelClicked(); break;
        case 2: slotRaiseChannelClicked(); break;
        case 3: slotLowerChannelClicked(); break;
        case 4: accept(); break;
        default: ;
        }
        _id -= 5;
    }
    return _id;
}
示例#3
0
文件: editmode.cpp 项目: speakman/qlc
void EditMode::init()
{
	QString str;
	QLCPhysical physical = m_mode->physical();

	/* Channels page */
	connect(m_addChannelButton, SIGNAL(clicked()),
		this, SLOT(slotAddChannelClicked()));
	connect(m_removeChannelButton, SIGNAL(clicked()),
		this, SLOT(slotRemoveChannelClicked()));
	connect(m_raiseChannelButton, SIGNAL(clicked()),
		this, SLOT(slotRaiseChannelClicked()));
	connect(m_lowerChannelButton, SIGNAL(clicked()),
		this, SLOT(slotLowerChannelClicked()));

	m_modeNameEdit->setText(m_mode->name());
	m_channelList->header()->setResizeMode(QHeaderView::ResizeToContents);
	refreshChannelList();

	/* Physical page */
	m_bulbTypeCombo->setEditText(physical.bulbType());
	m_bulbLumensSpin->setValue(physical.bulbLumens());
	m_bulbTempCombo->setEditText(str.setNum(physical.bulbColourTemperature()));

	m_weightSpin->setValue(physical.weight());
	m_widthSpin->setValue(physical.width());
	m_heightSpin->setValue(physical.height());
	m_depthSpin->setValue(physical.depth());

	m_lensNameCombo->setEditText(physical.lensName());
	m_lensDegreesMinSpin->setValue(physical.lensDegreesMin());
	m_lensDegreesMaxSpin->setValue(physical.lensDegreesMax());

	m_focusTypeCombo->setEditText(physical.focusType());
	m_panMaxSpin->setValue(physical.focusPanMax());
	m_tiltMaxSpin->setValue(physical.focusTiltMax());

	m_powerConsumptionSpin->setValue(physical.powerConsumption());
	m_dmxConnectorCombo->setEditText(physical.dmxConnector());
}