View Issue Details

IDProjectCategoryView StatusLast Update
0010324ScribusUsabilitypublic2013-01-08 07:25
Reportercezaryece Assigned Tofschmid  
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status closedResolutionfixed 
Product Version1.5.0svn 
Fixed in Version1.5.0svn 
Summary0010324: [new feature patch] welding page items
DescriptionAttached patch provide new feature for Scribus 1.5 - welding page items one to other. Welding make items move together, so "child" and "master" are always like connected in "welding" point.
They are still separate not grouped items - each is selectable, editable, resizeable. Only when weld point changes his XY position than each welded to that point item also change his position.
In addition welding point is lightly indicated when item is selected.

This feature opens way for creating caption frames or footnotes frames (and that is why I need this feature in code).
It can be enhanced (and should be) by other possibilities like welding to page urgent points (edge of page, page margins, page bleeds) so while changing document format welded page items can be placed in properly way automatically. Also nice UI in Properties Palette is expected, as now in this patch I provide only 4 most used menu entries, but in fact each page item has 9 possible welding points and can be welded to 9 such points of other item (81 cases).
TagsNo tags attached.
Patch

Activities

cezaryece

2011-10-16 14:54

updater  

welding.patch (20,002 bytes)   
Index: Scribus/scribus/canvasmode.cpp
===================================================================
--- Scribus/scribus/canvasmode.cpp	(wersja 16905)
+++ Scribus/scribus/canvasmode.cpp	(kopia robocza)
@@ -369,6 +369,23 @@
 					psx->drawRect(QRectF(x, y+h-markWidth, markWidth, markWidth));
 				}
 			}
+			if (currItem->isWeld())
+			{
+				//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();
 		}
Index: Scribus/scribus/scribusdoc.cpp
===================================================================
--- Scribus/scribus/scribusdoc.cpp	(wersja 16905)
+++ Scribus/scribus/scribusdoc.cpp	(kopia robocza)
@@ -4742,6 +4742,16 @@
 	return ret;
 }
 
+PageItem* ScribusDoc::getItemFromName(QString name)
+{
+	for (int a = 0; a < Items->count(); ++a)
+	{
+		if (Items->at(a)->itemName() == name)
+		{
+			return Items->at(a);
+		}
+	}
+}
 
 void ScribusDoc::updateFrameItems()
 {
@@ -14267,4 +14277,35 @@
 		pp->setYOffset(scratch()->Top);
 	}
 }
+void ScribusDoc::itemSelection_UnWeld()
+{
+	PageItem *currItem;
+	for (uint a = 0; a < m_Selection->count(); ++a)
+	{
+		currItem = m_Selection->itemAt(a);
+		if (currItem->isWeld())
+			currItem->unWeldFromMaster(true);
+	}
+}
 
+void ScribusDoc::itemsWeld(WeldPoint p1, WeldPoint p2)
+{
+	if (m_Selection->count() != 2)
+		return;
+	PageItem * master = m_Selection->itemAt(1);
+	PageItem * selItem = m_Selection->itemAt(0);;
+	if (selItem->isWeld())
+		selItem->unWeldFromMaster(true);
+	selItem->weldTo(master, p1, p2);
+	changed();
+	m_ScMW->HaveNewSel(m_Selection->itemAt(0)->itemType());
+	for (int i = 0; i < m_Selection->count(); ++i)
+	{
+		setRedrawBounding(m_Selection->itemAt(i));
+		m_Selection->itemAt(i)->invalidateLayout();
+	}
+	regionsChanged()->update(QRectF());
+	m_Selection->clear();
+	m_Selection->addItem(selItem);
+}
+
Index: Scribus/scribus/pageitem.h
===================================================================
--- Scribus/scribus/pageitem.h	(wersja 16905)
+++ Scribus/scribus/pageitem.h	(kopia robocza)
@@ -76,7 +76,6 @@
 class PageItem_LatexFrame;
 class PageItem_Spiral;
 class PageItem_Symbol;
-
 /**
   *@author Franz Schmid
   */
