int Monitor::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: channelStyleChanged((*reinterpret_cast< Monitor::ChannelStyle(*)>(_a[1]))); break; case 1: valueStyleChanged((*reinterpret_cast< Monitor::ValueStyle(*)>(_a[1]))); break; case 2: slotChooseFont(); break; case 3: slotChannelStyleTriggered(); break; case 4: slotValueStyleTriggered(); break; case 5: slotFixtureAdded((*reinterpret_cast< quint32(*)>(_a[1]))); break; case 6: slotFixtureChanged((*reinterpret_cast< quint32(*)>(_a[1]))); break; case 7: slotFixtureRemoved((*reinterpret_cast< quint32(*)>(_a[1]))); break; case 8: slotTimeout(); break; default: ; } _id -= 9; } return _id; }
void MonitorDmxMode::initToolBar(QToolBar* toolBar) { QActionGroup* group; QAction* action; /* Font */ toolBar->addAction(QIcon(":/fonts.png"), tr("Font"), this, SLOT(slotChooseFont())); toolBar->addSeparator(); /* Channel style */ group = new QActionGroup(this); group->setExclusive(true); action = toolBar->addAction(tr("DMX Channels")); action->setToolTip(tr("Show absolute DMX channel numbers")); action->setCheckable(true); action->setData(MonitorProperties::DMXChannels); connect(action, SIGNAL(triggered(bool)), this, SLOT(slotChannelStyleTriggered())); toolBar->addAction(action); group->addAction(action); if (props()->channelStyle() == MonitorProperties::DMXChannels) action->setChecked(true); action = toolBar->addAction(tr("Relative Channels")); action->setToolTip(tr("Show channel numbers relative to fixture")); action->setCheckable(true); action->setData(MonitorProperties::RelativeChannels); connect(action, SIGNAL(triggered(bool)), this, SLOT(slotChannelStyleTriggered())); toolBar->addAction(action); group->addAction(action); if (props()->channelStyle() == MonitorProperties::RelativeChannels) action->setChecked(true); toolBar->addSeparator(); /* Value display style */ group = new QActionGroup(this); group->setExclusive(true); action = toolBar->addAction(tr("DMX Values")); action->setToolTip(tr("Show DMX values 0-255")); action->setCheckable(true); action->setData(MonitorProperties::DMXValues); connect(action, SIGNAL(triggered(bool)), this, SLOT(slotValueStyleTriggered())); toolBar->addAction(action); group->addAction(action); action->setChecked(true); if (props()->valueStyle() == MonitorProperties::DMXValues) action->setChecked(true); action = toolBar->addAction(tr("Percent Values")); action->setToolTip(tr("Show percentage values 0-100%")); action->setCheckable(true); action->setData(MonitorProperties::PercentageValues); connect(action, SIGNAL(triggered(bool)), this, SLOT(slotValueStyleTriggered())); toolBar->addAction(action); group->addAction(action); if (props()->valueStyle() == MonitorProperties::PercentageValues) action->setChecked(true); /* Universe combo box */ toolBar->addSeparator(); QLabel *uniLabel = new QLabel(tr("Universe")); uniLabel->setMargin(5); toolBar->addWidget(uniLabel); QComboBox *uniCombo = new QComboBox(monitor()); uniCombo->addItem(tr("All universes"), Universe::invalid()); for (quint32 i = 0; i < doc()->inputOutputMap()->universes(); i++) { quint32 uniID = doc()->inputOutputMap()->getUniverseID(i); uniCombo->addItem(doc()->inputOutputMap()->getUniverseNameByIndex(i), uniID); } connect(uniCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUniverseSelected(int))); toolBar->addWidget(uniCombo); }
void Monitor::initToolBar() { QActionGroup* group; QAction* action; QToolBar* toolBar = new QToolBar(this); /* Menu bar */ Q_ASSERT(layout() != NULL); layout()->setMenuBar(toolBar); /* Font */ toolBar->addAction(QIcon(":/fonts.png"), tr("Font"), this, SLOT(slotChooseFont())); toolBar->addSeparator(); /* Channel style */ group = new QActionGroup(this); group->setExclusive(true); action = toolBar->addAction(tr("DMX Channels")); action->setToolTip(tr("Show absolute DMX channel numbers")); action->setCheckable(true); action->setData(DMXChannels); connect(action, SIGNAL(triggered(bool)), this, SLOT(slotChannelStyleTriggered())); toolBar->addAction(action); group->addAction(action); if (channelStyle() == DMXChannels) action->setChecked(true); action = toolBar->addAction(tr("Relative Channels")); action->setToolTip(tr("Show channel numbers relative to fixture")); action->setCheckable(true); action->setData(RelativeChannels); connect(action, SIGNAL(triggered(bool)), this, SLOT(slotChannelStyleTriggered())); toolBar->addAction(action); group->addAction(action); if (channelStyle() == RelativeChannels) action->setChecked(true); toolBar->addSeparator(); /* Value display style */ group = new QActionGroup(this); group->setExclusive(true); action = toolBar->addAction(tr("DMX Values")); action->setToolTip(tr("Show DMX values 0-255")); action->setCheckable(true); action->setData(DMXValues); connect(action, SIGNAL(triggered(bool)), this, SLOT(slotValueStyleTriggered())); toolBar->addAction(action); group->addAction(action); action->setChecked(true); if (valueStyle() == DMXValues) action->setChecked(true); action = toolBar->addAction(tr("Percent Values")); action->setToolTip(tr("Show percentage values 0-100%")); action->setCheckable(true); action->setData(PercentageValues); connect(action, SIGNAL(triggered(bool)), this, SLOT(slotValueStyleTriggered())); toolBar->addAction(action); group->addAction(action); if (valueStyle() == PercentageValues) action->setChecked(true); }