int VCCueListProperties::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: accept(); break; case 1: slotTabChanged(); break; case 2: slotAddClicked(); break; case 3: slotRemoveClicked(); break; case 4: slotRaiseClicked(); break; case 5: slotLowerClicked(); break; case 6: slotCutClicked(); break; case 7: slotCopyClicked(); break; case 8: slotPasteClicked(); break; case 9: slotNextAttachClicked(); break; case 10: slotNextDetachClicked(); break; case 11: slotNextChooseInputClicked(); break; case 12: slotNextAutoDetectInputToggled((*reinterpret_cast< bool(*)>(_a[1]))); break; case 13: slotNextInputValueChanged((*reinterpret_cast< quint32(*)>(_a[1])),(*reinterpret_cast< quint32(*)>(_a[2]))); break; case 14: slotPreviousAttachClicked(); break; case 15: slotPreviousDetachClicked(); break; case 16: slotPreviousChooseInputClicked(); break; case 17: slotPreviousAutoDetectInputToggled((*reinterpret_cast< bool(*)>(_a[1]))); break; case 18: slotPreviousInputValueChanged((*reinterpret_cast< quint32(*)>(_a[1])),(*reinterpret_cast< quint32(*)>(_a[2]))); break; default: ; } _id -= 19; } return _id; }
void ChaserEditor::init() { setCaption("Chaser Editor"); resize(520, 300); setFixedSize(520, 300); m_nameLabel = new QLabel(this); m_nameLabel->setGeometry(10, 10, 130, 30); m_nameLabel->setText("Chaser Name"); m_nameEdit = new QLineEdit(this); m_nameEdit->setGeometry(130, 10, 230, 30); m_nameEdit->setText(m_function->name()); m_nameEdit->setFocus(); m_nameEdit->setSelection(0, m_function->name().length()); m_functionList = new QListView(this); m_functionList->setGeometry(10, 50, 350, 230); m_functionList->setSorting(-1); m_functionList->addColumn("#"); m_functionList->addColumn("Device"); m_functionList->addColumn("Function"); m_functionList->setAllColumnsShowFocus(true); m_functionList->setResizeMode(QListView::LastColumn); m_raiseButton = new QToolButton(UpArrow, this); m_raiseButton->setGeometry(360, 50, 20, 115); connect(m_raiseButton, SIGNAL(clicked()), this, SLOT(slotRaiseClicked())); m_lowerButton = new QToolButton(DownArrow, this); m_lowerButton->setGeometry(360, 165, 20, 115); connect(m_lowerButton, SIGNAL(clicked()), this, SLOT(slotLowerClicked())); m_addButton = new QPushButton(this); m_addButton->setText("&Add Step"); m_addButton->setGeometry(390, 50, 120, 30); connect(m_addButton, SIGNAL(clicked()), this, SLOT(slotAddClicked())); m_removeButton = new QPushButton(this); m_removeButton->setText("&Remove step"); m_removeButton->setGeometry(390, 90, 120, 30); connect(m_removeButton, SIGNAL(clicked()), this, SLOT(slotRemoveClicked())); m_editButton = new QPushButton(this); m_editButton->setText("&Edit step"); m_editButton->setGeometry(390, 130, 120, 30); connect(m_editButton, SIGNAL(clicked()), this, SLOT(slotEditClicked())); m_ok = new QPushButton(this); m_ok->setText("&OK"); m_ok->setGeometry(390, 220, 120, 30); connect(m_ok, SIGNAL(clicked()), this, SLOT(slotOKClicked())); m_cancel = new QPushButton(this); m_cancel->setText("&Cancel"); m_cancel->setGeometry(390, 260, 120, 30); connect(m_cancel, SIGNAL(clicked()), this, SLOT(slotCancelClicked())); addItems(); }
VCCueListProperties::VCCueListProperties(QWidget* parent, VCCueList* cueList) : QDialog(parent) { Q_ASSERT(cueList != NULL); m_cueList = cueList; setupUi(this); /* Name */ m_nameEdit->setText(cueList->caption()); m_nameEdit->setSelection(0, cueList->caption().length()); /* Connections */ connect(m_addButton, SIGNAL(clicked()), this, SLOT(slotAddClicked())); connect(m_removeButton, SIGNAL(clicked()), this, SLOT(slotRemoveClicked())); connect(m_raiseButton, SIGNAL(clicked()), this, SLOT(slotRaiseClicked())); connect(m_lowerButton, SIGNAL(clicked()), this, SLOT(slotLowerClicked())); connect(m_attachButton, SIGNAL(clicked()), this, SLOT(slotAttachClicked())); connect(m_detachButton, SIGNAL(clicked()), this, SLOT(slotDetachClicked())); /* Put all cues into the tree widget */ QTreeWidgetItemIterator it(m_cueList->m_list); while (*it != NULL) { QTreeWidgetItem* item = new QTreeWidgetItem(m_list); item->setText(KVCCueListColumnNumber, QString("%1") .arg(m_list->indexOfTopLevelItem(item) + 1)); item->setText(KVCCueListColumnName, (*it)->text(KVCCueListColumnName)); item->setText(KVCCueListColumnID, (*it)->text(KVCCueListColumnID)); ++it; } m_list->header()->setResizeMode(QHeaderView::ResizeToContents); /* Key bind */ m_keySequence = QKeySequence(cueList->keySequence()); m_keyEdit->setText(m_keySequence.toString()); }
int ChaserEditor::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: accept(); break; case 1: slotNameEdited((*reinterpret_cast< const QString(*)>(_a[1]))); break; case 2: slotBusComboActivated((*reinterpret_cast< int(*)>(_a[1]))); break; case 3: slotAddClicked(); break; case 4: slotRemoveClicked(); break; case 5: slotRaiseClicked(); break; case 6: slotLowerClicked(); break; default: ; } _id -= 7; } return _id; }
ChaserEditor::ChaserEditor(QWidget* parent, Chaser* chaser) : QDialog(parent) { Q_ASSERT(chaser != NULL); setupUi(this); /* Resize columns to fit contents */ m_tree->header()->setResizeMode(QHeaderView::ResizeToContents); /* Connect UI controls */ connect(m_nameEdit, SIGNAL(textEdited(const QString&)), this, SLOT(slotNameEdited(const QString&))); connect(m_add, SIGNAL(clicked()), this, SLOT(slotAddClicked())); connect(m_remove, SIGNAL(clicked()), this, SLOT(slotRemoveClicked())); connect(m_raise, SIGNAL(clicked()), this, SLOT(slotRaiseClicked())); connect(m_lower, SIGNAL(clicked()), this, SLOT(slotLowerClicked())); /* Create a copy of the original chaser so that we can freely modify it and keep a pointer to the original so that we can move the contents from the copied chaser to the original when OK is clicked */ m_chaser = new Chaser(this); m_chaser->copyFrom(chaser); Q_ASSERT(m_chaser != NULL); m_original = chaser; /* Name edit */ m_nameEdit->setText(m_chaser->name()); m_nameEdit->setSelection(0, m_nameEdit->text().length()); setWindowTitle(tr("Chaser - %1").arg(m_chaser->name())); /* Bus */ connect(m_busCombo, SIGNAL(activated(int)), this, SLOT(slotBusComboActivated(int))); fillBusCombo(); /* Running order */ switch (m_chaser->runOrder()) { default: case Chaser::Loop: m_loop->setChecked(true); break; case Chaser::PingPong: m_pingPong->setChecked(true); break; case Chaser::SingleShot: m_singleShot->setChecked(true); break; } /* Running direction */ switch (m_chaser->direction()) { default: case Chaser::Forward: m_forward->setChecked(true); break; case Chaser::Backward: m_backward->setChecked(true); break; } /* Chaser steps */ updateStepList(0); }
KisLayerBox::KisLayerBox() : QDockWidget(i18n("Layers")) , m_canvas(0) , m_wdgLayerBox(new Ui_WdgLayerBox) { setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); QWidget* mainWidget = new QWidget(this); setWidget(mainWidget); m_delayTimer.setSingleShot(true); m_wdgLayerBox->setupUi(mainWidget); m_wdgLayerBox->listLayers->setDefaultDropAction(Qt::MoveAction); m_wdgLayerBox->listLayers->setVerticalScrollMode(QAbstractItemView::ScrollPerItem); m_wdgLayerBox->listLayers->setSelectionBehavior(QAbstractItemView::SelectRows); connect(m_wdgLayerBox->listLayers, SIGNAL(contextMenuRequested(const QPoint&, const QModelIndex&)), this, SLOT(slotContextMenuRequested(const QPoint&, const QModelIndex&))); connect(m_wdgLayerBox->listLayers, SIGNAL(collapsed(const QModelIndex&)), SLOT(slotCollapsed(const QModelIndex &))); connect(m_wdgLayerBox->listLayers, SIGNAL(expanded(const QModelIndex&)), SLOT(slotExpanded(const QModelIndex &))); m_viewModeMenu = new KMenu(this); QActionGroup *group = new QActionGroup(this); QList<QAction*> actions; actions << m_viewModeMenu->addAction(koIcon("view-list-text"), i18n("Minimal View"), this, SLOT(slotMinimalView())); actions << m_viewModeMenu->addAction(koIcon("view-list-details"), i18n("Detailed View"), this, SLOT(slotDetailedView())); actions << m_viewModeMenu->addAction(koIcon("view-preview"), i18n("Thumbnail View"), this, SLOT(slotThumbnailView())); for (int i = 0, n = actions.count(); i < n; ++i) { actions[i]->setCheckable(true); actions[i]->setActionGroup(group); } m_wdgLayerBox->bnAdd->setIcon(koIcon("list-add")); m_wdgLayerBox->bnViewMode->setMenu(m_viewModeMenu); m_wdgLayerBox->bnViewMode->setPopupMode(QToolButton::InstantPopup); m_wdgLayerBox->bnViewMode->setIcon(koIcon("view-choose")); m_wdgLayerBox->bnViewMode->setText(i18n("View mode")); m_wdgLayerBox->bnDelete->setIcon(koIcon("list-remove")); m_wdgLayerBox->bnDelete->setIconSize(QSize(22, 22)); m_wdgLayerBox->bnRaise->setEnabled(false); m_wdgLayerBox->bnRaise->setIcon(koIcon("go-up")); m_wdgLayerBox->bnRaise->setIconSize(QSize(22, 22)); m_wdgLayerBox->bnLower->setEnabled(false); m_wdgLayerBox->bnLower->setIcon(koIcon("go-down")); m_wdgLayerBox->bnLower->setIconSize(QSize(22, 22)); m_wdgLayerBox->bnLeft->setEnabled(true); m_wdgLayerBox->bnLeft->setIcon(koIcon("arrow-left")); m_wdgLayerBox->bnLeft->setIconSize(QSize(22, 22)); m_wdgLayerBox->bnRight->setEnabled(true); m_wdgLayerBox->bnRight->setIcon(koIcon("arrow-right")); m_wdgLayerBox->bnRight->setIconSize(QSize(22, 22)); m_wdgLayerBox->bnProperties->setIcon(koIcon("document-properties")); m_wdgLayerBox->bnProperties->setIconSize(QSize(22, 22)); m_wdgLayerBox->bnDuplicate->setIcon(koIcon("edit-copy")); m_wdgLayerBox->bnDuplicate->setIconSize(QSize(22, 22)); m_removeAction = new ButtonAction(m_wdgLayerBox->bnDelete, koIcon("edit-delete"), i18n("&Remove Layer"), this); m_removeAction->setActivationFlags(KisAction::ACTIVE_NODE); m_removeAction->setActivationConditions(KisAction::ACTIVE_NODE_EDITABLE); connect(m_removeAction, SIGNAL(triggered()), this, SLOT(slotRmClicked())); m_actions.append(m_removeAction); KisAction* action = new ButtonAction(m_wdgLayerBox->bnLeft, this); action->setActivationFlags(KisAction::ACTIVE_NODE); action->setActivationConditions(KisAction::ACTIVE_NODE_EDITABLE); connect(action, SIGNAL(triggered()), this, SLOT(slotLeftClicked())); m_actions.append(action); action = new ButtonAction(m_wdgLayerBox->bnRight, this); action->setActivationFlags(KisAction::ACTIVE_NODE); action->setActivationConditions(KisAction::ACTIVE_NODE_EDITABLE); connect(action, SIGNAL(triggered()), this, SLOT(slotRightClicked())); m_actions.append(action); m_propertiesAction = new ButtonAction(m_wdgLayerBox->bnProperties, koIcon("document-properties"), i18n("&Properties..."),this); m_propertiesAction->setActivationFlags(KisAction::ACTIVE_NODE); m_propertiesAction->setActivationConditions(KisAction::ACTIVE_NODE_EDITABLE); connect(m_propertiesAction, SIGNAL(triggered()), this, SLOT(slotPropertiesClicked())); m_actions.append(m_propertiesAction); m_dulicateAction = new ButtonAction(m_wdgLayerBox->bnDuplicate, koIcon("edit-copy"), i18n("&Duplicate Layer or Mask"), this); m_dulicateAction->setActivationFlags(KisAction::ACTIVE_NODE); connect(m_dulicateAction, SIGNAL(triggered()), this, SLOT(slotDuplicateClicked())); m_actions.append(m_dulicateAction); // NOTE: this is _not_ a mistake. The layerbox shows the layers in the reverse order connect(m_wdgLayerBox->bnRaise, SIGNAL(clicked()), SLOT(slotLowerClicked())); connect(m_wdgLayerBox->bnLower, SIGNAL(clicked()), SLOT(slotRaiseClicked())); // END NOTE connect(m_wdgLayerBox->doubleOpacity, SIGNAL(valueChanged(qreal)), SLOT(slotOpacitySliderMoved(qreal))); connect(&m_delayTimer, SIGNAL(timeout()), SLOT(slotOpacityChanged())); connect(m_wdgLayerBox->cmbComposite, SIGNAL(activated(int)), SLOT(slotCompositeOpChanged(int))); connect(m_wdgLayerBox->bnAdd, SIGNAL(clicked()), SLOT(slotNewPaintLayer())); m_newPainterLayerAction = new KisAction(koIcon("document-new"), i18n("&Paint Layer"), this); connect(m_newPainterLayerAction, SIGNAL(triggered(bool)), this, SLOT(slotNewPaintLayer())); m_actions.append(m_newPainterLayerAction); m_newGroupLayerAction = new KisAction(koIcon("folder-new"), i18n("&Group Layer"), this); connect(m_newGroupLayerAction, SIGNAL(triggered(bool)), this, SLOT(slotNewGroupLayer())); m_actions.append(m_newGroupLayerAction); m_newCloneLayerAction = new KisAction(koIcon("edit-copy"), i18n("&Clone Layer"), this); connect(m_newCloneLayerAction, SIGNAL(triggered(bool)), this, SLOT(slotNewCloneLayer())); m_actions.append(m_newCloneLayerAction); m_newShapeLayerAction = new KisAction(koIcon("bookmark-new"), i18n("&Vector Layer"), this); connect(m_newShapeLayerAction, SIGNAL(triggered(bool)), this, SLOT(slotNewShapeLayer())); m_actions.append(m_newShapeLayerAction); m_newAdjustmentLayerAction = new KisAction(koIcon("view-filter"), i18n("&Filter Layer..."), this); connect(m_newAdjustmentLayerAction, SIGNAL(triggered(bool)), this, SLOT(slotNewAdjustmentLayer())); m_actions.append(m_newAdjustmentLayerAction); m_newGeneratorLayerAction = new KisAction(koIcon("view-filter"), i18n("&Generated Layer..."), this); connect(m_newGeneratorLayerAction, SIGNAL(triggered(bool)), this, SLOT(slotNewGeneratorLayer())); m_actions.append(m_newGeneratorLayerAction); m_newTransparencyMaskAction = new KisAction(koIcon("edit-copy"), i18n("&Transparency Mask"), this); m_newTransparencyMaskAction->setActivationFlags(KisAction::ACTIVE_LAYER); connect(m_newTransparencyMaskAction, SIGNAL(triggered(bool)), this, SLOT(slotNewTransparencyMask())); m_actions.append(m_newTransparencyMaskAction); m_newEffectMaskAction = new KisAction(koIcon("bookmarks"), i18n("&Filter Mask..."), this); m_newEffectMaskAction->setActivationFlags(KisAction::ACTIVE_LAYER); connect(m_newEffectMaskAction, SIGNAL(triggered(bool)), this, SLOT(slotNewEffectMask())); m_actions.append(m_newEffectMaskAction); m_newSelectionMaskAction = new KisAction(koIcon("edit-paste"), i18n("&Local Selection"), this); m_newSelectionMaskAction->setActivationFlags(KisAction::ACTIVE_LAYER); connect(m_newSelectionMaskAction, SIGNAL(triggered(bool)), this, SLOT(slotNewSelectionMask())); m_actions.append(m_newSelectionMaskAction); m_selectOpaque = new KisAction(i18n("&Select Opaque"), this); m_selectOpaque->setActivationFlags(KisAction::ACTIVE_LAYER); connect(m_selectOpaque, SIGNAL(triggered(bool)), this, SLOT(slotSelectOpaque())); m_actions.append(m_selectOpaque); m_newLayerMenu = new KMenu(this); m_wdgLayerBox->bnAdd->setMenu(m_newLayerMenu); m_wdgLayerBox->bnAdd->setPopupMode(QToolButton::MenuButtonPopup); m_newLayerMenu->addAction(m_newPainterLayerAction); m_newLayerMenu->addAction(m_newGroupLayerAction); m_newLayerMenu->addAction(m_newCloneLayerAction); m_newLayerMenu->addAction(m_newShapeLayerAction); m_newLayerMenu->addAction(m_newAdjustmentLayerAction); m_newLayerMenu->addAction(m_newGeneratorLayerAction); m_newLayerMenu->addSeparator(); m_newLayerMenu->addAction(m_newTransparencyMaskAction); m_newLayerMenu->addAction(m_newEffectMaskAction); #if 0 // XXX_2.0 m_newLayerMenu->addAction(koIcon("view-filter"), i18n("&Transformation Mask..."), this, SLOT(slotNewTransformationMask())); #endif m_newLayerMenu->addAction(m_newSelectionMaskAction); m_nodeModel = new KisNodeModel(this); /** * Connect model updateUI() to enable/disable controls. * Note: nodeActivated() is connected separately in setImage(), because * it needs particular order of calls: first the connection to the * node manager should be called, then updateUI() */ connect(m_nodeModel, SIGNAL(rowsInserted(const QModelIndex&, int, int)), SLOT(updateUI())); connect(m_nodeModel, SIGNAL(rowsRemoved(const QModelIndex&, int, int)), SLOT(updateUI())); connect(m_nodeModel, SIGNAL(rowsMoved(const QModelIndex&, int, int, const QModelIndex&, int)), SLOT(updateUI())); connect(m_nodeModel, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)), SLOT(updateUI())); connect(m_nodeModel, SIGNAL(modelReset()), SLOT(updateUI())); m_wdgLayerBox->listLayers->setModel(m_nodeModel); }