r16733 by fschmid - Move items in patterns to layer 0. Disable Layer Palette and Layer Menue when editing Patterns.

scribus-commit scribus-commit at lists.scribus.net
Sat Jul 30 21:14:22 UTC 2011


Author: fschmid
Date: Sat Jul 30 21:14:21 2011
New Revision: 16733

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16733
Log:
Move items in patterns to layer 0. Disable Layer Palette and Layer Menue when editing Patterns.

Modified:
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scribusdoc.h
    trunk/Scribus/scribus/scribusview.cpp

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16733&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Sat Jul 30 21:14:21 2011
@@ -8511,6 +8511,7 @@
 		scrActions["toolsPDFAnnot3D"]->setEnabled(false);
 #endif
 		pagePalette->enablePalette(false);
+		layerPalette->setEnabled(false);
 		patternsDependingOnThis.clear();
 		QStringList mainPatterns = doc->docPatterns.keys();
 		for (int a = 0; a < mainPatterns.count(); a++)
@@ -8579,6 +8580,7 @@
 	pagePalette->Rebuild();
 	propertiesPalette->updateColorList();
 	symbolPalette->editingFinished();
+	layerPalette->setEnabled(true);
 	updateActiveWindowCaption(doc->DocName);
 }
 

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16733&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Sat Jul 30 21:14:21 2011
@@ -2961,6 +2961,12 @@
 		name += "("+tmp.setNum(docPatterns.count())+")";
 //		name = tr("Copy_of_")+name;
 	docPatterns.insert(name, pattern);
+	QList<PageItem*> allItems = getAllItems(pattern.items);
+	for (int ii = 0; ii < allItems.count(); ii++)
+	{
+		PageItem* currItem = allItems.at(ii);
+		currItem->setLayer(0);
+	}
 	return true;
 }
 
@@ -5364,6 +5370,12 @@
 	m_symbolEditMode = mode;
 	if (mode)
 	{
+		m_storedLayerID = activeLayer();
+		m_storedLayerLock = layerLocked(0);
+		m_storedLayerVis = layerVisible(0);
+		setActiveLayer(0);
+		setLayerVisible(0, true);
+		setLayerLocked(0, false);
 		ScPattern pa = docPatterns[symbolName];
 		currentEditedSymbol = symbolName;
 		ScPage* addedPage = new ScPage(docPrefsData.displayPrefs.scratch.Left, docPrefsData.displayPrefs.scratch.Top, pa.width, pa.height);
@@ -5393,6 +5405,7 @@
 		moveGroup(-sR.x() + addedPage->xOffset(), -sR.y() + addedPage->yOffset());
 		m_Selection->clear();
 		m_Selection->delaySignalsOff();
+		m_ScMW->changeLayer(0);
 		changed();
 	}
 	else
@@ -5469,6 +5482,10 @@
 			Items = &DocItems;
 		}
 		delete addedPage;
+		setActiveLayer(m_storedLayerID);
+		setLayerVisible(0, m_storedLayerVis);
+		setLayerLocked(0, m_storedLayerLock);
+		m_ScMW->changeLayer(m_storedLayerID);
 	}
 }
 

Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16733&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h (original)
+++ trunk/Scribus/scribus/scribusdoc.h Sat Jul 30 21:14:21 2011
@@ -1050,6 +1050,9 @@
 	bool automaticTextFrames; // Flag for automatic Textframes
 	bool m_masterPageMode;
 	bool m_symbolEditMode;
+	int  m_storedLayerID;
+	bool m_storedLayerLock;
+	bool m_storedLayerVis;
 	QMap<QString, double> m_constants;
 	ScribusMainWindow* m_ScMW;
 	ScribusView* m_View;

Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16733&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Sat Jul 30 21:14:21 2011
@@ -2724,6 +2724,7 @@
 	Doc->setSymbolEditMode(true, symbolName);
 	Doc->setCurrentPage(Doc->Pages->at(0));
 	pageSelector->setEnabled(false);
+	layerMenu->setEnabled(false);
 	updateOn = false;
 	zoom();
 	oldX = qRound(Doc->currentPage()->xOffset()- 10);
@@ -2743,6 +2744,7 @@
 	updatesOn(true);
 	Doc->setCurrentPage(Doc->Pages->at(0));
 	pageSelector->setEnabled(true);
+	layerMenu->setEnabled(true);
 	resizeContents(qRound((Doc->maxCanvasCoordinate.x() - Doc->minCanvasCoordinate.x()) * m_canvas->scale()), qRound((Doc->maxCanvasCoordinate.y() - Doc->minCanvasCoordinate.y()) * m_canvas->scale()));
 }
 




More information about the scribus-commit mailing list