r19863 by craig - #12877: Add transaction around welding and add unweld text
scribus-commit
scribus-commit at lists.scribus.net
Mon Feb 23 18:46:15 UTC 2015
Author: craig
Date: Mon Feb 23 18:46:15 2015
New Revision: 19863
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19863
Log:
#12877: Add transaction around welding and add unweld text
Modified:
trunk/Scribus/scribus/pageitem.cpp
trunk/Scribus/scribus/undomanager.cpp
trunk/Scribus/scribus/undomanager.h
Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19863&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp (original)
+++ trunk/Scribus/scribus/pageitem.cpp Mon Feb 23 18:46:15 2015
@@ -10553,6 +10553,10 @@
//welded frames
void PageItem::weldTo(PageItem* pIt)
{
+ UndoTransaction activeTransaction;
+ if (undoManager->undoEnabled())
+ activeTransaction = undoManager->beginTransaction(Um::WeldItems + "/" + Um::Selection, Um::IGroup,
+ Um::WeldItems, "", Um::IGroup);
for (int i = 0 ; i < weldList.count(); i++)
{
PageItem::weldingInfo wInf = weldList.at(i);
@@ -10573,6 +10577,8 @@
}
update();
pIt->update();
+ if (activeTransaction)
+ activeTransaction.commit();
}
void PageItem::moveWelded(double DX, double DY, int weld)
@@ -10676,8 +10682,8 @@
{
UndoTransaction activeTransaction;
if (undoManager->undoEnabled())
- activeTransaction = undoManager->beginTransaction(Um::WeldItems + "/" + Um::Selection, Um::IGroup,
- Um::WeldItems, "", Um::IDelete);
+ activeTransaction = undoManager->beginTransaction(Um::UnweldItems + "/" + Um::Selection, Um::IGroup,
+ Um::UnweldItems, "", Um::IDelete);
for (int a = 0 ; a < weldList.count(); a++)
{
weldingInfo wInf = weldList.at(a);
@@ -10696,7 +10702,7 @@
pIt->weldList.removeAt(b);
if (undoManager->undoEnabled())
{
- ScItemState<PageItem*> *is = new ScItemState<PageItem*>(Um::WeldItems,"",Um::IGroup);
+ ScItemState<PageItem*> *is = new ScItemState<PageItem*>(Um::UnweldItems,"",Um::IGroup);
is->set("UNWELD_ITEM", "unweld_item");
is->setItem(pIt);
is->set("thisPoint_x", wInf.weldPoint.x());
Modified: trunk/Scribus/scribus/undomanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19863&path=/trunk/Scribus/scribus/undomanager.cpp
==============================================================================
--- trunk/Scribus/scribus/undomanager.cpp (original)
+++ trunk/Scribus/scribus/undomanager.cpp Mon Feb 23 18:46:15 2015
@@ -784,6 +784,7 @@
UndoManager::ChangePageAttrs = tr("Change Page Attributes");
UndoManager::Transform = tr("Transform");
UndoManager::WeldItems = tr("Weld Items");
+ UndoManager::UnweldItems = tr("Unweld Items");
UndoManager::SoftShadow = tr("Drop Shadow");
UndoManager::SoftShadowColor = tr("Drop Shadow Color");
UndoManager::SoftShadowShade = tr("Drop Shadow Shade");
@@ -1066,6 +1067,7 @@
QString UndoManager::ChangePageAttrs = "";
QString UndoManager::Transform = "";
QString UndoManager::WeldItems = "";
+QString UndoManager::UnweldItems = "";
QString UndoManager::SoftShadow = "";
QString UndoManager::SoftShadowColor = "";
QString UndoManager::SoftShadowShade = "";
Modified: trunk/Scribus/scribus/undomanager.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19863&path=/trunk/Scribus/scribus/undomanager.h
==============================================================================
--- trunk/Scribus/scribus/undomanager.h (original)
+++ trunk/Scribus/scribus/undomanager.h Mon Feb 23 18:46:15 2015
@@ -571,6 +571,7 @@
static QString ClearImage;
static QString PathOperation;
static QString WeldItems;
+ static QString UnweldItems;
static QString SoftShadow;
static QString SoftShadowColor;
static QString SoftShadowShade;
More information about the scribus-commit
mailing list