r16558 by craig - Remove non-Action based code from context menu
scribus-commit
scribus-commit at lists.scribus.net
Fri Apr 8 21:21:39 CEST 2011
Author: craig
Date: Fri Apr 8 19:21:38 2011
New Revision: 16558
URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16558
Log:
Remove non-Action based code from context menu
Modified:
branches/Version135/Scribus/scribus/actionmanager.cpp
branches/Version135/Scribus/scribus/contextmenu.cpp
branches/Version135/Scribus/scribus/scribus.cpp
Modified: branches/Version135/Scribus/scribus/actionmanager.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16558&path=/branches/Version135/Scribus/scribus/actionmanager.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/actionmanager.cpp (original)
+++ branches/Version135/Scribus/scribus/actionmanager.cpp Fri Apr 8 19:21:38 2011
@@ -205,6 +205,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";
@@ -243,6 +245,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()) );
@@ -1287,6 +1290,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..."));
Modified: branches/Version135/Scribus/scribus/contextmenu.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16558&path=/branches/Version135/Scribus/scribus/contextmenu.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/contextmenu.cpp (original)
+++ branches/Version135/Scribus/scribus/contextmenu.cpp Fri Apr 8 19:21:38 2011
@@ -180,9 +180,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"]);
Modified: branches/Version135/Scribus/scribus/scribus.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16558&path=/branches/Version135/Scribus/scribus/scribus.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/scribus.cpp (original)
+++ branches/Version135/Scribus/scribus/scribus.cpp Fri Apr 8 19:21:38 2011
@@ -4355,7 +4355,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)
More information about the scribus-commit
mailing list