r16926 by fschmid - Added new feature "welding page items"

scribus-commit scribus-commit at lists.scribus.net
Sun Oct 23 19:48:47 UTC 2011


Author: fschmid
Date: Sun Oct 23 19:48:46 2011
New Revision: 16926

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16926
Log:
Added new feature "welding page items"
Changed the patch from Bug 10324 in serveral ways (almost rewritten)
- welding points can now have any position, not only 9 predefined.
- the welding points can be moved
- removed the master/child design
- fixed movement of welded items

Added:
    trunk/Scribus/scribus/canvasmode_editweldpoint.cpp
    trunk/Scribus/scribus/canvasmode_editweldpoint.h
Modified:
    trunk/Scribus/scribus/CMakeLists.txt
    trunk/Scribus/scribus/actionmanager.cpp
    trunk/Scribus/scribus/canvas.h
    trunk/Scribus/scribus/canvasmode.cpp
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/pageitem.h
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scribusdoc.h
    trunk/Scribus/scribus/scribusstructs.h
    trunk/Scribus/scribus/scribusview.h
    trunk/Scribus/scribus/ui/contextmenu.cpp
    trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp
    trunk/Scribus/scribus/ui/propertiespalette_xyz.h
    trunk/Scribus/scribus/ui/propertiespalette_xyzbase.ui

Modified: trunk/Scribus/scribus/CMakeLists.txt
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16926&path=/trunk/Scribus/scribus/CMakeLists.txt
==============================================================================
--- trunk/Scribus/scribus/CMakeLists.txt (original)
+++ trunk/Scribus/scribus/CMakeLists.txt Sun Oct 23 19:48:46 2011
@@ -488,6 +488,7 @@
   canvasmode_editpolygon.cpp
   canvasmode_editspiral.cpp
   canvasmode_edittable.cpp
+  canvasmode_editweldpoint.cpp
   canvasmode_magnifier.cpp
   canvasmode_measurements.cpp
   canvasmode_nodeedit.cpp

Modified: trunk/Scribus/scribus/actionmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16926&path=/trunk/Scribus/scribus/actionmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/actionmanager.cpp (original)
+++ trunk/Scribus/scribus/actionmanager.cpp Sun Oct 23 19:48:46 2011
@@ -504,6 +504,11 @@
 	name="itemConvertToPolygon";
 	scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
 	name="itemConvertToTextFrame";
+	scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
+
+	name="itemsUnWeld";
+	scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
+	name="itemWeld";
 	scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
 
 	connect( (*scrActions)["itemDuplicate"], SIGNAL(triggered()), mainWindow, SLOT(duplicateItem()) );
@@ -1109,6 +1114,9 @@
 	disconnect( (*scrActions)["itemDelete"], 0, 0, 0);
 	disconnect( (*scrActions)["extrasHyphenateText"], 0, 0, 0 );
 	disconnect( (*scrActions)["extrasDeHyphenateText"], 0, 0, 0 );
+	disconnect( (*scrActions)["itemsUnWeld"], 0, 0, 0);
+	disconnect( (*scrActions)["itemWeld"], 0, 0, 0);
+
 
 }
 
@@ -1141,6 +1149,9 @@
 	connect( (*scrActions)["tableAdjustTableToFrame"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_AdjustTableToFrame()));
 	connect( (*scrActions)["itemAdjustFrameToImage"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_AdjustFrametoImageSize()) );
 	connect( (*scrActions)["itemAdjustImageToFrame"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_AdjustImagetoFrameSize()) );
+	connect( (*scrActions)["itemsUnWeld"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_UnWeld()) );
+	connect( (*scrActions)["itemWeld"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_Weld()) );
+
 }
 
 void ActionManager::disconnectNewViewActions()
@@ -1463,6 +1474,8 @@
 	(*scrActions)["itemConvertToOutlines"]->setTexts( tr("&Outlines", "Convert to oulines"));
 	(*scrActions)["itemConvertToPolygon"]->setTexts( tr("&Polygon"));
 	(*scrActions)["itemConvertToTextFrame"]->setTexts( tr("&Text Frame"));
+	(*scrActions)["itemsUnWeld"]->setTexts( tr("Unweld items"));
+	(*scrActions)["itemWeld"]->setTexts( tr("Weld items"));
 
 	//Insert Menu
 	(*scrActions)["insertFrame"]->setTexts( tr("&Frames..."));
@@ -1939,7 +1952,9 @@
 		<< "itemAttachTextToPath" 
 		<< "itemDetachTextFromPath" 
 		<< "itemCombinePolygons" 
-		<< "itemSplitPolygons";
+		<< "itemSplitPolygons"
+		<< "itemsUnWeld"
+		<< "itemWeld";
 	//Insert
 	++itmenu;
 	itmenu->second

Modified: trunk/Scribus/scribus/canvas.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16926&path=/trunk/Scribus/scribus/canvas.h
==============================================================================
--- trunk/Scribus/scribus/canvas.h (original)
+++ trunk/Scribus/scribus/canvas.h Sun Oct 23 19:48:46 2011
@@ -94,6 +94,7 @@
 	friend class CanvasMode_EditGradient;
 	friend class CanvasMode_EditMeshGradient;
 	friend class CanvasMode_EditMeshPatch;
+	friend class CanvasMode_EditWeldPoint;
 	friend class CanvasMode_EditPolygon;
 	friend class CanvasMode_EditSpiral;
 	friend class CanvasMode_EditTable;

Modified: trunk/Scribus/scribus/canvasmode.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16926&path=/trunk/Scribus/scribus/canvasmode.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode.cpp (original)
+++ trunk/Scribus/scribus/canvasmode.cpp Sun Oct 23 19:48:46 2011
@@ -31,6 +31,7 @@
 #include "canvasmode_editpolygon.h"
 #include "canvasmode_editspiral.h"
 #include "canvasmode_edittable.h"
+#include "canvasmode_editweldpoint.h"
 #include "canvasmode_eyedropper.h"
 #include "canvasmode_framelinks.h"
 #include "canvasmode_magnifier.h"
@@ -131,6 +132,9 @@
 		case modeEditMeshPatch:
 			result = new CanvasMode_EditMeshPatch(view);
 			break;
+		case modeEditWeldPoint:
+			result = new CanvasMode_EditWeldPoint(view);
+			break;
 		case modeDrawBezierLine:
 			result = new BezierMode(view);
 			break;
@@ -369,6 +373,29 @@
 					psx->drawRect(QRectF(x, y+h-markWidth, markWidth, markWidth));
 				}
 			}
+			if (currItem->isWelded())
+			{
+				psx->setPen(QPen(Qt::yellow, 8.0 / m_canvas->scale(), Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin));
+				for (int i = 0 ; i <  currItem->weldList.count(); i++)
+				{
+					PageItem::weldingInfo wInf =  currItem->weldList.at(i);
+					psx->drawPoint(QPointF(wInf.weldPoint.x(), wInf.weldPoint.y()));
+				}
+				//draw marker for weld point
+			/*	psx->setBrush(m_brush["outline"]);
+				psx->setPen(m_pen["outline"]);
+				double weldX = x, weldY = y;
+				if (currItem->myWeldPoint == topCenter || currItem->myWeldPoint == centerCenter || currItem->myWeldPoint == bottomCenter)
+					weldX += w /2 - halfMarkWidth;
+				else if (currItem->myWeldPoint == topRight  || currItem->myWeldPoint == centerRight || currItem->myWeldPoint == bottomRight)
+					weldX += w - markWidth;
+
+				if (currItem->myWeldPoint == centerLeft  || currItem->myWeldPoint == centerCenter || currItem->myWeldPoint == centerRight)
+					weldY += h/2 - halfMarkWidth;
+				else if (currItem->myWeldPoint == bottomLeft  || currItem->myWeldPoint == bottomCenter || currItem->myWeldPoint == bottomRight)
+					weldY += h - markWidth;
+				psx->drawRect(QRectF(weldX, weldY, markWidth, markWidth));*/
+			}
 			
 			psx->restore();
 		}
