r23939 by jghali - #16178, 16179: fix ability to modify locked layer after saving doc or reopening doc
scribus-commit
scribus-commit at lists.scribus.net
Mon Jul 20 09:17:52 UTC 2020
Author: jghali
Date: Mon Jul 20 09:17:52 2020
New Revision: 23939
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23939
Log:
#16178, 16179: fix ability to modify locked layer after saving doc or reopening doc
Modified:
trunk/Scribus/scribus/ui/contextmenu.cpp
Modified: trunk/Scribus/scribus/ui/contextmenu.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23939&path=/trunk/Scribus/scribus/ui/contextmenu.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/contextmenu.cpp (original)
+++ trunk/Scribus/scribus/ui/contextmenu.cpp Mon Jul 20 09:17:52 2020
@@ -555,17 +555,18 @@
void ContextMenu::createMenuItems_NoSelection(double mx, double my)
{
- int selectedItemCount=m_Sel.count();
- if (selectedItemCount!=0)
+ int selectedItemCount = m_Sel.count();
+ if (selectedItemCount != 0)
return;
-
- if (ScMimeData::clipboardHasScribusElem() || ScMimeData::clipboardHasScribusFragment() )
+ bool layerLocked = m_doc->layerLocked(m_doc->activeLayer());
+
+ if (!layerLocked && (ScMimeData::clipboardHasScribusElem() || ScMimeData::clipboardHasScribusFragment()))
{
m_doc->view()->dragX = mx;
m_doc->view()->dragY = my;
addAction( tr("&Paste Here") , m_doc->view(), SLOT(PasteToPage()));
}
- if (m_ScMW->scrRecentPasteActions.count()>0)
+ if (!layerLocked && m_ScMW->scrRecentPasteActions.count() > 0)
{
m_doc->view()->dragX = mx;
m_doc->view()->dragY = my;
@@ -578,9 +579,12 @@
menuPasteRecent->addAction(recentPasteAction);
addSeparator();
}
- QAction *act = addAction( tr("Paste File..."));
- connect(act, SIGNAL(triggered()), dynamic_cast<QObject*>(m_doc->view()->m_canvasMode), SLOT(importToPage()));
- addSeparator();
+ if (!layerLocked)
+ {
+ QAction *act = addAction( tr("Paste File..."));
+ connect(act, SIGNAL(triggered()), dynamic_cast<QObject*>(m_doc->view()->m_canvasMode), SLOT(importToPage()));
+ addSeparator();
+ }
addAction(m_ScMW->scrActions["editUndoAction"]);
addAction(m_ScMW->scrActions["editRedoAction"]);
@@ -611,7 +615,7 @@
if (m_ScMW->scrActions["pageDelete"]->isEnabled())
{
addSeparator();
- pageDeletePrimaryString=m_ScMW->scrActions["pageDelete"]->text();
+ pageDeletePrimaryString = m_ScMW->scrActions["pageDelete"]->text();
m_ScMW->scrActions["pageDelete"]->setText(tr("Delete Page"));
addAction(m_ScMW->scrActions["pageDelete"]);
}
More information about the scribus-commit
mailing list