@@ -84,6 +83,19 @@
 #if defined(_MSC_VER)
 #define _unlink unlink
 #endif
+typedef enum
+{
+	noneWeld = 0,
+	topLeft = 1,
+	topCenter = 2,
+	topRight = 3,
+	centerLeft = 4,
+	centerCenter = 5,
+	centerRight = 6,
+	bottomLeft = 7,
+	bottomCenter = 8,
+	bottomRight = 9
+} WeldPoint;
 
 class SCRIBUS_API PageItem : public QObject, public UndoObject, public SaxIO, public SingleObservable<PageItem>
 {
@@ -242,9 +254,13 @@
 	{
 		if (tempImageFile != NULL)
 			delete tempImageFile;
+		if (isWeld())
+			unWeldFromMaster(true);
+		if (isMasterWeld())
+			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 +268,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 +1579,29 @@
 	//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:
+	WeldPoint myWeldPoint;
+	WeldPoint masterWeldPoint;
+private:
+	PageItem* masterWeld;
+	QList<PageItem*> weldList;
+	void moveWelded(double DX, double DY, PageItem* except = NULL);
+	void moveWelded(PageItem* except = NULL);
+	void moveMasterToMe(double DX, double DY, PageItem* except = NULL);
+public:
+	bool isWhileWeldingMove;
+	PageItem* weldedWithMaster() { return masterWeld; } //pointer to item to which current item is welded
+	bool isWeld() {return (masterWeld != NULL); }  //true if item is welded to some other item
+	bool isMasterWeld()  {return !weldList.isEmpty(); }  //true if to this item some other items are welded (weldList is list of these items)
+	void weldTo(PageItem* pIt, WeldPoint myWP=noneWeld, WeldPoint masterWP= noneWeld);
+	void unWeldFromMaster(bool updateMaster = false);
+	void unWeldChild(PageItem* = NULL, bool updateMaster = false); //unweld child or all child if NULL is passed
+	void moveToWeld(PageItem* except = NULL, PageItem* master = NULL);  //move welded items as current item moves, if master move master
+	void addWelded(PageItem* iPt) { weldList.append(iPt); }
 };
 
-Q_DECLARE_METATYPE(PageItem*);
+Q_DECLARE_METATYPE(PageItem*)
 
 #endif
Index: Scribus/scribus/pageitem.cpp
===================================================================
--- Scribus/scribus/pageitem.cpp	(wersja 16905)
+++ Scribus/scribus/pageitem.cpp	(kopia robocza)
@@ -354,6 +354,8 @@
 		tempImageFile = NULL;
 		isInlineImage = false;
 	}
+	unWeldFromMaster();
+	unWeldChild();
 }
 
 
@@ -519,6 +521,9 @@
 	m_PrintEnabled = true;
 	isBookmark = false;
 	m_isAnnotation = false;
+
+	unWeldFromMaster();
+	unWeldChild();
 	
 	switch (m_ItemType)
 	{
@@ -865,6 +870,10 @@
 	if (drawingOnly || m_Doc->isLoading())
 		return;
 	checkChanges();
+	if (isMasterWeld())
+		moveWelded(dX, dY);
+	if (isWeld())
+		moveMasterToMe(dX, dY, this);
 }
 
 void PageItem::setWidth(const double newWidth)
@@ -917,6 +926,10 @@
 	if (m_Doc->isLoading())
 		return;
 	checkChanges();
+	if (isMasterWeld())
+		moveToWeld();
+	if (isWeld())
+		weldedWithMaster()->moveToWeld(this, this);
 }
 
 void PageItem::setRotation(const double newRotation, bool drawingOnly)
@@ -6989,6 +7002,10 @@
 		break;
 	}
 	updateGradientVectors();
+	if (isMasterWeld())
+		moveWelded();
+	if (isWeld())
+		moveToWeld();
 }
 
 QString PageItem::infoDescription()
@@ -7062,3 +7079,115 @@
 		tempImageFile = NULL;
 	}
 }