@@ -652,6 +679,7 @@
 		case modeEditGradientVectors:
 		case modeEditMeshGradient:
 		case modeEditMeshPatch:
+		case modeEditWeldPoint:
 		case modeInsertPDFButton:
 		case modeInsertPDFTextfield:
 		case modeInsertPDFCheckbox:

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16926&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp (original)
+++ trunk/Scribus/scribus/pageitem.cpp Sun Oct 23 19:48:46 2011
@@ -354,6 +354,7 @@
 		tempImageFile = NULL;
 		isInlineImage = false;
 	}
+	unWeld();
 }
 
 
@@ -519,6 +520,7 @@
 	m_PrintEnabled = true;
 	isBookmark = false;
 	m_isAnnotation = false;
+	weldList.clear();
 	
 	switch (m_ItemType)
 	{
@@ -865,6 +867,7 @@
 	if (drawingOnly || m_Doc->isLoading())
 		return;
 	checkChanges();
+	moveWelded(dX, dY);
 }
 
 void PageItem::setWidth(const double newWidth)
@@ -6885,6 +6888,19 @@
 					else
 						Clip = FlattenPath(PoLine, Segments);
 				}
+				for (int i = 0 ; i < weldList.count(); i++)
+				{
+					weldingInfo wInf = weldList.at(i);
+					FPointArray gr4;
+					FPoint wp = wInf.weldPoint;
+					gr4.addPoint(wp);
+					gr4.map(ma);
+					double dx = gr4.point(0).x() - wp.x();
+					double dy = gr4.point(0).y() - wp.y();
+					moveWelded(dx, dy, i);
+					wInf.weldPoint = gr4.point(0);
+					weldList[i] = wInf;
+				}
 			}
 			OldB2 = width();
 			OldH2 = height();
@@ -6985,6 +7001,19 @@
 				Clip = FlattenPath(PoLine, Segments);
 			OldB2 = width();
 			OldH2 = height();
+			for (int i = 0 ; i < weldList.count(); i++)
+			{
+				weldingInfo wInf = weldList.at(i);
+				FPointArray gr4;
+				FPoint wp = wInf.weldPoint;
+				gr4.addPoint(wp);
+				gr4.map(ma);
+				double dx = gr4.point(0).x() - wp.x();
+				double dy = gr4.point(0).y() - wp.y();
+				moveWelded(dx, dy, i);
+				wInf.weldPoint = gr4.point(0);
+				weldList[i] = wInf;
+			}
 		}
 		break;
 	}
@@ -7062,3 +7091,95 @@
 		tempImageFile = NULL;
 	}
 }
+
+void PageItem::addWelded(PageItem* iPt)
+{
+	FPoint centerI = FPoint(xPos() + (width() / 2.0), yPos() + (height() / 2.0));
+	FPoint centerP = FPoint(iPt->xPos() + (iPt->width() / 2.0), iPt->yPos() + (iPt->height() / 2.0));
+	weldingInfo wInf;
+	wInf.weldItem = iPt;
+	wInf.weldPoint = FPoint((width() / 2.0) + ((centerP.x() - centerI.x()) / 2.0), (height() / 2.0) + ((centerP.y() - centerI.y()) / 2.0));
+	weldList.append(wInf);
+}
+
+//welded frames
+void PageItem::weldTo(PageItem* pIt)
+{
+	for (int i = 0 ; i <  weldList.count(); i++)
+	{
+		PageItem::weldingInfo wInf = weldList.at(i);
+		if (wInf.weldItem == pIt)
+			return;
+	}
+	QList<PageItem*> ret = pIt->itemsWeldedTo();
+	if (ret.contains(this))
+		return;
+	addWelded(pIt);
+	pIt->addWelded(this);
+	update();
+	pIt->update();
+}
+
+void PageItem::moveWelded(double DX, double DY, int weld)
+{
+	weldingInfo wInf = weldList.at(weld);
+	PageItem *pIt = wInf.weldItem;
+	pIt->setXPos(pIt->xPos() + DX);
+	pIt->setYPos(pIt->yPos() + DY);
+	pIt->update();
+	pIt->moveWelded(DX, DY, this);
+}
+
+void PageItem::moveWelded(double DX, double DY, PageItem* except)
+{
+	for (int i = 0 ; i < weldList.count(); i++)
+	{
+		weldingInfo wInf = weldList.at(i);
+		PageItem *pIt = wInf.weldItem;
+		if (pIt != except)
+		{
+			pIt->setXPos(pIt->xPos() + DX);
+			pIt->setYPos(pIt->yPos() + DY);
+			pIt->update();
+			pIt->moveWelded(DX, DY, this);
+		}
+	}
+}
+
+QList<PageItem*> PageItem::itemsWeldedTo(PageItem* except)
+{
+	QList<PageItem*> ret;
+	ret.clear();
+	for (int i = 0 ; i < weldList.count(); i++)
+	{
+		weldingInfo wInf = weldList.at(i);
+		PageItem *pIt = wInf.weldItem;
+		if (pIt != except)
+		{
+			ret.append(pIt);
+			if (pIt->isWelded())
+				ret.append(pIt->itemsWeldedTo(this));
+		}
+	}
+	return ret;
+}
+
+void PageItem::unWeld()
+{
+	for (int a = 0 ; a < weldList.count(); a++)
+	{
+		weldingInfo wInf = weldList.at(a);
+		PageItem *pIt = wInf.weldItem;
+		for (int b = 0 ; b < pIt->weldList.count(); b++)
+		{
+			weldingInfo wInf2 = pIt->weldList.at(b);
+			PageItem *pIt2 = wInf2.weldItem;
+			if (pIt2 == this)
+			{
+				pIt->weldList.removeAt(b);
+				break;
+			}
+		}
+	}
+	weldList.clear();
+}

Modified: trunk/Scribus/scribus/pageitem.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16926&path=/trunk/Scribus/scribus/pageitem.h
==============================================================================
--- trunk/Scribus/scribus/pageitem.h (original)
+++ trunk/Scribus/scribus/pageitem.h Sun Oct 23 19:48:46 2011
@@ -76,7 +76,6 @@
 class PageItem_LatexFrame;
 class PageItem_Spiral;
 class PageItem_Symbol;
-
 /**
   *@author Franz Schmid
   */
@@ -242,9 +241,13 @@
 	{
 		if (tempImageFile != NULL)
 			delete tempImageFile;
+//		if (isWeld())
+//			unWeldFromMaster(true);
+//		if (isWelded())
+//			unWeldChild();
 	}
 
-	void saxx(SaxHandler& handler, const Xml_string& elemtag) const {};
+	void saxx(SaxHandler& handler, const Xml_string& elemtag) const {}
 	void saxx(SaxHandler& handler) const {}
 	
 	/**
@@ -252,7 +255,7 @@
 	 * WARNING: Currently *they* do not check if the user wants this.
 	 * The view does when these are called.
 	 */	
