r16430 by craig - #9816: Create undo transction around clearing of multiple frames

scribus-commit scribus-commit at lists.scribus.net
Tue Mar 8 12:09:08 CET 2011


Author: craig
Date: Tue Mar  8 11:09:08 2011
New Revision: 16430

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16430
Log:
#9816: Create undo transction around clearing of multiple frames

Modified:
    branches/Version135/Scribus/scribus/about.cpp
    branches/Version135/Scribus/scribus/plugins/scriptplugin/scriptercore.cpp
    branches/Version135/Scribus/scribus/scribusdoc.cpp
    branches/Version135/Scribus/scribus/undomanager.cpp
    branches/Version135/Scribus/scribus/undomanager.h

Modified: branches/Version135/Scribus/scribus/about.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16430&path=/branches/Version135/Scribus/scribus/about.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/about.cpp (original)
+++ branches/Version135/Scribus/scribus/about.cpp Tue Mar  8 11:09:08 2011
@@ -114,7 +114,7 @@
 	buildID = new QLabel( tab );
 	buildID->setAlignment(Qt::AlignCenter);
 	buildID->setTextInteractionFlags(Qt::TextSelectableByMouse);
-	QString BUILD_DAY = "07";
+	QString BUILD_DAY = "08";
 	QString BUILD_MONTH = CommonStrings::march;
 	QString BUILD_YEAR = "2011";
 	QString BUILD_TIME = "";

Modified: branches/Version135/Scribus/scribus/plugins/scriptplugin/scriptercore.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16430&path=/branches/Version135/Scribus/scribus/plugins/scriptplugin/scriptercore.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/plugins/scriptplugin/scriptercore.cpp (original)
+++ branches/Version135/Scribus/scribus/plugins/scriptplugin/scriptercore.cpp Tue Mar  8 11:09:08 2011
@@ -306,7 +306,7 @@
 		 * for output settings. I use ugly hack to stop freezing calling help()
 		 * in script. pv. */
 		cm        += QString("import os\nos.environ['PAGER'] = '/bin/false'\n"); // HACK
-		cm        += QString("sys.path[0] = \"%1\"\n").arg(escapedAbsPath);
+		cm        += QString("sys.path.insert(0, \"%1\")\n").arg(escapedAbsPath);
 		// Replace sys.stdin with a dummy StringIO that always returns
 		// "" for read
 		cm        += QString("sys.stdin = cStringIO.StringIO()\n");

Modified: branches/Version135/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16430&path=/branches/Version135/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/scribusdoc.cpp (original)
+++ branches/Version135/Scribus/scribus/scribusdoc.cpp Tue Mar  8 11:09:08 2011
@@ -7297,6 +7297,9 @@
 		PageItem *currItem;
 		bool userDecide = false;
 		bool userWantClear = true;
+		UndoTransaction* activeTransaction = NULL;
+		if (selectedItemCount > 1)
+			activeTransaction = new UndoTransaction(undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::ClearContent, tr( "Remove content from frames" ), Um::IDelete));
 		for (uint i = 0; i < selectedItemCount; ++i)
 		{
 			currItem = itemSelection->itemAt(i);
@@ -7323,6 +7326,12 @@
 				if (userWantClear)
 					currItem->clearContents();
 			}
+		}
+		if (activeTransaction)
+		{
+			activeTransaction->commit();
+			delete activeTransaction;
+			activeTransaction = NULL;
 		}
 		updateFrameItems();
 		regionsChanged()->update(QRectF());

Modified: branches/Version135/Scribus/scribus/undomanager.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16430&path=/branches/Version135/Scribus/scribus/undomanager.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/undomanager.cpp (original)
+++ branches/Version135/Scribus/scribus/undomanager.cpp Tue Mar  8 11:09:08 2011
@@ -966,6 +966,7 @@
 	UndoManager::ToOutlines         = tr("Convert to outlines");
 	UndoManager::EditText		= tr("Edit text");
 	UndoManager::ClearImage		= tr("Clear image frame content");
+	UndoManager::ClearContent	= tr("Clear frame content");
 }
 
 void UndoManager::initIcons()
@@ -1168,6 +1169,7 @@
 QString UndoManager::ToOutlines         = "";
 QString UndoManager::EditText		= "";
 QString UndoManager::ClearImage		= "";
+QString UndoManager::ClearContent	= "";
 
 /*** Icons for UndoObjects *******************************************/
 QPixmap *UndoManager::IImageFrame      = 0;

Modified: branches/Version135/Scribus/scribus/undomanager.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16430&path=/branches/Version135/Scribus/scribus/undomanager.h
==============================================================================
--- branches/Version135/Scribus/scribus/undomanager.h (original)
+++ branches/Version135/Scribus/scribus/undomanager.h Tue Mar  8 11:09:08 2011
@@ -590,6 +590,7 @@
 	static QString ToOutlines;
 	static QString EditText;
 	static QString ClearImage;
+	static QString ClearContent;
 	/*@}*/
 
 	/**




More information about the scribus-commit mailing list