+
+//welded frames
+void PageItem::weldTo(PageItem* pIt, WeldPoint myWP, WeldPoint masterWP)
+{
+	masterWeld = pIt;
+	pIt->addWelded(this);
+	if (myWP != noneWeld)
+		myWeldPoint = myWP;
+	if (masterWP != noneWeld)
+		masterWeldPoint = masterWP;
+	moveToWeld();
+	update();
+	pIt->update();
+}
+
+void PageItem::moveToWeld(PageItem* except, PageItem* master)  //move welded items as current item moves
+{
+	if (master == NULL)
+		master = weldedWithMaster();
+	double newX = master->xPos(), newY = master->yPos();
+	double DX = 0.0, DY = 0.0;
+
+	if (masterWeldPoint == topCenter || masterWeldPoint == centerCenter || masterWeldPoint == bottomCenter)
+		newX += master->width() /2;
+	else if (masterWeldPoint == topRight  || masterWeldPoint == centerRight || masterWeldPoint == bottomRight)
+		newX += master->width();
+
+	if (masterWeldPoint == centerLeft  || masterWeldPoint == centerCenter || masterWeldPoint == centerRight)
+		newY += master->height() /2;
+	else if (masterWeldPoint == bottomLeft  || masterWeldPoint == bottomCenter || masterWeldPoint == bottomRight)
+		newY += master->height();
+
+	if (myWeldPoint == topCenter || myWeldPoint == centerCenter || myWeldPoint == bottomCenter)
+		newX -= width() /2;
+	else if (myWeldPoint == topRight  || myWeldPoint == centerRight || myWeldPoint == bottomRight)
+		newX -= width();
+
+	if (myWeldPoint == centerLeft  || myWeldPoint == centerCenter || myWeldPoint == centerRight)
+		newY -= height() /2;
+	else if (myWeldPoint == bottomLeft  || myWeldPoint == bottomCenter || myWeldPoint == bottomRight)
+		newY -= height();
+	DX = xPos() - newX;
+	DY = yPos() - newY;
+	setXPos(newX);
+	setYPos(newY);
+	if (isMasterWeld())
+		moveWelded(DX, DY, except);
+}
+
+void PageItem::moveMasterToMe(double DX, double DY, PageItem* except)
+{
+	PageItem* master = weldedWithMaster();
+	master->setXPos(master->xPos() + DX);
+	master->setYPos(master->yPos() + DY);
+	if (master->isWeld())
+		master->moveMasterToMe(DX, DY, master);
+	master->moveWelded(DX, DY, this);
+}
+
+void PageItem::moveWelded(double DX, double DY, PageItem* except)
+{
+	for (int i =0 ; i < weldList.length(); i++)
+	{
+		PageItem* pIt = weldList.at(i);
+		if (pIt != except)
+		{
+			pIt->setXPos(pIt->xPos() + DX);
+			pIt->setYPos(pIt->yPos() + DY);
+			if (pIt->isMasterWeld())
+				pIt->moveWelded(DX, DY);
+		}
+	}
+}
+
+void PageItem::moveWelded(PageItem* except)
+{
+	for (int i =0 ; i < weldList.length(); i++)
+	{
+		PageItem* pIt = weldList.at(i);
+		if (pIt != except)
+		{
+			pIt->moveToWeld(except);
+			if (pIt->isMasterWeld())
+				pIt->moveWelded(except);
+		}
+	}
+}
+
+void PageItem::unWeldFromMaster(bool updateMaster)
+{
+	myWeldPoint = noneWeld;
+	masterWeldPoint = noneWeld;
+	if (updateMaster)
+		masterWeld->unWeldChild(this);
+	masterWeld = NULL;
+}
+
+void PageItem::unWeldChild(PageItem* child, bool updateMaster)
+{
+	if (child == NULL)
+	{
+		while (!weldList.isEmpty())
+			unWeldChild(weldList.at(0), updateMaster);
+	}
+	else
+	{
+		child->unWeldFromMaster(updateMaster);
+		if (!weldList.isEmpty() && weldList.contains(child))
+			weldList.removeOne(child);
+	}
+}
+
Index: Scribus/scribus/scribusdoc.h
===================================================================
--- Scribus/scribus/scribusdoc.h	(wersja 16905)
+++ Scribus/scribus/scribusdoc.h	(kopia robocza)
@@ -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,15 @@
 	void updatePict(QString name);
 	void updatePictDir(QString name);
 	void removePict(QString name);