-	virtual void clearContents() {};
+	virtual void clearContents() {}
 	
 	/**
 	 * @brief Adjust the picture scale, moved from the view, no view code here
@@ -1563,8 +1566,25 @@
 	//void textSize(double);
 	//void textToFrameDistances(double, double, double, double); //left, top, bottom, right: Extra, TExtra, BExtra, RExtra
 	//FIXME: columns, grid ?
+	
+	//items welding (item follows while item moves which they are connected with)
+public:
+	struct weldingInfo
+	{
+		PageItem *weldItem;
+		FPoint weldPoint;
+		int weldID;
+	};
+	QList<weldingInfo> weldList;
+	bool isWelded()  {return !weldList.isEmpty(); }  //true if to this item some other items are welded (weldList is list of these items)
+	void weldTo(PageItem* pIt);
+	QList<PageItem*> itemsWeldedTo(PageItem* except = NULL);
+	void unWeld();
+	void addWelded(PageItem* iPt);
+	void moveWelded(double DX, double DY, int weld);
+	void moveWelded(double DX, double DY, PageItem* except = NULL);
 };
 
-Q_DECLARE_METATYPE(PageItem*);
+Q_DECLARE_METATYPE(PageItem*)
 
 #endif

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16926&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp Sun Oct 23 19:48:46 2011
@@ -192,6 +192,12 @@
 	QList<PageItem*> TableItems;
 	QList<PageItem*> TableItemsM;
 	QList<PageItem*> TableItemsF;
+	QMap<int,int> WeldID;
+	QMap<int,int> WeldIDM;
+	QMap<int,int> WeldIDF;
+	QList<PageItem*> WeldItems;
+	QList<PageItem*> WeldItemsM;
+	QList<PageItem*> WeldItemsF;
 	QStack< QList<PageItem*> > groupStack;
 	QStack< QList<PageItem*> > groupStackF;
 	QStack< QList<PageItem*> > groupStackM;
@@ -215,6 +221,12 @@
 	TableIDM.clear();
 	TableItemsF.clear();
 	TableIDF.clear();
+	WeldItems.clear();
+	WeldID.clear();
+	WeldItemsM.clear();
+	WeldIDM.clear();
+	WeldItemsF.clear();
+	WeldIDF.clear();
 
 	bool firstElement = true;
 	bool success = true;
@@ -313,6 +325,14 @@
 				{
 					TableItems.append(itemInfo.item);
 					TableID.insert(itemInfo.ownLink, itemInfo.item->ItemNr);
+				}
+			}
+			if (itemInfo.isWeldFlag)
+			{
+				if (tagName == "ITEM")
+				{
+					WeldItems.append(itemInfo.item);
+					WeldID.insert(itemInfo.ownWeld, itemInfo.item->ItemNr);
 				}
 			}
 			if (groupStack.count() > 0)
@@ -419,6 +439,45 @@
 				ta->BottomLink = 0;
 		}
 	}
+	if (WeldItems.count() != 0)
+	{
+//		QList<PageItem*> docList = m_Doc->getAllItems(*m_Doc->Items);
+		for (int ttc = 0; ttc < WeldItems.count(); ++ttc)
+		{
+			PageItem* ta = WeldItems.at(ttc);
+			for (int i = 0 ; i < ta->weldList.count(); i++)
+			{
+				PageItem::weldingInfo wInf = ta->weldList.at(i);
+				ta->weldList[i].weldItem = m_Doc->Items->at(WeldID[wInf.weldID]);
+			}
+		}
+	}
+	if (WeldItemsM.count() != 0)
+	{
+//		QList<PageItem*> docList = m_Doc->getAllItems(m_Doc->MasterItems);
+		for (int ttc = 0; ttc < WeldItemsM.count(); ++ttc)
+		{
+			PageItem* ta = WeldItemsM.at(ttc);
+			for (int i = 0 ; i < ta->weldList.count(); i++)
+			{
+				PageItem::weldingInfo wInf = ta->weldList.at(i);
+				ta->weldList[i].weldItem = m_Doc->MasterItems.at(WeldIDM[wInf.weldID]);
+			}
+		}
+	}
+	if (WeldItemsF.count() != 0)
+	{
+//		QList<PageItem*> docList = m_Doc->getAllItems(m_Doc->FrameItems);
+		for (int ttc = 0; ttc < WeldItemsF.count(); ++ttc)
+		{
+			PageItem* ta = WeldItemsF.at(ttc);
+			for (int i = 0 ; i < ta->weldList.count(); i++)
+			{
+				PageItem::weldingInfo wInf = ta->weldList.at(i);
+				ta->weldList[i].weldItem = m_Doc->FrameItems.at(WeldIDF[wInf.weldID]);
+			}
+		}
+	}
 	// reestablish textframe links
 	if (itemNext.count() != 0)
 	{
@@ -536,6 +595,12 @@
 	QList<PageItem*> TableItems;
 	QList<PageItem*> TableItemsM;
 	QList<PageItem*> TableItemsF;
+	QMap<int,int> WeldID;
+	QMap<int,int> WeldIDM;
+	QMap<int,int> WeldIDF;
+	QList<PageItem*> WeldItems;
+	QList<PageItem*> WeldItemsM;
+	QList<PageItem*> WeldItemsF;
 	QStack< QList<PageItem*> > groupStack;
 	QStack< QList<PageItem*> > groupStackF;
 	QStack< QList<PageItem*> > groupStackM;
@@ -574,6 +639,12 @@
 	TableIDM.clear();
 	TableItemsF.clear();
 	TableIDF.clear();
+	WeldItems.clear();
+	WeldID.clear();
+	WeldItemsM.clear();
+	WeldIDM.clear();
+	WeldItemsF.clear();
+	WeldIDF.clear();
 
 	m_Doc->GroupCounter = 1;
 	m_Doc->LastAuto = 0;
@@ -688,6 +759,24 @@
 					TableIDM.insert(itemInfo.ownLink, itemInfo.item->ItemNr);
 				}
 			}
+			if (itemInfo.isWeldFlag)
+			{
+				if (tagName == "PAGEOBJECT")
+				{
+					WeldItems.append(itemInfo.item);
+					WeldID.insert(itemInfo.ownWeld, itemInfo.item->ItemNr);
+				}
+				else if (tagName == "FRAMEOBJECT")
+				{
+					WeldItemsF.append(itemInfo.item);
+					WeldIDF.insert(itemInfo.ownWeld, itemInfo.item->ItemNr);
+				}
+				else
+				{
+					WeldItemsM.append(itemInfo.item);
+					WeldIDM.insert(itemInfo.ownWeld, itemInfo.item->ItemNr);
+				}
+			}
 			if (groupStack.count() > 0)
 			{
 				groupStack.top().append(itemInfo.item);
@@ -793,6 +882,45 @@
 				ta->BottomLink = 0;
 		}
 	}
+	if (WeldItems.count() != 0)
+	{
+	//	QList<PageItem*> docList = m_Doc->getAllItems(*m_Doc->Items);
+		for (int ttc = 0; ttc < WeldItems.count(); ++ttc)
+		{
+			PageItem* ta = WeldItems.at(ttc);
+			for (int i = 0 ; i < ta->weldList.count(); i++)
+			{
+				PageItem::weldingInfo wInf = ta->weldList.at(i);
+				ta->weldList[i].weldItem = m_Doc->Items->at(WeldID[wInf.weldID]);
+			}
+		}
+	}
+	if (WeldItemsM.count() != 0)
+	{
+	//	QList<PageItem*> docList = m_Doc->getAllItems(m_Doc->MasterItems);
+		for (int ttc = 0; ttc < WeldItemsM.count(); ++ttc)
+		{
+			PageItem* ta = WeldItemsM.at(ttc);
+			for (int i = 0 ; i < ta->weldList.count(); i++)
+			{
+				PageItem::weldingInfo wInf = ta->weldList.at(i);
+				ta->weldList[i].weldItem = m_Doc->MasterItems.at(WeldIDM[wInf.weldID]);
+			}
+		}
+	}
+	if (WeldItemsF.count() != 0)
+	{
+	//	QList<PageItem*> docList = m_Doc->getAllItems(m_Doc->FrameItems);
+		for (int ttc = 0; ttc < WeldItemsF.count(); ++ttc)
+		{
+			PageItem* ta = WeldItemsF.at(ttc);
+			for (int i = 0 ; i < ta->weldList.count(); i++)
+			{
+				PageItem::weldingInfo wInf = ta->weldList.at(i);
+				ta->weldList[i].weldItem = m_Doc->FrameItems.at(WeldIDF[wInf.weldID]);
+			}
+		}
+	}
 	// reestablish textframe links
 	if (itemNext.count() != 0)
 	{
@@ -940,6 +1068,12 @@
 	QList<PageItem*> TableItems;
 	QList<PageItem*> TableItemsM;
 	QList<PageItem*> TableItemsF;
+	QMap<int,int> WeldID;
+	QMap<int,int> WeldIDM;
+	QMap<int,int> WeldIDF;
+	QList<PageItem*> WeldItems;
+	QList<PageItem*> WeldItemsM;
+	QList<PageItem*> WeldItemsF;
 	QStack< QList<PageItem*> > groupStack;
 	QStack< QList<PageItem*> > groupStackF;
 	QStack< QList<PageItem*> > groupStackM;
@@ -981,6 +1115,12 @@
 	TableIDM.clear();
 	TableItemsF.clear();
 	TableIDF.clear();
+	WeldItems.clear();
+	WeldID.clear();
+	WeldItemsM.clear();
+	WeldIDM.clear();
+	WeldItemsF.clear();
+	WeldIDF.clear();
 
 	m_Doc->GroupCounter = 1;
 	m_Doc->LastAuto = 0;
@@ -1201,6 +1341,24 @@
 					TableIDM.insert(itemInfo.ownLink, itemInfo.item->ItemNr);
 				}
 			}
+			if (itemInfo.isWeldFlag)
+			{
+				if (tagName == "PAGEOBJECT")
+				{
+					WeldItems.append(itemInfo.item);
+					WeldID.insert(itemInfo.ownWeld, itemInfo.item->ItemNr);
+				}
+				else if (tagName == "FRAMEOBJECT")
+				{
+					WeldItemsF.append(itemInfo.item);
+					WeldIDF.insert(itemInfo.ownWeld, itemInfo.item->ItemNr);
+				}
+				else
+				{
+					WeldItemsM.append(itemInfo.item);
+					WeldIDM.insert(itemInfo.ownWeld, itemInfo.item->ItemNr);
+				}
+			}
 			if (groupStack.count() > 0)
 			{
 				groupStack.top().append(itemInfo.item);
@@ -1318,6 +1476,45 @@
 				ta->BottomLink = m_Doc->Items->at(TableID[ta->BottomLinkID]);
 			else
 				ta->BottomLink = 0;
+		}
+	}
+	if (WeldItems.count() != 0)
+	{
+	//	QList<PageItem*> docList = m_Doc->getAllItems(*m_Doc->Items);
+		for (int ttc = 0; ttc < WeldItems.count(); ++ttc)
+		{
+			PageItem* ta = WeldItems.at(ttc);
+			for (int i = 0 ; i < ta->weldList.count(); i++)
+			{
+				PageItem::weldingInfo wInf = ta->weldList.at(i);
+				ta->weldList[i].weldItem = m_Doc->Items->at(WeldID[wInf.weldID]);
+			}
+		}
+	}
+	if (WeldItemsM.count() != 0)
+	{
+	//	QList<PageItem*> docList = m_Doc->getAllItems(m_Doc->MasterItems);
+		for (int ttc = 0; ttc < WeldItemsM.count(); ++ttc)
+		{
+			PageItem* ta = WeldItemsM.at(ttc);
+			for (int i = 0 ; i < ta->weldList.count(); i++)
+			{
+				PageItem::weldingInfo wInf = ta->weldList.at(i);
+				ta->weldList[i].weldItem = m_Doc->MasterItems.at(WeldIDM[wInf.weldID]);
+			}
+		}
+	}
+	if (WeldItemsF.count() != 0)
+	{
+	//	QList<PageItem*> docList = m_Doc->getAllItems(m_Doc->FrameItems);
+		for (int ttc = 0; ttc < WeldItemsF.count(); ++ttc)
+		{
+			PageItem* ta = WeldItemsF.at(ttc);
+			for (int i = 0 ; i < ta->weldList.count(); i++)
+			{
+				PageItem::weldingInfo wInf = ta->weldList.at(i);
+				ta->weldList[i].weldItem = m_Doc->FrameItems.at(WeldIDF[wInf.weldID]);
+			}
 		}
 	}
 	//CB Add this in to set this in the file in memory. Its saved, why not load it.
@@ -1994,6 +2191,7 @@
 	if (attrs.hasAttribute(LANGUAGE))
 		newStyle.setLanguage(attrs.valueAsString(LANGUAGE));
 
+
 	static const QString SHORTCUT("SHORTCUT");
 	if (attrs.hasAttribute(SHORTCUT))
 		newStyle.setShortcut(attrs.valueAsString(SHORTCUT));
@@ -2648,10 +2846,11 @@
 	info.nextItem = attrs.valueAsInt("NEXTITEM", -1);
 	info.ownLink  = newItem->isTableItem ? attrs.valueAsInt("OwnLINK", 0) : 0;
 	info.groupLastItem = 0;
-
 	info.isGroupFlag = attrs.valueAsBool("isGroupControl", 0);
 	if (info.isGroupFlag)
 		info.groupLastItem = attrs.valueAsInt("groupsLastItem", 0);
+	info.isWeldFlag = attrs.valueAsBool("isWeldItem", 0);
+	info.ownWeld = attrs.valueAsInt("WeldSource", 0);
 
 	struct ImageLoadRequest loadingInfo;
 #ifdef HAVE_OSG
@@ -2904,6 +3103,14 @@
 				doc->Items = DItems;
 			}
 		}
+		if (tName == "WeldEntry")
+		{
+			PageItem::weldingInfo wInf;
+			wInf.weldItem = NULL;
+			wInf.weldPoint = FPoint(tAtt.valueAsDouble("WX", 0.0), tAtt.valueAsDouble("WY", 0.0));
+			wInf.weldID = tAtt.valueAsInt("Target", 0);
+			newItem->weldList.append(wInf);
+		}
 	}
 	delete lastStyle;
 
@@ -2997,6 +3204,8 @@
 	QStack<int> groupStack2;
 	QMap<int,int> TableID2;
 	QList<PageItem*> TableItems2;
+	QMap<int,int> WeldID;
+	QList<PageItem*> WeldItems;
 
 	pat.setDoc(doc);
 	pat.width   = attrs.valueAsDouble("width", 0.0);
@@ -3039,6 +3248,11 @@
 			TableItems2.append(itemInfo.item);
 			TableID2.insert(itemInfo.ownLink, itemInfo.item->ItemNr);
 		}
+		if (itemInfo.isWeldFlag)
+		{
+			WeldItems.append(itemInfo.item);
+			WeldID.insert(itemInfo.ownWeld, itemInfo.item->ItemNr);
+		}
 		if (groupStack.count() > 0)
 		{
 			groupStack.top().append(itemInfo.item);
@@ -3086,6 +3300,19 @@
 				ta->BottomLink = m_Doc->Items->at(TableID2[ta->BottomLinkID]);
 			else
 				ta->BottomLink = 0;
+		}
+	}
+	if (WeldItems.count() != 0)
+	{
+	//	QList<PageItem*> docList = m_Doc->getAllItems(*m_Doc->Items);
+		for (int ttc = 0; ttc < WeldItems.count(); ++ttc)
+		{
+			PageItem* ta = WeldItems.at(ttc);
+			for (int i = 0 ; i < ta->weldList.count(); i++)
+			{
+				PageItem::weldingInfo wInf = ta->weldList.at(i);
+				ta->weldList[i].weldItem = m_Doc->Items->at(WeldID[wInf.weldID]);
+			}
 		}
 	}
 	if (groupStackP.count() > 0)
@@ -4110,6 +4337,8 @@
 	QString tmp;
 	QMap<int,int> TableID;
 	QList<PageItem*> TableItems;
+	QMap<int,int> WeldID;
+	QList<PageItem*> WeldItems;
 	QStack< QList<PageItem*> > groupStack;
 	QStack< QList<PageItem*> > groupStackF;
 	QStack< QList<PageItem*> > groupStackP;
@@ -4135,6 +4364,8 @@
 	itemCountM = 0;
 	itemRemapF.clear();
 	itemNextF.clear();
+	WeldItems.clear();
+	WeldID.clear();
 
  	QString f(readSLA(fileName));
 	if (f.isEmpty())
@@ -4342,6 +4573,11 @@
 					TableItems.append(newItem);
 					TableID.insert(itemInfo.ownLink, newItem->ItemNr);
 				}
+				if (itemInfo.isWeldFlag)
+				{
+					WeldItems.append(itemInfo.item);
+					WeldID.insert(itemInfo.ownWeld, itemInfo.item->ItemNr);
+				}
 				if (tagName == "FRAMEOBJECT")
 				{
 					m_Doc->FrameItems.append(m_Doc->Items->takeAt(newItem->ItemNr));
@@ -4415,6 +4651,19 @@
 				ta->BottomLink = 0;
 		}
 	}
+	if (WeldItems.count() != 0)
+	{
+//		QList<PageItem*> docList = m_Doc->getAllItems(*m_Doc->Items);
+		for (int ttc = 0; ttc < WeldItems.count(); ++ttc)
+		{
+			PageItem* ta = WeldItems.at(ttc);
+			for (int i = 0 ; i < ta->weldList.count(); i++)
+			{
+				PageItem::weldingInfo wInf = ta->weldList.at(i);
+				ta->weldList[i].weldItem = m_Doc->Items->at(WeldID[wInf.weldID]);
+			}
+		}
+	}
 	// reestablish textframe links
 	if (itemNext.count() != 0 && !Mpage)
 	{

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16926&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h Sun Oct 23 19:48:46 2011
@@ -68,18 +68,20 @@
 			ItemSelectionFrame  = 2,
 			ItemSelectionPattern= 3,
 			ItemSelectionGroup  = 4,
-			ItemSelectionElements = 5,
+			ItemSelectionElements = 5
 		};
 
 		class ItemInfo
 		{
 		public:
-			ItemInfo(void) { groupLastItem = nextItem = ownLink = 0; item = NULL; isGroupFlag = false; };
+			ItemInfo(void) { groupLastItem = nextItem = ownLink = ownWeld = 0; item = NULL; isGroupFlag = isWeldFlag = false; };
 			PageItem* item;
 			int groupLastItem;
 			int nextItem;
 			int ownLink;
+			int ownWeld;
 			bool isGroupFlag;
+			bool isWeldFlag;
 		};
 
 		void registerFormats();
@@ -159,6 +161,7 @@
 		QMap<int, int> itemNextF;
 		QMap<int, int> itemRemapM;
 		QMap<int, int> itemNextM;
+		QMap<PageItem*, QString> itemsWeld;  //item* and master name
 
 		int itemCount;
 		int itemCountM;

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16926&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp Sun Oct 23 19:48:46 2011
@@ -1860,7 +1860,20 @@
 			}
 			docu.writeEndElement();
 		}
-
+		//write weld parameter
+		if (item->isWelded())
+		{
+			docu.writeAttribute("isWeldItem", 1);
+			docu.writeAttribute("WeldSource", item->ItemNr);
+			for (int i = 0 ; i <  item->weldList.count(); i++)
+			{
+				PageItem::weldingInfo wInf = item->weldList.at(i);
+				docu.writeEmptyElement("WeldEntry");
+				docu.writeAttribute("Target", wInf.weldItem->ItemNr);
+				docu.writeAttribute("WX", wInf.weldPoint.x());
+				docu.writeAttribute("WY", wInf.weldPoint.y());
+			}
+		}
 		docu.writeEndElement();
 	}
 }

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16926&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Sun Oct 23 19:48:46 2011
@@ -830,6 +830,8 @@
 	scrActions["itemPrintingEnabled"]->setEnabled(false);
 	scrMenuMgr->setMenuEnabled("ItemConvertTo", false);
 
+	scrMenuMgr->addMenuItem(scrActions["itemsUnWeld"], "Item", false);
+	scrMenuMgr->addMenuItem(scrActions["itemWeld"], "Item", false);
 
 	//Insert menu
 	scrMenuMgr->createMenu("Insert", ActionManager::defaultMenuNameEntryTranslated("Insert"));
@@ -3031,8 +3033,17 @@
 	}
 	doc->CurrentSel = SelectedType;
 	propertiesPalette->xyzPal->basePointWidget->setCheckedId(doc->RotMode());
+	if (docSelectionCount == 1)
+	{
+		PageItem* bx = doc->m_Selection->itemAt(0);
+		if (bx->isWelded())
+			scrActions["itemsUnWeld"]->setEnabled(true);
+		else
+			scrActions["itemsUnWeld"]->setEnabled(false);
+	}
 	if (docSelectionCount > 1)
 	{
+//		scrMenuMgr->setMenuEnabled("ItemWeld", true);
 		if (!doc->m_Selection->itemsAreSameType())
 		{
 			scrActions["itemConvertToBezierCurve"]->setEnabled(false);
@@ -3058,6 +3069,7 @@
 		scrActions["itemCombinePolygons"]->setEnabled(hPoly);
 		if (docSelectionCount == 2)
 		{
+			scrActions["itemWeld"]->setEnabled(true);
 			//CB swap bx around if currItem is not at 0 index from the lastItem loop at start of havenewsel
 			PageItem* bx=doc->m_Selection->itemAt(1);
 			if (currItem==bx)
@@ -3070,9 +3082,12 @@
 			}
 
 		}
+		else
+			scrActions["itemWeld"]->setEnabled(false);
 	}
 	else
 	{
+		scrActions["itemWeld"]->setEnabled(false);
 		scrActions["itemGroup"]->setEnabled(false);
 		scrActions["itemAttachTextToPath"]->setEnabled(false);
 		scrActions["itemCombinePolygons"]->setEnabled(false);

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16926&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Sun Oct 23 19:48:46 2011
@@ -4742,6 +4742,16 @@
 	return ret;
 }
 
+PageItem* ScribusDoc::getItemFromName(QString name)
+{
+	PageItem* ret = NULL;
+	for (int a = 0; a < Items->count(); ++a)
+	{
+		if (Items->at(a)->itemName() == name)
+			return Items->at(a);
+	}
+	return ret;
+}
 
 void ScribusDoc::updateFrameItems()
 {
@@ -9682,6 +9692,8 @@
 			}
 			*/
 		}
