Ejemplo n.º 1
0
void RowArea::contextMenuEvent(QContextMenuEvent *event)
{
	OnionSkinMask osMask = TApp::instance()->getCurrentOnionSkin()->getOnionSkinMask();

	QMenu *menu = new QMenu(this);
	QAction *setStartMarker = menu->addAction(tr("Set Start Marker"));
	connect(setStartMarker, SIGNAL(triggered()), SLOT(onSetStartMarker()));
	QAction *setStopMarker = menu->addAction(tr("Set Stop Marker"));
	connect(setStopMarker, SIGNAL(triggered()), SLOT(onSetStopMarker()));
	QAction *removeMarkers = menu->addAction(tr("Remove Markers"));
	connect(removeMarkers, SIGNAL(triggered()), SLOT(onRemoveMarkers()));

	//set both the from and to markers at the specified row
	QAction *previewThis = menu->addAction(tr("Preview This"));
	connect(previewThis, SIGNAL(triggered()), SLOT(onPreviewThis()));

	menu->addSeparator();

	if (Preferences::instance()->isOnionSkinEnabled())
	{
		OnioniSkinMaskGUI::addOnionSkinCommand(menu);
		menu->addSeparator();
	}

	CommandManager *cmdManager = CommandManager::instance();
	menu->addAction(cmdManager->getAction(MI_InsertSceneFrame));
	menu->addAction(cmdManager->getAction(MI_RemoveSceneFrame));
	menu->addAction(cmdManager->getAction(MI_InsertGlobalKeyframe));
	menu->addAction(cmdManager->getAction(MI_RemoveGlobalKeyframe));

	menu->addSeparator();
	menu->addAction(cmdManager->getAction(MI_ShiftTrace));
	menu->addAction(cmdManager->getAction(MI_EditShift));
	menu->addAction(cmdManager->getAction(MI_NoShift));
	menu->addAction(cmdManager->getAction(MI_ResetShift));

	menu->exec(event->globalPos());
}
Ejemplo n.º 2
0
void FilmstripFrames::contextMenuEvent(QContextMenuEvent *event) {
  QMenu *menu             = new QMenu();
  TXshSimpleLevel *sl     = getLevel();
  bool isSubsequenceLevel = (sl && sl->isSubsequence());
  bool isReadOnly         = (sl && sl->isReadOnly());
  CommandManager *cm      = CommandManager::instance();

  menu->addAction(cm->getAction(MI_SelectAll));
  menu->addAction(cm->getAction(MI_InvertSelection));
  menu->addSeparator();
  if (!isSubsequenceLevel && !isReadOnly) {
    menu->addAction(cm->getAction(MI_Cut));
  }
  menu->addAction(cm->getAction(MI_Copy));

  if (!isSubsequenceLevel && !isReadOnly) {
    menu->addAction(cm->getAction(MI_Paste));
    menu->addAction(cm->getAction(MI_PasteInto));
    menu->addAction(cm->getAction(MI_Insert));
    menu->addAction(cm->getAction(MI_Clear));
    menu->addSeparator();
    menu->addAction(cm->getAction(MI_Reverse));
    menu->addAction(cm->getAction(MI_Swing));
    menu->addAction(cm->getAction(MI_Step2));
    menu->addAction(cm->getAction(MI_Step3));
    menu->addAction(cm->getAction(MI_Step4));
    menu->addAction(cm->getAction(MI_Each2));
    menu->addAction(cm->getAction(MI_Each3));
    menu->addAction(cm->getAction(MI_Each4));
    menu->addSeparator();
    menu->addAction(cm->getAction(MI_Duplicate));
    menu->addAction(cm->getAction(MI_MergeFrames));
  }
  menu->addAction(cm->getAction(MI_ExposeResource));
  if (!isSubsequenceLevel && !isReadOnly) {
    menu->addAction(cm->getAction(MI_AddFrames));
    menu->addAction(cm->getAction(MI_Renumber));
    if (sl && sl->getType() == TZP_XSHLEVEL)
      menu->addAction(cm->getAction(MI_RevertToCleanedUp));
    if (sl &&
        (sl->getType() == TZP_XSHLEVEL || sl->getType() == PLI_XSHLEVEL ||
         (sl->getType() == OVL_XSHLEVEL && sl->getPath().getType() != "psd")))
      menu->addAction(cm->getAction(MI_RevertToLastSaved));
  }

  menu->exec(event->globalPos());
}
Ejemplo n.º 3
0
void SchematicToggle::contextMenuEvent(QGraphicsSceneContextMenuEvent *cme) {
  if (!(m_flags & eIsParentColumn)) return;
  if (m_imageOn2.isNull()) {
    QMenu *menu                = new QMenu(0);
    CommandManager *cmdManager = CommandManager::instance();
    menu->addAction(cmdManager->getAction("MI_EnableThisColumnOnly"));
    menu->addAction(cmdManager->getAction("MI_EnableSelectedColumns"));
    menu->addAction(cmdManager->getAction("MI_EnableAllColumns"));
    menu->addAction(cmdManager->getAction("MI_DisableAllColumns"));
    menu->addAction(cmdManager->getAction("MI_DisableSelectedColumns"));
    menu->addAction(cmdManager->getAction("MI_SwapEnabledColumns"));
    QAction *action = menu->exec(cme->screenPos());
  } else {
    QMenu *menu                = new QMenu(0);
    CommandManager *cmdManager = CommandManager::instance();
    menu->addAction(cmdManager->getAction("MI_ActivateThisColumnOnly"));
    menu->addAction(cmdManager->getAction("MI_ActivateSelectedColumns"));
    menu->addAction(cmdManager->getAction("MI_ActivateAllColumns"));
    menu->addAction(cmdManager->getAction("MI_DeactivateAllColumns"));
    menu->addAction(cmdManager->getAction("MI_DeactivateSelectedColumns"));
    menu->addAction(cmdManager->getAction("MI_ToggleColumnsActivation"));
    QAction *action = menu->exec(cme->screenPos());
  }
}