r16491 by craig - Add undo for layer flow settings change

scribus-commit scribus-commit at lists.scribus.net
Thu Mar 24 16:31:42 CET 2011


Author: craig
Date: Thu Mar 24 15:31:41 2011
New Revision: 16491

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16491
Log:
Add undo for layer flow settings change

Modified:
    branches/Version135/Scribus/scribus/scribusdoc.cpp
    branches/Version135/Scribus/scribus/undomanager.cpp
    branches/Version135/Scribus/scribus/undomanager.h

Modified: branches/Version135/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16491&path=/branches/Version135/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/scribusdoc.cpp (original)
+++ branches/Version135/Scribus/scribus/scribusdoc.cpp Thu Mar 24 15:31:41 2011
@@ -1294,6 +1294,12 @@
 			setLayerPrintable(ss->getInt("ACTIVE"), isUndo ? !print : print);
 			layersUndo=true;
 		}
+		else if (ss->contains("FLOW_LAYER"))
+		{
+			bool flow = ss->getBool("FLOW");
+			setLayerFlow(ss->getInt("ACTIVE"), isUndo ? !flow : flow);
+			layersUndo=true;
+		}
 		else if (ss->contains("ADD_LAYER"))
 		{
 			if (isUndo)
@@ -2078,7 +2084,7 @@
 				ss->set("PRINT_LAYER", "print_layer");
 				ss->set("ACTIVE", (*it).LNr);
 				ss->set("PRINT", isPrintable);
-				undoManager->action(this, ss, DocName, Um::IDocument);
+				undoManager->action(this, ss, it->Name, Um::ILayer);
 			}
 			found=true;
 			break;
@@ -2178,7 +2184,18 @@
 	{
 		if (it->LNr == layerNumber)
 		{
+			bool oldFlow = it->flowControl;
 			it->flowControl = flow;
+			
+			if (oldFlow!=flow && UndoManager::undoEnabled())
+			{
+				SimpleState *ss = new SimpleState(flow ? Um::FlowLayer : Um::DisableFlowLayer, "", Um::ITextFrame);
+				ss->set("FLOW_LAYER", "flow_layer");
+				ss->set("ACTIVE", (*it).LNr);
+				ss->set("FLOW", flow);
+				undoManager->action(this, ss, it->Name, Um::ILayer);
+			}
+			
 			found=true;
 			break;
 		}

Modified: branches/Version135/Scribus/scribus/undomanager.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16491&path=/branches/Version135/Scribus/scribus/undomanager.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/undomanager.cpp (original)
+++ branches/Version135/Scribus/scribus/undomanager.cpp Thu Mar 24 15:31:41 2011
@@ -945,6 +945,8 @@
 	UndoManager::PrintLayer         = tr("Enable printing of layer");
 	UndoManager::DoNotPrintLayer    = tr("Disable printing of layer");
 	UndoManager::SetLayerName       = tr("Change name of the layer");
+	UndoManager::FlowLayer			= tr("Enable text flow around for lower layers");
+	UndoManager::DisableFlowLayer	= tr("Disable text flow around for lower layers");
 	UndoManager::GetImage           = tr("Get image");
 	UndoManager::ChangeFormula      = tr("Change formula");
 	UndoManager::MultipleDuplicate  = tr("Multiple duplicate");
@@ -1150,6 +1152,8 @@
 QString UndoManager::PrintLayer         = "";
 QString UndoManager::DoNotPrintLayer    = "";
 QString UndoManager::SetLayerName       = "";
+QString UndoManager::FlowLayer			= "";
+QString UndoManager::DisableFlowLayer	= "";
 QString UndoManager::GetImage           = "";
 QString UndoManager::ChangeFormula      = "";
 QString UndoManager::MultipleDuplicate  = "";

Modified: branches/Version135/Scribus/scribus/undomanager.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16491&path=/branches/Version135/Scribus/scribus/undomanager.h
==============================================================================
--- branches/Version135/Scribus/scribus/undomanager.h (original)
+++ branches/Version135/Scribus/scribus/undomanager.h Thu Mar 24 15:31:41 2011
@@ -571,6 +571,8 @@
 	static QString PrintLayer;
 	static QString DoNotPrintLayer;
 	static QString SetLayerName;
+	static QString FlowLayer;
+	static QString DisableFlowLayer;
 	static QString GetImage;
 	static QString ChangeFormula;
 	static QString MultipleDuplicate;




More information about the scribus-commit mailing list