+		if (currItem->isWelded())
+			currItem->unWeld();
 		if (currItem->isBookmark)
 			//CB From view   emit DelBM(currItem);
 			m_ScMW->DelBookMark(currItem);
@@ -12531,7 +12543,7 @@
 	double Scale = 1; //FIXME:av should all be in doc coordinates
 	Selection* itemSelection = (customSelection!=0) ? customSelection : m_Selection;
 	Q_ASSERT(itemSelection!=0);
-	uint selectedItemCount=itemSelection->count();
+	uint selectedItemCount = itemSelection->count();
 	if (selectedItemCount == 0)
 		return;
 	if (x == 0.0 && y == 0.0)
@@ -12545,10 +12557,16 @@
 	//in -= QPoint(qRound(Doc->minCanvasCoordinate.x() * Scale), qRound(Doc->minCanvasCoordinate.y() * Scale));
 	//QPoint out = in;//contentsToViewport(in);
 	QRectF OldRect = QRectF(gx, gy, gw, gh); //out.x(), out.y(), qRound(gw*Scale), qRound(gh*Scale));
+	QList<PageItem*> weldL;
 	for (uint a = 0; a < selectedItemCount; ++a)
 	{
 		currItem = itemSelection->itemAt(a);
-		MoveItem(x, y, currItem, fromMP);
+		if (!weldL.contains(currItem))
+		{
+			if (currItem->isWelded())
+				weldL.append(currItem->itemsWeldedTo());
+			MoveItem(x, y, currItem, fromMP);
+		}
 	}
 	itemSelection->setGroupRect();
 	itemSelection->getGroupRect(&gx, &gy, &gw, &gh);