+//welding two items
+public slots:
+	void itemSelection_UnWeld();
+	void itemsWeld17() {itemsWeld((WeldPoint) 1, (WeldPoint) 7); }
+	void itemsWeld71() {itemsWeld((WeldPoint) 7, (WeldPoint) 1); }
+	void itemsWeld31() {itemsWeld((WeldPoint) 3, (WeldPoint) 1); }
+	void itemsWeld13() {itemsWeld((WeldPoint) 1, (WeldPoint) 3); }
+private:
+	void itemsWeld(WeldPoint p1, WeldPoint p2);
 };
 
 Q_DECLARE_METATYPE(ScribusDoc*);
Index: Scribus/scribus/actionmanager.cpp
===================================================================
--- Scribus/scribus/actionmanager.cpp	(wersja 16905)
+++ Scribus/scribus/actionmanager.cpp	(kopia robocza)
@@ -506,6 +506,17 @@
 	name="itemConvertToTextFrame";
 	scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
 
+	name="itemsUnWeld";
+	scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
+	name="itemWeld71";
+	scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
+	name="itemWeld17";
+	scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
+	name="itemWeld31";
+	scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
+	name="itemWeld13";
+	scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
+
 	connect( (*scrActions)["itemDuplicate"], SIGNAL(triggered()), mainWindow, SLOT(duplicateItem()) );
 	connect( (*scrActions)["itemMulDuplicate"], SIGNAL(triggered()), mainWindow, SLOT(duplicateItemMulti()) );
 	connect( (*scrActions)["itemTransform"], SIGNAL(triggered()), mainWindow, SLOT(slotItemTransform()) );
@@ -1109,7 +1120,13 @@
 	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)["itemWeld17"], 0, 0, 0);
+	disconnect( (*scrActions)["itemWeld71"], 0, 0, 0);
+	disconnect( (*scrActions)["itemWeld31"], 0, 0, 0);
+	disconnect( (*scrActions)["itemWeld13"], 0, 0, 0);
 
+
 }
 
 void ActionManager::connectNewDocActions(ScribusDoc *currDoc)
@@ -1141,6 +1158,12 @@
 	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)["itemWeld17"], SIGNAL(triggered()), currDoc, SLOT(itemsWeld17()) );
+	connect( (*scrActions)["itemWeld71"], SIGNAL(triggered()), currDoc, SLOT(itemsWeld71()) );
+	connect( (*scrActions)["itemWeld31"], SIGNAL(triggered()), currDoc, SLOT(itemsWeld31()) );
+	connect( (*scrActions)["itemWeld13"], SIGNAL(triggered()), currDoc, SLOT(itemsWeld13()) );
+
 }
 
 void ActionManager::disconnectNewViewActions()
@@ -1463,6 +1486,11 @@
 	(*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)["itemWeld17"]->setTexts( tr("Weld top/left to bottom/left"));
+	(*scrActions)["itemWeld71"]->setTexts( tr("Weld bottom/left to top/left"));
+	(*scrActions)["itemWeld31"]->setTexts( tr("Weld top/right to top/left"));
+	(*scrActions)["itemWeld13"]->setTexts( tr("Weld top/left to top/right"));
 
 	//Insert Menu
 	(*scrActions)["insertFrame"]->setTexts( tr("&Frames..."));
@@ -1939,7 +1967,12 @@
 		<< "itemAttachTextToPath" 
 		<< "itemDetachTextFromPath" 
 		<< "itemCombinePolygons" 
-		<< "itemSplitPolygons";
+		<< "itemSplitPolygons"
+		<< "itemsUnWeld"
+		<< "itemWeld17"
+		<< "itemWeld71"
+		<< "itemWeld31"
+		<< "itemWeld13";
 	//Insert
 	++itmenu;
 	itmenu->second
