r22722 by jghali - Revert erroneous file change
scribus-commit
scribus-commit at lists.scribus.net
Fri Oct 5 20:37:41 UTC 2018
Author: jghali
Date: Fri Oct 5 20:37:41 2018
New Revision: 22722
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22722
Log:
Revert erroneous file change
Modified:
trunk/Scribus/scribus/ui/contextmenu.cpp
Modified: trunk/Scribus/scribus/ui/contextmenu.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22722&path=/trunk/Scribus/scribus/ui/contextmenu.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/contextmenu.cpp (original)
+++ trunk/Scribus/scribus/ui/contextmenu.cpp Fri Oct 5 20:37:41 2018
@@ -97,6 +97,8 @@
QMenu *menuLocking = new QMenu(this);
QMenu *menuSendTo = new QMenu(this);
QMenu *menuScrapbook = new QMenu(this);
+ QMenu *menuEdit = new QMenu(this);
+ QMenu *menuImage = new QMenu(this);
// QMenu *menuWeld = new QMenu(this);
//<-- Add Info
@@ -144,19 +146,57 @@
// currItem->createContextMenu(menuInfo, 5);
QAction *act = addMenu(menuInfo);
act->setText( tr("In&fo"));
- } else {
+ }
+ else
+ {
delete infoGroupLayout;
delete infoGroup;
}
}
//-->
- //<-- Add undo
- UndoManager * const undoManager(UndoManager::instance());
- if (undoManager->hasUndoActions())
- addAction(m_ScMW->scrActions["editUndoAction"]);
- if (undoManager->hasRedoActions())
- addAction(m_ScMW->scrActions["editRedoAction"]);
+ //<-- Add Contents Actions
+ //This part only for text frames
+ if (m_actionList.contains("fileImportText"))
+ {
+ addSeparator();
+ menuEditContent->addAction(m_ScMW->scrActions["fileImportText"]);
+ menuEditContent->addAction(m_ScMW->scrActions["fileImportAppendText"]);
+ menuEditContent->addAction(m_ScMW->scrActions["toolsEditWithStoryEditor"]);
+ menuEditContent->addAction(m_ScMW->scrActions["insertSampleText"]);
+ menuEditContent->addSeparator();
+ }
+ else //enable this for, eg, text on a path
+ if (m_actionList.contains("toolsEditWithStoryEditor"))
+ {
+ addSeparator();
+ menuEditContent->addAction(m_ScMW->scrActions["toolsEditWithStoryEditor"]);
+ }
+ if (m_actionList.contains("fileImportImage"))
+ menuEditContent->addAction(m_ScMW->scrActions["fileImportImage"]);
+ if (selectedItemCount==1 && currItem->asImageFrame())
+ {
+ if (QApplication::clipboard()->mimeData()->hasImage())
+ menuEditContent->addAction(m_ScMW->scrActions["editPasteImageFromClipboard"]);
+ }
+ if (itemsAreSameType)
+ {
+ if (m_actionList.contains("editCopyContents"))
+ menuEditContent->addAction(m_ScMW->scrActions["editCopyContents"]);
+ if (m_actionList.contains("editPasteContents"))
+ menuEditContent->addAction(m_ScMW->scrActions["editPasteContents"]);
+ if (currItem->asImageFrame() && m_actionList.contains("editPasteContentsAbs"))
+ menuEditContent->addAction(m_ScMW->scrActions["editPasteContentsAbs"]);
+ }
+ if (m_actionList.contains("editClearContents"))
+ menuEditContent->addAction(m_ScMW->scrActions["editClearContents"]);
+ if (m_actionList.contains("editTruncateContents"))
+ menuEditContent->addAction(m_ScMW->scrActions["editTruncateContents"]);
+ if (menuEditContent->actions().count()>0)
+ {
+ QAction *act = addMenu(menuEditContent);
+ act->setText( tr("Content"));
+ }
//-->
//<-- Item specific actions
@@ -206,32 +246,14 @@
addSeparator();
addAction(m_ScMW->scrActions["itemUpdateMarks"]);
}
- if (m_actionList.contains("fileImportText"))
- {
- addSeparator();
- addAction(m_ScMW->scrActions["fileImportText"]);
- addAction(m_ScMW->scrActions["fileImportAppendText"]);
- addAction(m_ScMW->scrActions["toolsEditWithStoryEditor"]);
- addAction(m_ScMW->scrActions["insertSampleText"]);
- }
- else //enable this for, eg, text on a path
- if (m_actionList.contains("toolsEditWithStoryEditor"))
- {
- addSeparator();
- addAction(m_ScMW->scrActions["toolsEditWithStoryEditor"]);
- }
+
+
+
+
+
addSeparator();
- if (m_actionList.contains("fileImportImage"))
- addAction(m_ScMW->scrActions["fileImportImage"]);
- if (selectedItemCount==1 && currItem->asImageFrame())
- {
- if (QApplication::clipboard()->mimeData()->hasImage())
- addAction(m_ScMW->scrActions["editPasteImageFromClipboard"]);
- }
- if (m_actionList.contains("itemAdjustFrameToImage"))
- addAction(m_ScMW->scrActions["itemAdjustFrameToImage"]);
- if (m_actionList.contains("itemAdjustImageToFrame"))
- addAction(m_ScMW->scrActions["itemAdjustImageToFrame"]);
+
+
if (m_actionList.contains("tableInsertRows"))
addAction(m_ScMW->scrActions["tableInsertRows"]);
@@ -259,17 +281,7 @@
addAction(m_ScMW->scrActions["tableAdjustTableToFrame"]);
if (m_actionList.contains("itemAdjustFrameHeightToText"))
addAction(m_ScMW->scrActions["itemAdjustFrameHeightToText"]);
- if (m_actionList.contains("itemExtendedImageProperties"))
- addAction(m_ScMW->scrActions["itemExtendedImageProperties"]);
- if (m_actionList.contains("itemAdjustFrameToImage"))
- {
- if (currItem->imageIsAvailable)
- addAction(m_ScMW->scrActions["itemToggleInlineImage"]);
- }
- if (m_actionList.contains("itemImageInfo"))
- addAction(m_ScMW->scrActions["itemImageInfo"]);
- if (m_actionList.contains("itemUpdateImage"))
- addAction(m_ScMW->scrActions["itemUpdateImage"]);
+
if (m_actionList.contains("itemPreviewLow"))
{
@@ -290,13 +302,28 @@
}
if (m_actionList.contains("styleImageEffects"))
- addAction(m_ScMW->scrActions["styleImageEffects"]);
+ menuImage->addAction(m_ScMW->scrActions["styleImageEffects"]);
if (m_actionList.contains("editEditWithImageEditor"))
- addAction(m_ScMW->scrActions["editEditWithImageEditor"]);
+ menuImage->addAction(m_ScMW->scrActions["editEditWithImageEditor"]);
if (selectedItemCount==1 && currItem->asImageFrame())
{
if (currItem->imageIsAvailable)
{
+ if (m_actionList.contains("itemExtendedImageProperties"))
+ menuImage->addAction(m_ScMW->scrActions["itemExtendedImageProperties"]);
+ if (m_actionList.contains("itemAdjustFrameToImage"))
+ {
+ if (currItem->imageIsAvailable)
+ menuImage->addAction(m_ScMW->scrActions["itemToggleInlineImage"]);
+ }
+ if (m_actionList.contains("itemImageInfo"))
+ menuImage->addAction(m_ScMW->scrActions["itemImageInfo"]);
+ if (m_actionList.contains("itemUpdateImage"))
+ menuImage->addAction(m_ScMW->scrActions["itemUpdateImage"]);
+ if (m_actionList.contains("itemAdjustFrameToImage"))
+ menuImage->addAction(m_ScMW->scrActions["itemAdjustFrameToImage"]);
+ if (m_actionList.contains("itemAdjustImageToFrame"))
+ menuImage->addAction(m_ScMW->scrActions["itemAdjustImageToFrame"]);
m_ScMW->scrActions["itemAdjustFrameToImage"]->setEnabled(true);
m_ScMW->scrActions["itemAdjustImageToFrame"]->setEnabled(true);
if (currItem->pixm.imgInfo.valid)
@@ -309,6 +336,13 @@
m_ScMW->scrActions["styleImageEffects"]->setEnabled(true);
m_ScMW->scrActions["editEditWithImageEditor"]->setEnabled(true);
}
+
+
+ if (menuImage->actions().count()>0)
+ {
+ QAction *act = addMenu(menuImage);
+ act->setText( tr("Image"));
+ }
}
}
@@ -320,44 +354,22 @@
}
//-->
- //<-- Item Attributes
- if (selectedItemCount == 1)
- {
- addSeparator();
- addAction(m_ScMW->scrActions["itemAttributes"]);
- }
- //-->
-
- //<-- Item PDF Options
- if (currItem->itemType() == PageItem::TextFrame)
- {
- QAction *act = addMenu(menuPDF);
- act->setText( tr("&PDF Options"));
- menuPDF->addAction(m_ScMW->scrActions["itemPDFIsAnnotation"]);
- if (!m_doc->masterPageMode())
- menuPDF->addAction(m_ScMW->scrActions["itemPDFIsBookmark"]);
- if (selectedItemCount == 1)
- {
- menuPDF->addSeparator();
- if (m_actionList.contains("itemPDFAnnotationProps"))
- menuPDF->addAction(m_ScMW->scrActions["itemPDFAnnotationProps"]);
- if (m_actionList.contains("itemPDFFieldProps"))
- menuPDF->addAction(m_ScMW->scrActions["itemPDFFieldProps"]);
- }
- }
- //-->
-
- //<-- Item Locking
+
+
+
addSeparator();
- //-->
+
if (selectedItemCount>0)
{
+ //<-- Item Locking
menuLocking->addAction(m_ScMW->scrActions["itemLock"]);
menuLocking->addAction(m_ScMW->scrActions["itemLockSize"]);
QAction *actL = addMenu(menuLocking);
actL->setText( tr("Locking"));
-
+ //-->
+
+ //<-- Send To
QAction *actST = addMenu(menuSendTo);
actST->setText( tr("Send to"));
QAction *actScr = menuSendTo->addMenu(menuScrapbook);
@@ -396,6 +408,8 @@
}
//-->
}
+
+
//<-- Add Groups Items
if (selectedItemCount > 1)
{
@@ -412,7 +426,7 @@
}
//-->
- //<-- Add Level Item
+ //<-- Add Level Items
if (!currItem->locked())
{
menuLevel->addAction(m_ScMW->scrActions["itemRaise"]);
@@ -449,17 +463,43 @@
}
}
//-->
-
+ //<-- Item Attributes
+ if (selectedItemCount == 1)
+ {
+ addSeparator();
+ addAction(m_ScMW->scrActions["itemAttributes"]);
+ }
+ //-->
+
+ //<-- Item PDF Options
+ if (currItem->itemType() == PageItem::TextFrame)
+ {
+ QAction *act = addMenu(menuPDF);
+ act->setText( tr("&PDF Options"));
+ menuPDF->addAction(m_ScMW->scrActions["itemPDFIsAnnotation"]);
+ if (!m_doc->masterPageMode())
+ menuPDF->addAction(m_ScMW->scrActions["itemPDFIsBookmark"]);
+ if (selectedItemCount == 1)
+ {
+ menuPDF->addSeparator();
+ if (m_actionList.contains("itemPDFAnnotationProps"))
+ menuPDF->addAction(m_ScMW->scrActions["itemPDFAnnotationProps"]);
+ if (m_actionList.contains("itemPDFFieldProps"))
+ menuPDF->addAction(m_ScMW->scrActions["itemPDFFieldProps"]);
+ }
+ }
+ //-->
+ //<<-- Edit Menu
+ addSeparator();
//<-- Add Copy/Paste Actions
- addSeparator();
if (!currItem->locked() && !(currItem->isSingleSel))
- addAction(m_ScMW->scrActions["editCut"]);
+ menuEdit->addAction(m_ScMW->scrActions["editCut"]);
if (!(currItem->isSingleSel))
- addAction(m_ScMW->scrActions["editCopy"]);
+ menuEdit->addAction(m_ScMW->scrActions["editCopy"]);
if (((m_doc->appMode == modeEdit && currItem->itemType() == PageItem::TextFrame) || (m_doc->appMode == modeEditTable && currItem->itemType() == PageItem::Table)) && (ScMimeData::clipboardHasScribusText()||ScMimeData::clipboardHasPlainText()) )
- addAction(m_ScMW->scrActions["editPaste"]);
+ menuEdit->addAction(m_ScMW->scrActions["editPaste"]);
if (!currItem->locked() && (m_doc->appMode != modeEdit) && (m_doc->appMode != modeEditTable) && (!(currItem->isSingleSel)))
- addAction(m_ScMW->scrActions["itemDelete"]);
+ menuEdit->addAction(m_ScMW->scrActions["itemDelete"]);
//<<#14678
if ((ScMimeData::clipboardHasScribusElem() || ScMimeData::clipboardHasScribusFragment()) &&
@@ -468,33 +508,22 @@
FPoint fp = m_doc->view()->m_canvas->globalToCanvas(QCursor::pos());
m_doc->view()->dragX = fp.x();
m_doc->view()->dragY = fp.y();
- addAction( tr("&Paste Here") , m_doc->view(), SLOT(PasteToPage()));
+ menuEdit->addAction( tr("&Paste Here") , m_doc->view(), SLOT(PasteToPage()));
}
//>>#14678
//-->
-
- //<-- Add Contents Actions
- if (itemsAreSameType)
- {
- if (m_actionList.contains("editCopyContents"))
- menuEditContent->addAction(m_ScMW->scrActions["editCopyContents"]);
- if (m_actionList.contains("editPasteContents"))
- menuEditContent->addAction(m_ScMW->scrActions["editPasteContents"]);
- if (currItem->asImageFrame() && m_actionList.contains("editPasteContentsAbs"))
- menuEditContent->addAction(m_ScMW->scrActions["editPasteContentsAbs"]);
- }
- if (m_actionList.contains("editClearContents"))
- menuEditContent->addAction(m_ScMW->scrActions["editClearContents"]);
- if (m_actionList.contains("editTruncateContents"))
- menuEditContent->addAction(m_ScMW->scrActions["editTruncateContents"]);
- if (menuEditContent->actions().count()>0)
- {
- QAction *act = addMenu(menuEditContent);
- act->setText( tr("Content"));
- }
+ //<-- Add undo
+ UndoManager * const undoManager(UndoManager::instance());
+ if (undoManager->hasUndoActions())
+ menuEdit->addAction(m_ScMW->scrActions["editUndoAction"]);
+ if (undoManager->hasRedoActions())
+ menuEdit->addAction(m_ScMW->scrActions["editRedoAction"]);
+ QAction *actEdit = addMenu(menuEdit);
+ actEdit->setText( tr("Edit"));
+ //-->
//-->
//<-- Add Welding Menu
@@ -538,6 +567,7 @@
if (containsTextFrame)
addAction(m_ScMW->scrActions["toolsText"]);
//-->
+
}
void ContextMenu::createMenuItems_NoSelection(double mx, double my)
More information about the scribus-commit
mailing list