@@ -14269,3 +14287,29 @@
 	}
 }
 
+void ScribusDoc::itemSelection_UnWeld()
+{
+	PageItem *currItem;
+	for (int a = 0; a < m_Selection->count(); ++a)
+	{
+		currItem = m_Selection->itemAt(a);
+		if (currItem->isWelded())
+		{
+			currItem->unWeld();
+			changed();
+		}
+	}
+	regionsChanged()->update(QRectF());
+}
+
+void ScribusDoc::itemSelection_Weld()
+{
+	if (m_Selection->count() != 2)
+		return;
+	PageItem * master = m_Selection->itemAt(1);
+	PageItem * selItem = m_Selection->itemAt(0);
+	selItem->weldTo(master);
+	changed();
+	regionsChanged()->update(QRectF());
+}
+

Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16926&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h (original)
+++ trunk/Scribus/scribus/scribusdoc.h Sun Oct 23 19:48:46 2011
@@ -774,6 +774,8 @@
 	void itemAddDetails(const PageItem::ItemType itemType, const PageItem::ItemFrameType frameType, const int itemNumber);
 
 	uint getItemNrfromUniqueID(uint unique);
+	//return pointer to item
+	PageItem* getItemFromName(QString name);
 	//itemDelete
 	//itemBlah...
 	
