r16559 by craig - Remove non-Action based code from context menu

scribus-commit scribus-commit at lists.scribus.net
Fri Apr 8 21:21:54 CEST 2011


Author: craig
Date: Fri Apr  8 19:21:54 2011
New Revision: 16559

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16559
Log:
Remove non-Action based code from context menu

Modified:
    trunk/Scribus/scribus/actionmanager.cpp
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/ui/contextmenu.cpp

Modified: trunk/Scribus/scribus/actionmanager.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16559&path=/trunk/Scribus/scribus/actionmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/actionmanager.cpp (original)
+++ trunk/Scribus/scribus/actionmanager.cpp Fri Apr  8 19:21:54 2011
@@ -212,6 +212,8 @@
 	scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/edit-paste.png"), QPixmap(), "", defaultKey(name), mainWindow, 0));
 	name="editPasteContentsAbs";
 	scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/edit-paste.png"), QPixmap(), "", defaultKey(name), mainWindow, 1));
+	name="editPasteImageFromClipboard";
+	scrActions->insert(name, new ScrAction(loadIcon("16/edit-paste.png"), loadIcon("22/edit-paste.png"), "", defaultKey(name), mainWindow));
 	name="editClearContents";
 	scrActions->insert(name, new ScrAction(loadIcon("16/edit-delete.png"), loadIcon("22/edit-delete.png"), "", defaultKey(name), mainWindow));
 	name="editSelectAll";
@@ -252,6 +254,7 @@
 	connect( (*scrActions)["editCopyContents"], SIGNAL(triggered()), mainWindow, SLOT(slotEditCopyContents()) );
 	connect( (*scrActions)["editPasteContents"], SIGNAL(triggeredData(int)), mainWindow, SLOT(slotEditPasteContents(int)) );
 	connect( (*scrActions)["editPasteContentsAbs"], SIGNAL(triggeredData(int)), mainWindow, SLOT(slotEditPasteContents(int)) );
+	connect( (*scrActions)["editPasteImageFromClipboard"], SIGNAL(triggered()), mainWindow, SLOT(slotGetClipboardImage()) );
 	connect( (*scrActions)["editSelectAll"], SIGNAL(triggered()), mainWindow, SLOT(SelectAll()) );
 	connect( (*scrActions)["editSelectAllOnLayer"], SIGNAL(triggered()), mainWindow, SLOT(SelectAllOnLayer()) );
 	connect( (*scrActions)["editDeselectAll"], SIGNAL(triggered()), mainWindow, SLOT(deselectAll()) );
@@ -1312,6 +1315,7 @@
 	(*scrActions)["editCopyContents"]->setTexts( tr("&Copy"));
 	(*scrActions)["editPasteContents"]->setTexts( tr("&Paste"));
 	(*scrActions)["editPasteContentsAbs"]->setTexts( tr("Paste (&Absolute)"));
+	(*scrActions)["editPasteImageFromClipboard"]->setTexts( tr("Paste Image from Clipboard"));
 	(*scrActions)["editClearContents"]->setTexts( tr("C&lear"));
 	(*scrActions)["editSelectAll"]->setTexts( tr("Select &All"));
 	(*scrActions)["editSelectAllOnLayer"]->setTexts( tr("Advanced Select All..."));
@@ -1777,6 +1781,7 @@
 		<< "editCopyContents"
 		<< "editPasteContents"
 		<< "editPasteContentsAbs"
+		<< "editPasteImageFromClipboard"
 		<< "editClearContents"
 		<< "editSelectAll"
 		<< "editSelectAllOnLayer"

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16559&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Fri Apr  8 19:21:54 2011
@@ -4162,7 +4162,7 @@
 
 void ScribusMainWindow::slotGetClipboardImage()
 {
-	if ((doc->m_Selection->count() != 0) && (QApplication::clipboard()->mimeData()->hasImage()))
+	if (HaveDoc && (doc->m_Selection->count() != 0) && (QApplication::clipboard()->mimeData()->hasImage()))
 	{
 		PageItem *currItem = doc->m_Selection->itemAt(0);
 		if (currItem->itemType() == PageItem::ImageFrame)

Modified: trunk/Scribus/scribus/ui/contextmenu.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16559&path=/trunk/Scribus/scribus/ui/contextmenu.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/contextmenu.cpp (original)
+++ trunk/Scribus/scribus/ui/contextmenu.cpp Fri Apr  8 19:21:54 2011
@@ -185,9 +185,7 @@
 		if (selectedItemCount==1 && currItem->asImageFrame())
 		{
 			if (QApplication::clipboard()->mimeData()->hasImage())
-			{
-				addAction( tr("Paste Image from Clipboard"), m_AP, SLOT(slotGetClipboardImage()));
-			}
+				addAction(m_AP->scrActions["editPasteImageFromClipboard"]);
 		}
 		if (m_actionList.contains("itemAdjustFrameToImage"))
 			addAction(m_AP->scrActions["itemAdjustFrameToImage"]);




More information about the scribus-commit mailing list