Index: Scribus/scribus/ui/contextmenu.cpp
===================================================================
--- Scribus/scribus/ui/contextmenu.cpp	(wersja 16905)
+++ Scribus/scribus/ui/contextmenu.cpp	(kopia robocza)
@@ -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 (uint a = 0; a < m_Sel.count(); ++a)
+		{
+			currItem = m_Sel.itemAt(a);
+			if (currItem->isWeld())
+			{
+				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"]);
Index: Scribus/scribus/scribus.cpp
===================================================================
--- Scribus/scribus/scribus.cpp	(wersja 16905)
+++ Scribus/scribus/scribus.cpp	(kopia robocza)
@@ -829,6 +829,13 @@
 	scrActions["itemPrintingEnabled"]->setEnabled(false);
 	scrMenuMgr->setMenuEnabled("ItemConvertTo", false);
 
+	scrMenuMgr->addMenuItem(scrActions["itemsUnWeld"], "Item", true);
+	scrMenuMgr->createMenu("ItemWeld", tr("Weld To Last"), "Item");
+	scrMenuMgr->addMenuItem(scrActions["itemWeld17"], "ItemWeld", true);
+	scrMenuMgr->addMenuItem(scrActions["itemWeld71"], "ItemWeld", true);
+	scrMenuMgr->addMenuItem(scrActions["itemWeld31"], "ItemWeld", true);
+	scrMenuMgr->addMenuItem(scrActions["itemWeld13"], "ItemWeld", true);
+	scrMenuMgr->setMenuEnabled("ItemWeld", false);
 
 	//Insert menu
 	scrMenuMgr->createMenu("Insert", ActionManager::defaultMenuNameEntryTranslated("Insert"));
@@ -3032,6 +3039,7 @@
 	propertiesPalette->xyzPal->basePointWidget->setCheckedId(doc->RotMode());
 	if (docSelectionCount > 1)
 	{
+		scrMenuMgr->setMenuEnabled("ItemWeld", true);
 		if (!doc->m_Selection->itemsAreSameType())
 		{
 			scrActions["itemConvertToBezierCurve"]->setEnabled(false);
Index: Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h
===================================================================
--- Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h	(wersja 16905)
+++ Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h	(kopia robocza)
@@ -68,7 +68,7 @@
 			ItemSelectionFrame  = 2,
 			ItemSelectionPattern= 3,
 			ItemSelectionGroup  = 4,
-			ItemSelectionElements = 5,
+			ItemSelectionElements = 5
 		};
 
 		class ItemInfo
@@ -160,6 +160,8 @@
 		QMap<int, int> itemRemapM;
 		QMap<int, int> itemNextM;
 
+		QMap<PageItem*, QString> itemsWeld;  //item* and master name
+
 		int itemCount;
 		int itemCountM;
 		bool layerFound;
Index: Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
===================================================================
--- Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp	(wersja 16905)
+++ Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp	(kopia robocza)
@@ -1860,7 +1860,15 @@
 			}
 			docu.writeEndElement();
 		}
-
+		//write weld parameter
+		if (item->isWeld())
+		{
+			docu.writeStartElement("WELD");
+			docu.writeAttribute("Master", item->weldedWithMaster()->getUName());
+			docu.writeAttribute("masterWP", item->masterWeldPoint);
+			docu.writeAttribute("myWP", item->myWeldPoint);
+			docu.writeEndElement();
+		}
 		docu.writeEndElement();
 	}
 }
Index: Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
===================================================================
--- Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp	(wersja 16905)
+++ Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp	(kopia robocza)
@@ -43,6 +43,7 @@
 #include <QApplication>
 
 
+
 // See scplugin.h and pluginmanager.{cpp,h} for detail on what these methods
 // do. That documentatation is not duplicated here.
 // Please don't implement the functionality of your plugin here; do that
@@ -1449,6 +1450,22 @@
 			gItem->groupItemList = gpL;
 		}
 	}