@@ -1529,6 +1531,10 @@
 	void updatePict(QString name);
 	void updatePictDir(QString name);
 	void removePict(QString name);
+//welding two items
+public slots:
+	void itemSelection_UnWeld();
+	void itemSelection_Weld();
 };
 
 Q_DECLARE_METATYPE(ScribusDoc*);

Modified: trunk/Scribus/scribus/scribusstructs.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16926&path=/trunk/Scribus/scribus/scribusstructs.h
==============================================================================
--- trunk/Scribus/scribus/scribusstructs.h (original)
+++ trunk/Scribus/scribus/scribusstructs.h Sun Oct 23 19:48:46 2011
@@ -319,7 +319,8 @@
 	modeDrawSpiral,
 	modeEditSpiral,
 	modeEditTable,
-	modeEditMeshPatch
+	modeEditMeshPatch,
+	modeEditWeldPoint
 };
 
 struct AlignObjs

Modified: trunk/Scribus/scribus/scribusview.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16926&path=/trunk/Scribus/scribus/scribusview.h
==============================================================================
--- trunk/Scribus/scribus/scribusview.h (original)
+++ trunk/Scribus/scribus/scribusview.h Sun Oct 23 19:48:46 2011
@@ -102,6 +102,7 @@
 	friend class CanvasMode_EditGradient;
 	friend class CanvasMode_EditMeshGradient;
 	friend class CanvasMode_EditMeshPatch;
+	friend class CanvasMode_EditWeldPoint;
 	friend class CanvasMode_EditPolygon;
 	friend class CanvasMode_EditArc;
 	friend class CanvasMode_EditSpiral;

Modified: trunk/Scribus/scribus/ui/contextmenu.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16926&path=/trunk/Scribus/scribus/ui/contextmenu.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/contextmenu.cpp (original)
+++ trunk/Scribus/scribus/ui/contextmenu.cpp Sun Oct 23 19:48:46 2011
@@ -95,6 +95,7 @@
 	QMenu *menuLevel = new QMenu(this);
 	QMenu *menuPDF = new QMenu(this);
 	QMenu *menuResolution = new QMenu(this);
+	QMenu *menuWeld = new QMenu(this);
 	
 	//<-- Add Info
 	//Test new method with image frames first
@@ -424,6 +425,32 @@
 	}
 	//-->
 	
+	//<-- Add Welding Menu
+	addSeparator();
+	if (selectedItemCount > 0 && m_doc->appMode != modeEdit)
+	{
+		PageItem *currItem;
+		for (int a = 0; a < m_Sel.count(); ++a)
+		{
+			currItem = m_Sel.itemAt(a);
+			if (currItem->isWelded())
+			{
+				addAction(m_AP->scrActions["itemsUnWeld"]);
+				break;
+			}
+		}
+	}
+	if (selectedItemCount == 2 && m_doc->appMode != modeEdit)
+	{
+		menuWeld->addAction(m_AP->scrActions["itemWeld17"]);
+		menuWeld->addAction(m_AP->scrActions["itemWeld71"]);
+		menuWeld->addAction(m_AP->scrActions["itemWeld13"]);
+		menuWeld->addAction(m_AP->scrActions["itemWeld31"]);
+		QAction *act = addMenu(menuWeld);
+		act->setText( ScribusView::tr("Weld to last..."));
+	}
+	//-->
+	
 	//<-- Add Properties
 	addSeparator();
 	addAction(m_AP->scrActions["toolsProperties"]);

Modified: trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16926&path=/trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp Sun Oct 23 19:48:46 2011
@@ -134,6 +134,7 @@
 	connect(noResize , SIGNAL(clicked()), this, SLOT(handleLockSize()));
 	connect(doGroup  , SIGNAL(clicked()), this, SLOT(handleGrouping()) );
 	connect(doUnGroup, SIGNAL(clicked()), this, SLOT(handleUngrouping()) );
+	connect(buttonEditWeldPoint, SIGNAL(clicked()), this, SLOT(handleEditWeldPoint()));
 
 	m_haveItem = false;
 	xposSpin->showValue(0);
@@ -141,6 +142,7 @@
 	widthSpin->showValue(0);
 	heightSpin->showValue(0);
 	rotationSpin->showValue(0);
+	buttonEditWeldPoint->setEnabled(false);
 }
 
 void PropertiesPalette_XYZ::setMainWindow(ScribusMainWindow* mw)
@@ -409,6 +411,7 @@
 		setEnabled(true);
 	}
 	updateSpinBoxConstants();
+	buttonEditWeldPoint->setEnabled(m_item->isWelded());
 }
 
 void PropertiesPalette_XYZ::handleSelectionChanged()
@@ -514,6 +517,7 @@
 			heightSpin->showValue(0);
 			rotationSpin->showValue(0);
 			levelLabel->setText("  ");
+			buttonEditWeldPoint->setEnabled(false);
 			setEnabled(false);
 			break;
 		case PageItem::ImageFrame:
@@ -1413,6 +1417,7 @@
 	doLock->setToolTip( tr("Lock or unlock the object"));
 	noResize->setToolTip( tr("Lock or unlock the size of the object"));
 	noPrint->setToolTip( tr("Enable or disable exporting of the object"));
+	buttonEditWeldPoint->setToolTip( tr("Edit the welding point of the object"));
 
 	keepFrameWHRatioButton->setToolTip( tr("Keep the aspect ratio"));
 }
@@ -1498,3 +1503,11 @@
 	m_ScMW->UnGroupObj();
 }
 
