372
372
m_pContextPopup->clear();
374
PopupTreeWidgetItem * parentMenu = 0;
374
//PopupTreeWidgetItem * parentMenu = 0;
375
375
bool bIsMenu = false;
379
parentMenu = (PopupTreeWidgetItem *) (((PopupTreeWidgetItem *)it)->parent());
379
//parentMenu = (PopupTreeWidgetItem *) (((PopupTreeWidgetItem *)it)->parent());
380
380
bIsMenu = ((PopupTreeWidgetItem *)it)->m_type == PopupTreeWidgetItem::Menu;
383
m_pContextPopup->insertItem(__tr2qs_ctx("New Separator Below","editor"),this,SLOT(contextNewSeparatorBelow()));
384
m_pContextPopup->setItemEnabled(
385
m_pContextPopup->insertItem(__tr2qs_ctx("New Separator Above","editor"),this,SLOT(contextNewSeparatorAbove())),it);
386
m_pContextPopup->setItemEnabled(
387
m_pContextPopup->insertItem(__tr2qs_ctx("New Separator Inside","editor"),this,SLOT(contextNewSeparatorInside())),it && bIsMenu);
389
m_pContextPopup->insertSeparator();
391
m_pContextPopup->insertItem(__tr2qs_ctx("New Label Below","editor"),this,SLOT(contextNewLabelBelow()));
392
m_pContextPopup->setItemEnabled(
393
m_pContextPopup->insertItem(__tr2qs_ctx("New Label Above","editor"),this,SLOT(contextNewLabelAbove())),it);
394
m_pContextPopup->setItemEnabled(
395
m_pContextPopup->insertItem(__tr2qs_ctx("New Label Inside","editor"),this,SLOT(contextNewLabelInside())),it && bIsMenu);
397
m_pContextPopup->insertSeparator();
399
m_pContextPopup->insertItem(__tr2qs_ctx("New Item Below","editor"),this,SLOT(contextNewItemBelow()));
400
m_pContextPopup->setItemEnabled(
401
m_pContextPopup->insertItem(__tr2qs_ctx("New Item Above","editor"),this,SLOT(contextNewItemAbove())),it);
402
m_pContextPopup->setItemEnabled(
403
m_pContextPopup->insertItem(__tr2qs_ctx("New Item Inside","editor"),this,SLOT(contextNewItemInside())),it && bIsMenu);
405
m_pContextPopup->insertSeparator();
407
m_pContextPopup->insertItem(__tr2qs_ctx("New Menu Below","editor"),this,SLOT(contextNewMenuBelow()));
408
m_pContextPopup->setItemEnabled(
409
m_pContextPopup->insertItem(__tr2qs_ctx("New Menu Above","editor"),this,SLOT(contextNewMenuAbove())),it);
410
m_pContextPopup->setItemEnabled(
411
m_pContextPopup->insertItem(__tr2qs_ctx("New Menu Inside","editor"),this,SLOT(contextNewMenuInside())),it && bIsMenu);
413
m_pContextPopup->insertSeparator();
415
m_pContextPopup->insertItem(__tr2qs_ctx("New External Menu Below","editor"),this,SLOT(contextNewExtMenuBelow()));
416
m_pContextPopup->setItemEnabled(
417
m_pContextPopup->insertItem(__tr2qs_ctx("New External Menu Above","editor"),this,SLOT(contextNewExtMenuAbove())),it);
418
m_pContextPopup->setItemEnabled(
419
m_pContextPopup->insertItem(__tr2qs_ctx("New External Menu Inside","editor"),this,SLOT(contextNewExtMenuInside())),it && bIsMenu);
421
m_pContextPopup->insertSeparator();
423
m_pContextPopup->setItemEnabled(
424
m_pContextPopup->insertItem(
383
m_pContextPopup->addAction(__tr2qs_ctx("New Separator Below","editor"),this,SLOT(contextNewSeparatorBelow()));
384
m_pContextPopup->addAction(__tr2qs_ctx("New Separator Above","editor"),this,SLOT(contextNewSeparatorAbove()))
386
m_pContextPopup->addAction(__tr2qs_ctx("New Separator Inside","editor"),this,SLOT(contextNewSeparatorInside()))
387
->setEnabled(it && bIsMenu);
389
m_pContextPopup->addSeparator();
391
m_pContextPopup->addAction(__tr2qs_ctx("New Label Below","editor"),this,SLOT(contextNewLabelBelow()));
392
m_pContextPopup->addAction(__tr2qs_ctx("New Label Above","editor"),this,SLOT(contextNewLabelAbove()))
394
m_pContextPopup->addAction(__tr2qs_ctx("New Label Inside","editor"),this,SLOT(contextNewLabelInside()))
395
->setEnabled(it && bIsMenu);
397
m_pContextPopup->addSeparator();
399
m_pContextPopup->addAction(__tr2qs_ctx("New Item Below","editor"),this,SLOT(contextNewItemBelow()));
400
m_pContextPopup->addAction(__tr2qs_ctx("New Item Above","editor"),this,SLOT(contextNewItemAbove()))
402
m_pContextPopup->addAction(__tr2qs_ctx("New Item Inside","editor"),this,SLOT(contextNewItemInside()))
403
->setEnabled(it && bIsMenu);
405
m_pContextPopup->addSeparator();
407
m_pContextPopup->addAction(__tr2qs_ctx("New Menu Below","editor"),this,SLOT(contextNewMenuBelow()));
408
m_pContextPopup->addAction(__tr2qs_ctx("New Menu Above","editor"),this,SLOT(contextNewMenuAbove()))
410
m_pContextPopup->addAction(__tr2qs_ctx("New Menu Inside","editor"),this,SLOT(contextNewMenuInside()))
411
->setEnabled(it && bIsMenu);
413
m_pContextPopup->addSeparator();
415
m_pContextPopup->addAction(__tr2qs_ctx("New External Menu Below","editor"),this,SLOT(contextNewExtMenuBelow()));
416
m_pContextPopup->addAction(__tr2qs_ctx("New External Menu Above","editor"),this,SLOT(contextNewExtMenuAbove()))
418
m_pContextPopup->addAction(__tr2qs_ctx("New External Menu Inside","editor"),this,SLOT(contextNewExtMenuInside()))
419
->setEnabled(it && bIsMenu);
421
m_pContextPopup->addSeparator();
423
m_pContextPopup->addAction(
425
424
*(g_pIconManager->getSmallIcon(KviIconManager::Cut)),
426
425
__tr2qs_ctx("Cu&t","editor"),
427
this,SLOT(contextCut())),it);
428
m_pContextPopup->setItemEnabled(
429
m_pContextPopup->insertItem(
426
this,SLOT(contextCut()))
428
m_pContextPopup->addAction(
430
429
*(g_pIconManager->getSmallIcon(KviIconManager::Copy)),
431
430
__tr2qs_ctx("&Copy","editor"),
432
this,SLOT(contextCopy())),it);
433
m_pContextPopup->setItemEnabled(
434
m_pContextPopup->insertItem(
435
*(g_pIconManager->getSmallIcon(KviIconManager::Paste)),
436
__tr2qs_ctx("&Paste Below","editor"),this,SLOT(contextPasteBelow())),
438
m_pContextPopup->setItemEnabled(
439
m_pContextPopup->insertItem(
440
*(g_pIconManager->getSmallIcon(KviIconManager::Paste)),
441
__tr2qs_ctx("Paste Above","editor"),this,SLOT(contextPasteAbove())),it && m_pClipboard);
442
m_pContextPopup->setItemEnabled(
443
m_pContextPopup->insertItem(
444
*(g_pIconManager->getSmallIcon(KviIconManager::Paste)),
445
__tr2qs_ctx("Paste Inside","editor"),this,SLOT(contextPasteInside())),it && bIsMenu && m_pClipboard);
431
this,SLOT(contextCopy()))
433
m_pContextPopup->addAction(
434
*(g_pIconManager->getSmallIcon(KviIconManager::Paste)),
435
__tr2qs_ctx("&Paste Below","editor"),this,SLOT(contextPasteBelow()))
436
->setEnabled(m_pClipboard);
437
m_pContextPopup->addAction(
438
*(g_pIconManager->getSmallIcon(KviIconManager::Paste)),
439
__tr2qs_ctx("Paste Above","editor"),this,SLOT(contextPasteAbove()))
440
->setEnabled(it && m_pClipboard);
441
m_pContextPopup->addAction(
442
*(g_pIconManager->getSmallIcon(KviIconManager::Paste)),
443
__tr2qs_ctx("Paste Inside","editor"),this,SLOT(contextPasteInside()))
444
->setEnabled(it && bIsMenu && m_pClipboard);
447
446
bool bSeparatorInserted = false;
449
448
// if(!findPrologue(parentMenu))
451
m_pContextPopup->insertSeparator();
450
m_pContextPopup->addSeparator();
452
451
bSeparatorInserted = true;
453
m_pContextPopup->insertItem(
452
m_pContextPopup->addAction(
454
453
*(g_pIconManager->getSmallIcon(KviIconManager::Prologue)),
455
454
__tr2qs_ctx("New Menu Prologue","editor"),this,SLOT(contextNewPrologue()));
458
457
// if(!findEpilogue(parentMenu))
460
if(!bSeparatorInserted)m_pContextPopup->insertSeparator();
461
m_pContextPopup->insertItem(
459
if(!bSeparatorInserted)m_pContextPopup->addSeparator();
460
m_pContextPopup->addAction(
462
461
*(g_pIconManager->getSmallIcon(KviIconManager::Epilogue)),
463
462
__tr2qs_ctx("New Menu Epilogue","editor"),this,SLOT(contextNewEpilogue()));