+	if (itemsWeld.count() > 0)
+	{
+		QMap<PageItem*,QString>::Iterator weld;
+		for (weld = itemsWeld.begin(); weld != itemsWeld.end(); ++weld)
+		{
+			QString itemName = weld.value();
+			if (m_Doc->itemNameExists(itemName))
+			{
+				PageItem* master = m_Doc->getItemFromName(itemName);
+				PageItem* item = weld.key();
+				item->weldTo(master, item->myWeldPoint, item->masterWeldPoint);
+			}
+			else
+				qDebug() << "Item welded to non-exited item name";
+		}
+	}
 	m_Doc->renumberItemsInListOrder();
 	
 	// reestablish first/lastAuto
@@ -2900,6 +2917,12 @@
 				doc->Items = DItems;
 			}
 		}
+		if (tName == "WELD")
+		{
+			newItem->masterWeldPoint = (WeldPoint) tAtt.valueAsInt("masterWP");
+			newItem->myWeldPoint = (WeldPoint) tAtt.valueAsInt("myWP");
+			itemsWeld.insert(newItem,tAtt.valueAsString("Master"));
+		}
 	}
 	delete lastStyle;
 
welding.patch (20,002 bytes)   

cezaryece

2011-10-16 20:16

updater   ~0027025

I hope this feature will not wait weeks for rewiev.
I am waiting for it for making further work on footnotes. I need frames for footnotes would be welded with frames with main text.
Also welding feature has some common parts of code with my markers in text solution and footnotes are on these markers idea build. So, I have issue of "cross reference" in new code and have to have one part committed for working on next part.

cbradney

2011-11-08 21:17

administrator   ~0027170

Cezary, you mentioned on the mailing list that some of the changes Franz made when implementing this removed features or broke things. Please either describe them in detail or submit new patches to add that in.

cezaryece

2011-11-14 10:41

updater   ~0027191

Last changes makes things better, but I still think my way is better for user in most cases. Franz way is more powerful, but my way is easier.
What we can do with that what we have now?
Welding points are snapping to corners and centers of frames - VERY GOOD.
But when you move welded items then any snap helps in precisely placing them one to other.
Making fixed items shift is very hard (I mean for example making 4 points space between items) - all is in user`s hand.
Moving welding point and welding items should also work with Ctrl key modifier and with arrow keys for move only in one direction.
While editing welding point clicking somewhere should move it - not only by drag it.
For me creating separate dialog window with choose what is edited is not so flexible as making SHIFT as modifier key for switching between editing mode.
And I still vote for "welding presets" for most popular welding settings - it can be placed as next tab in Align & Distribute window (if not as new tab in Properties Palette).
And "Weld Items" checkbox or button in Align tab.

ale

2012-06-18 19:52

manager   ~0028195

cezary, could you please split the propositions in individual feature requests?

welding items are in 1.5svn and i think that it would be better to close this "general" feature request... IMO easier to track...

ale

2012-10-28 09:59

manager   ~0029111

i suggest to close this and further issue with the welded items patch belong to new tickets...

cezaryece

2013-01-08 07:25

updater   ~0029656

Feature merged in trunk.

Issue History

Date Modified Username Field Change
2011-10-16 14:54 cezaryece New Issue
2011-10-16 14:54 cezaryece File Added: welding.patch
2011-10-16 20:16 cezaryece Note Added: 0027025
2011-10-22 06:40 fschmid Assigned To => fschmid
2011-10-22 06:40 fschmid Status new => assigned
2011-10-23 19:49 fschmid Status assigned => resolved
2011-10-23 19:49 fschmid Fixed in Version => 1.5.0svn
2011-10-23 19:49 fschmid Resolution open => fixed
2011-11-08 21:17 cbradney Note Added: 0027170
2011-11-08 21:17 cbradney Status resolved => feedback
2011-11-08 21:17 cbradney Resolution fixed => reopened
2011-11-14 10:41 cezaryece Note Added: 0027191
2011-11-14 10:41 cezaryece Status feedback => assigned
2012-06-18 19:52 ale Note Added: 0028195
2012-10-28 09:59 ale Note Added: 0029111
2013-01-08 07:25 cezaryece Note Added: 0029656
2013-01-08 07:25 cezaryece Status assigned => closed
2013-01-08 07:25 cezaryece Resolution reopened => fixed