+
+void PropertiesPalette_XYZ::handleEditWeldPoint()
+{
+	if (buttonEditWeldPoint->isChecked())
+		m_ScMW->view->requestMode(modeEditWeldPoint);
+	else
+		m_ScMW->view->requestMode(modeNormal);
+}

Modified: trunk/Scribus/scribus/ui/propertiespalette_xyz.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16926&path=/trunk/Scribus/scribus/ui/propertiespalette_xyz.h
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_xyz.h (original)
+++ trunk/Scribus/scribus/ui/propertiespalette_xyz.h Sun Oct 23 19:48:46 2011
@@ -87,6 +87,7 @@
 	void handleNewName();
 	void handleGrouping();
 	void handleUngrouping();
+	void handleEditWeldPoint();
 
 protected slots:
 	//virtual void reject();

Modified: trunk/Scribus/scribus/ui/propertiespalette_xyzbase.ui
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16926&path=/trunk/Scribus/scribus/ui/propertiespalette_xyzbase.ui
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_xyzbase.ui (original)
+++ trunk/Scribus/scribus/ui/propertiespalette_xyzbase.ui Sun Oct 23 19:48:46 2011
@@ -1,353 +1,380 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>PropertiesPalette_XYZBase</class>
- <widget class="QWidget" name="PropertiesPalette_XYZBase">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>280</width>
-    <height>300</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Form</string>
-  </property>
-  <layout class="QVBoxLayout" name="verticalLayout">
-   <property name="spacing">
-    <number>2</number>
-   </property>
-   <property name="margin">
-    <number>2</number>
-   </property>
-   <item>
-    <widget class="QGroupBox" name="nameGroup">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="title">
-      <string>Name</string>
-     </property>
-     <layout class="QHBoxLayout" name="horizontalLayout">
-      <property name="spacing">
-       <number>2</number>
-      </property>
-      <property name="margin">
-       <number>2</number>
-      </property>
-      <item>
-       <widget class="NameWidget" name="nameEdit">
-        <property name="focusPolicy">
-         <enum>Qt::ClickFocus</enum>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </item>
-   <item>
-    <widget class="QGroupBox" name="geoGroup">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="title">
-      <string>Geometry</string>
-     </property>
-     <layout class="QVBoxLayout" name="verticalLayout_2">
-      <property name="margin">
-       <number>2</number>
-      </property>
-      <item>
-       <layout class="QGridLayout" name="geoGroupLayout">
-        <property name="margin">
-         <number>5</number>
-        </property>
-        <property name="spacing">
-         <number>4</number>
-        </property>
-        <item row="0" column="0">
-         <widget class="QLabel" name="xposLabel">
-          <property name="text">
-           <string>&X-Pos:</string>
-          </property>
-         </widget>
-        </item>
-        <item row="0" column="1">
-         <widget class="ScrSpinBox" name="xposSpin">
-          <property name="sizePolicy">
-           <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
-            <horstretch>0</horstretch>
-            <verstretch>0</verstretch>
-           </sizepolicy>
-          </property>
-         </widget>
-        </item>
-        <item row="2" column="0">
-         <widget class="QLabel" name="widthLabel">
-          <property name="text">
-           <string>&Width:</string>
-          </property>
-         </widget>
-        </item>
-        <item row="1" column="0">
-         <widget class="QLabel" name="yposLabel">
-          <property name="text">
-           <string>&Y-Pos:</string>
-          </property>
-         </widget>
-        </item>
-        <item row="1" column="1">
-         <widget class="ScrSpinBox" name="yposSpin"/>
-        </item>
-        <item row="2" column="1">
-         <widget class="ScrSpinBox" name="widthSpin"/>
-        </item>
-        <item row="3" column="0">
-         <widget class="QLabel" name="heightLabel">
-          <property name="text">
-           <string>&Height:</string>
-          </property>
-         </widget>
-        </item>
-        <item row="3" column="1">
-         <widget class="ScrSpinBox" name="heightSpin"/>
-        </item>
-        <item row="4" column="0">
-         <widget class="QLabel" name="rotationLabel">
-          <property name="text">
-           <string>&Rotation:</string>
-          </property>
-         </widget>
-        </item>
-        <item row="4" column="1">
-         <widget class="ScrSpinBox" name="rotationSpin">
-          <property name="wrapping">
-           <bool>true</bool>
-          </property>
-         </widget>
-        </item>
-        <item row="5" column="0">
-         <widget class="QLabel" name="basepointLabel">
-          <property name="text">
-           <string>Basepoint:</string>
-          </property>
-         </widget>
-        </item>
-        <item row="5" column="1">
-         <widget class="BasePointWidget" name="basePointWidget" native="true"/>
-        </item>
-        <item row="2" column="2" rowspan="2">
-         <widget class="LinkButton" name="keepFrameWHRatioButton">
-          <property name="maximumSize">
-           <size>
-            <width>15</width>
-            <height>32767</height>
-           </size>
-          </property>
-          <property name="text">
-           <string>...</string>
-          </property>
-          <property name="checkable">
-           <bool>true</bool>
-          </property>
-          <property name="autoRaise">
-           <bool>true</bool>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </item>
-     </layout>
-    </widget>
-   </item>
-   <item>
-    <layout class="QHBoxLayout" name="horizontalLayout_2">
-     <item>
-      <widget class="QGroupBox" name="levelGroup">
-       <property name="title">
-        <string>Level</string>
-       </property>
-       <layout class="QGridLayout" name="gridLayout">
-        <property name="margin">
-         <number>5</number>
-        </property>
-        <property name="spacing">
-         <number>4</number>
-        </property>
-        <item row="0" column="0">
-         <widget class="QToolButton" name="levelUp">
-          <property name="maximumSize">
-           <size>
-            <width>22</width>
-            <height>22</height>
-           </size>
-          </property>
-          <property name="text">
-           <string/>
-          </property>
-         </widget>
-        </item>
-        <item row="1" column="0">
-         <widget class="QToolButton" name="levelDown">
-          <property name="maximumSize">
-           <size>
-            <width>22</width>
-            <height>22</height>
-           </size>
-          </property>
-          <property name="text">
-           <string/>
-          </property>
-         </widget>
-        </item>
-        <item row="0" column="1">
-         <widget class="QToolButton" name="levelTop">
-          <property name="maximumSize">
-           <size>
-            <width>22</width>
-            <height>22</height>
-           </size>
-          </property>
-          <property name="text">
-           <string/>
-          </property>
-         </widget>
-        </item>
-        <item row="1" column="1">
-         <widget class="QToolButton" name="levelBottom">
-          <property name="maximumSize">
-           <size>
-            <width>22</width>
-            <height>22</height>
-           </size>
-          </property>
-          <property name="text">
-           <string/>
-          </property>
-         </widget>
-        </item>
-        <item row="0" column="2" rowspan="2">
-         <widget class="QLabel" name="levelLabel">
-          <property name="text">
-           <string>0</string>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </widget>
-     </item>
-     <item>
-      <spacer name="horizontalSpacer">
-       <property name="orientation">
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>40</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <layout class="QGridLayout" name="gridLayout_2">
-       <item row="0" column="0">
-        <widget class="QToolButton" name="doGroup">
-         <property name="text">
-          <string/>
-         </property>
-        </widget>
-       </item>
-       <item row="1" column="0">
-        <widget class="QToolButton" name="doUnGroup">
-         <property name="text">
-          <string/>
-         </property>
-        </widget>
-       </item>
-       <item row="0" column="1">
-        <widget class="QToolButton" name="flipH">
-         <property name="text">
-          <string/>
-         </property>
-        </widget>
-       </item>
-       <item row="1" column="1">
-        <widget class="QToolButton" name="flipV">
-         <property name="text">
-          <string/>
-         </property>
-        </widget>
-       </item>
-       <item row="0" column="2">
-        <widget class="QToolButton" name="doLock">
-         <property name="text">
-          <string/>
-         </property>
-        </widget>
-       </item>
-       <item row="1" column="2">
-        <widget class="QToolButton" name="noPrint">
-         <property name="text">
-          <string/>
-         </property>
-        </widget>
-       </item>
-       <item row="0" column="3">
-        <widget class="QToolButton" name="noResize">
-         <property name="text">
-          <string/>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <spacer name="verticalSpacer">
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>20</width>
-       <height>40</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>NameWidget</class>
-   <extends>QLineEdit</extends>
-   <header>ui/propertiespalette_utils.h</header>
-  </customwidget>
-  <customwidget>
-   <class>ScrSpinBox</class>
-   <extends>QDoubleSpinBox</extends>
-   <header>ui/scrspinbox.h</header>
-  </customwidget>
-  <customwidget>
-   <class>BasePointWidget</class>
-   <extends>QWidget</extends>
-   <header>ui/basepointwidget.h</header>
-   <container>1</container>
-  </customwidget>
-  <customwidget>
-   <class>LinkButton</class>
-   <extends>QToolButton</extends>
-   <header>ui/linkbutton.h</header>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PropertiesPalette_XYZBase</class>
+ <widget class="QWidget" name="PropertiesPalette_XYZBase">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>280</width>
+    <height>352</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <property name="spacing">
+    <number>5</number>
+   </property>
+   <property name="margin">
+    <number>0</number>
+   </property>
+   <item>
+    <widget class="QGroupBox" name="nameGroup">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="title">
+      <string>Name</string>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout">
+      <property name="spacing">
+       <number>2</number>
+      </property>
+      <property name="margin">
+       <number>2</number>
+      </property>
+      <item>
+       <widget class="NameWidget" name="nameEdit">
+        <property name="focusPolicy">
+         <enum>Qt::ClickFocus</enum>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="geoGroup">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="title">
+      <string>Geometry</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout_2">
+      <property name="margin">
+       <number>2</number>
+      </property>
+      <item>
+       <layout class="QGridLayout" name="geoGroupLayout">
+        <property name="margin">
+         <number>5</number>
+        </property>
+        <property name="spacing">
+         <number>4</number>
+        </property>
+        <item row="0" column="0">
+         <widget class="QLabel" name="xposLabel">
+          <property name="text">
+           <string>&X-Pos:</string>
+          </property>
+         </widget>
+        </item>
+        <item row="0" column="1">
+         <widget class="ScrSpinBox" name="xposSpin">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+         </widget>
+        </item>
+        <item row="2" column="0">
+         <widget class="QLabel" name="widthLabel">
+          <property name="text">
+           <string>&Width:</string>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="0">
+         <widget class="QLabel" name="yposLabel">
+          <property name="text">
+           <string>&Y-Pos:</string>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="1">
+         <widget class="ScrSpinBox" name="yposSpin"/>
+        </item>
+        <item row="2" column="1">
+         <widget class="ScrSpinBox" name="widthSpin"/>
+        </item>
+        <item row="3" column="0">
+         <widget class="QLabel" name="heightLabel">
+          <property name="text">
+           <string>&Height:</string>
+          </property>
+         </widget>
+        </item>
+        <item row="3" column="1">
+         <widget class="ScrSpinBox" name="heightSpin"/>
+        </item>
+        <item row="4" column="0">
+         <widget class="QLabel" name="rotationLabel">
+          <property name="text">
+           <string>&Rotation:</string>
+          </property>
+         </widget>
+        </item>
+        <item row="4" column="1">
+         <widget class="ScrSpinBox" name="rotationSpin">
+          <property name="wrapping">
+           <bool>true</bool>
+          </property>
+         </widget>
+        </item>
+        <item row="5" column="0">
+         <widget class="QLabel" name="basepointLabel">
+          <property name="text">
+           <string>Basepoint:</string>
+          </property>
+         </widget>
+        </item>
+        <item row="5" column="1">
+         <widget class="BasePointWidget" name="basePointWidget" native="true"/>
+        </item>
+        <item row="2" column="2" rowspan="2">
+         <widget class="LinkButton" name="keepFrameWHRatioButton">
+          <property name="maximumSize">
+           <size>
+            <width>15</width>
+            <height>32767</height>
+           </size>
+          </property>
+          <property name="text">
+           <string>...</string>
+          </property>
+          <property name="checkable">
+           <bool>true</bool>
+          </property>
+          <property name="autoRaise">
+           <bool>true</bool>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_2">
+     <item>
+      <widget class="QGroupBox" name="levelGroup">
+       <property name="title">
+        <string>Level</string>
+       </property>
+       <layout class="QGridLayout" name="gridLayout">
+        <property name="margin">
+         <number>5</number>
+        </property>
+        <property name="spacing">
+         <number>4</number>
+        </property>
+        <item row="0" column="0">
+         <widget class="QToolButton" name="levelUp">
+          <property name="maximumSize">
+           <size>
+            <width>22</width>
+            <height>22</height>
+           </size>
+          </property>
+          <property name="text">
+           <string/>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="0">
+         <widget class="QToolButton" name="levelDown">
+          <property name="maximumSize">
+           <size>
+            <width>22</width>
+            <height>22</height>
+           </size>
+          </property>
+          <property name="text">
+           <string/>
+          </property>
+         </widget>
+        </item>
+        <item row="0" column="1">
+         <widget class="QToolButton" name="levelTop">
+          <property name="maximumSize">
+           <size>
+            <width>22</width>
+            <height>22</height>
+           </size>
+          </property>
+          <property name="text">
+           <string/>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="1">
+         <widget class="QToolButton" name="levelBottom">
+          <property name="maximumSize">
+           <size>
+            <width>22</width>
+            <height>22</height>
+           </size>
+          </property>
+          <property name="text">
+           <string/>
+          </property>
+         </widget>
+        </item>
+        <item row="0" column="2" rowspan="2">
+         <widget class="QLabel" name="levelLabel">
+          <property name="text">
+           <string>0</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </widget>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <layout class="QGridLayout" name="gridLayout_2">
+       <item row="0" column="0">
+        <widget class="QToolButton" name="doGroup">
+         <property name="text">
+          <string/>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="0">
+        <widget class="QToolButton" name="doUnGroup">
+         <property name="text">
+          <string/>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="1">
+        <widget class="QToolButton" name="flipH">
+         <property name="text">
+          <string/>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="1">
+        <widget class="QToolButton" name="flipV">
+         <property name="text">
+          <string/>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="2">
+        <widget class="QToolButton" name="doLock">
+         <property name="text">
+          <string/>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="2">
+        <widget class="QToolButton" name="noPrint">
+         <property name="text">
+          <string/>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="3">
+        <widget class="QToolButton" name="noResize">
+         <property name="text">
+          <string/>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_3">
+     <item>
+      <widget class="QToolButton" name="buttonEditWeldPoint">
+       <property name="text">
+        <string>Edit Weld Point</string>
+       </property>
+       <property name="checkable">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer_2">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>40</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>NameWidget</class>
+   <extends>QLineEdit</extends>
+   <header>ui/propertiespalette_utils.h</header>
+  </customwidget>
+  <customwidget>
+   <class>ScrSpinBox</class>
+   <extends>QDoubleSpinBox</extends>
+   <header>ui/scrspinbox.h</header>
+  </customwidget>
+  <customwidget>
+   <class>BasePointWidget</class>
+   <extends>QWidget</extends>
+   <header>ui/basepointwidget.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>LinkButton</class>
+   <extends>QToolButton</extends>
+   <header>ui/linkbutton.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>




More information about the scribus-commit mailing list