r15661 by jghali - - make shape edit work again in PP shape and group tab

scribus-commit scribus-commit at lists.scribus.net
Wed Oct 27 17:14:42 CEST 2010


Author: jghali
Date: Wed Oct 27 15:14:42 2010
New Revision: 15661

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=15661
Log:
- make shape edit work again in PP shape and group tab
- some cleanup

Modified:
    branches/ScribusOIF/scribus/scribus.cpp
    branches/ScribusOIF/scribus/ui/cpalette.cpp
    branches/ScribusOIF/scribus/ui/cpalette.h
    branches/ScribusOIF/scribus/ui/nodeeditpalette.cpp
    branches/ScribusOIF/scribus/ui/nodeeditpalette.h
    branches/ScribusOIF/scribus/ui/propertiespalette.cpp
    branches/ScribusOIF/scribus/ui/propertiespalette.h
    branches/ScribusOIF/scribus/ui/propertiespalette_group.cpp
    branches/ScribusOIF/scribus/ui/propertiespalette_group.h
    branches/ScribusOIF/scribus/ui/propertiespalette_shape.cpp
    branches/ScribusOIF/scribus/ui/propertiespalette_shape.h
    branches/ScribusOIF/scribus/ui/scrapbookpalette.h
    branches/ScribusOIF/scribus/ui/transparencypalette.cpp
    branches/ScribusOIF/scribus/ui/transparencypalette.h

Modified: branches/ScribusOIF/scribus/scribus.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15661&path=/branches/ScribusOIF/scribus/scribus.cpp
==============================================================================
--- branches/ScribusOIF/scribus/scribus.cpp (original)
+++ branches/ScribusOIF/scribus/scribus.cpp Wed Oct 27 15:14:42 2010
@@ -560,8 +560,8 @@
 	connect(propertiesPalette->textPal->paraStyleCombo, SIGNAL(newStyle(const QString&)), this, SLOT(setNewParStyle(const QString&)));
 	connect(propertiesPalette->textPal->charStyleCombo, SIGNAL(newStyle(const QString&)), this, SLOT(setNewCharStyle(const QString&)));
 //	connect(propertiesPalette, SIGNAL(EditLSt()), this, SLOT(slotEditLineStyles()));
-	connect(nodePalette, SIGNAL(Schliessen()), propertiesPalette, SLOT(endEdit2()));
-	connect(nodePalette, SIGNAL(Schliessen()), this, SLOT(slotSelect()));
+//	connect(nodePalette, SIGNAL(paletteClosed()), propertiesPalette, SLOT(endEdit2()));
+	connect(nodePalette, SIGNAL(paletteClosed()), this, SLOT(slotSelect()));
 	connect(nodePalette, SIGNAL(DocChanged()), this, SLOT(slotDocCh()));
 	connect(layerPalette, SIGNAL(LayerChanged()), this, SLOT(showLayer()));
 

Modified: branches/ScribusOIF/scribus/ui/cpalette.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15661&path=/branches/ScribusOIF/scribus/ui/cpalette.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/cpalette.cpp (original)
+++ branches/ScribusOIF/scribus/ui/cpalette.cpp Wed Oct 27 15:14:42 2010
@@ -137,6 +137,19 @@
 
 void Cpalette::setDocument(ScribusDoc* doc)
 {
+	disconnect(this, SIGNAL(NewPen(QString)), 0, 0);
+	disconnect(this, SIGNAL(NewBrush(QString)), 0, 0);
+	disconnect(this, SIGNAL(NewPenShade(int)), 0, 0);
+	disconnect(this, SIGNAL(NewBrushShade(int)), 0, 0);
+	disconnect(this, SIGNAL(NewGradient(int)), 0, 0);
+	disconnect(this, SIGNAL(NewGradientS(int)), 0, 0);
+	disconnect(this, SIGNAL(NewPattern(QString)), 0, 0);
+	disconnect(this, SIGNAL(NewPatternProps(double, double, double, double, double, double, double, bool, bool)), 0, 0);
+	disconnect(this, SIGNAL(NewOverprint(int)), 0, 0);
+	disconnect(this, SIGNAL(NewPatternS(QString)), 0, 0);
+	disconnect(this, SIGNAL(NewPatternTypeS(bool)), 0, 0);
+	disconnect(this, SIGNAL(NewPatternPropsS(double, double, double, double, double, double, double, double, bool, bool)), 0, 0);
+
 	currentDoc = doc;
 	if (doc == NULL)
 	{
@@ -149,6 +162,21 @@
 		colorListFill->cList = &doc->PageColors;
 		gradEdit->setColors(doc->PageColors);
 		currentUnit = doc->unitIndex();
+
+		updateColorList();
+
+		connect(this, SIGNAL(NewPen(QString))      , doc, SLOT(itemSelection_SetItemPen(QString)));
+		connect(this, SIGNAL(NewBrush(QString))    , doc, SLOT(itemSelection_SetItemBrush(QString)));
+		connect(this, SIGNAL(NewPenShade(int))     , doc, SLOT(itemSelection_SetItemPenShade(int)));
+		connect(this, SIGNAL(NewBrushShade(int))   , doc, SLOT(itemSelection_SetItemBrushShade(int)));
+		connect(this, SIGNAL(NewGradient(int))     , doc, SLOT(itemSelection_SetItemGradFill(int)));
+		connect(this, SIGNAL(NewGradientS(int))    , doc, SLOT(itemSelection_SetItemGradStroke(int)));
+		connect(this, SIGNAL(NewPattern(QString))  , doc, SLOT(itemSelection_SetItemPatternFill(QString)));
+		connect(this, SIGNAL(NewPatternProps(double, double, double, double, double, double, double, bool, bool)), doc, SLOT(itemSelection_SetItemPatternProps(double, double, double, double, double, double, double, bool, bool)));
+		connect(this, SIGNAL(NewOverprint(int))    , this, SLOT(handleOverprint(int)));
+		connect(this, SIGNAL(NewPatternS(QString)) , doc, SLOT(itemSelection_SetItemStrokePattern(QString)));
+		connect(this, SIGNAL(NewPatternTypeS(bool)), doc, SLOT(itemSelection_SetItemStrokePatternType(bool)));
+		connect(this, SIGNAL(NewPatternPropsS(double, double, double, double, double, double, double, double, bool, bool)), doc, SLOT(itemSelection_SetItemStrokePatternProps(double, double, double, double, double, double, double, double, bool, bool)));
 	}
 }
 
@@ -259,6 +287,16 @@
 	connect(transparencyMeshPoint, SIGNAL(valueChanged(int)), this, SLOT(updateMeshPoint()));
 }
 
+void Cpalette::updateColorList()
+{
+	if (currentDoc)
+	{
+		this->SetColors(currentDoc->PageColors);
+		this->SetPatterns(&currentDoc->docPatterns);
+		this->SetGradients(&currentDoc->docGradients);
+	}
+}
+
 void Cpalette::updateCList()
 {
 	disconnect(colorListStroke, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(selectColorS(QListWidgetItem*)));
@@ -305,6 +343,17 @@
 	disconnect(overPrintCombo, SIGNAL(activated(int)), this, SIGNAL(NewOverprint(int)));
 	overPrintCombo->setCurrentIndex(val);
 	connect(overPrintCombo, SIGNAL(activated(int)), this, SIGNAL(NewOverprint(int)));
+}
+
+void Cpalette::handleOverprint(int val)
+{
+	if (currentDoc)
+	{
+		bool setter = true;
+		if (val == 0)
+			setter = false;
+		currentDoc->itemSelection_SetOverprint(setter);
+	}
 }
 
 void Cpalette::setActFarben(QString p, QString b, int shp, int shb)

Modified: branches/ScribusOIF/scribus/ui/cpalette.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15661&path=/branches/ScribusOIF/scribus/ui/cpalette.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/cpalette.h (original)
+++ branches/ScribusOIF/scribus/ui/cpalette.h Wed Oct 27 15:14:42 2010
@@ -63,11 +63,14 @@
 	void setCurrentItem(PageItem* item);
 	void updateFromItem();
 
+	void updateColorList();
+
 public slots:
 	void editLineColorSelectorButton();
 	void editFillColorSelectorButton();
 	void SetColors(ColorList newColorList);
 	void setActOverprint(int);
+	void handleOverprint(int);
 	void updateCList();
 	void ToggleColorDisplay();
 	void SetPatterns(QMap<QString, ScPattern> *docPatterns);

Modified: branches/ScribusOIF/scribus/ui/nodeeditpalette.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15661&path=/branches/ScribusOIF/scribus/ui/nodeeditpalette.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/nodeeditpalette.cpp (original)
+++ branches/ScribusOIF/scribus/ui/nodeeditpalette.cpp Wed Oct 27 15:14:42 2010
@@ -859,7 +859,7 @@
 	}
 	PolySplit->setEnabled( false );
 	BezierClose->setEnabled( false );
-	emit Schliessen();
+	emit paletteClosed();
 	ScrPaletteBase::closeEvent(ce);
 }
 
@@ -879,7 +879,7 @@
 	PolySplit->setEnabled( false );
 	BezierClose->setEnabled( false );
 	EditCont->setChecked(false);
-	emit Schliessen();
+	emit paletteClosed();
 }
 
 void NodePalette::changeEvent(QEvent *e)

Modified: branches/ScribusOIF/scribus/ui/nodeeditpalette.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15661&path=/branches/ScribusOIF/scribus/ui/nodeeditpalette.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/nodeeditpalette.h (original)
+++ branches/ScribusOIF/scribus/ui/nodeeditpalette.h Wed Oct 27 15:14:42 2010
@@ -132,8 +132,8 @@
 	double unitRatio;
 	
 signals:
-	void Schliessen();
 	void DocChanged();
+	void paletteClosed();
 };
 
 #endif // NODEPALETTE_H

Modified: branches/ScribusOIF/scribus/ui/propertiespalette.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15661&path=/branches/ScribusOIF/scribus/ui/propertiespalette.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertiespalette.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertiespalette.cpp Wed Oct 27 15:14:42 2010
@@ -90,8 +90,7 @@
 	HaveDoc = false;
 	HaveItem = false;
 	m_unitRatio = 1.0;
-	tmpSelection = new Selection(this, false);
-	tmpSelection->clear();
+
 	setSizePolicy( QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
 
 	MpalLayout = new QVBoxLayout( this );
@@ -197,7 +196,7 @@
 	connect(linePal, SIGNAL(lineModeChanged(int)), this, SLOT(NewLineMode(int)));
 
 	connect(groupPal, SIGNAL(shapeChanged(int)) , this, SLOT(handleNewShape(int)));
-	connect(groupPal, SIGNAL(shapeEditStarted()), this, SLOT(handleShapeEdit2()));
+	connect(groupPal, SIGNAL(shapeEditStarted()), this, SLOT(handleShapeEdit()));
 
 	connect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
 
@@ -282,27 +281,6 @@
 	if(doc == d || (m_ScMW && m_ScMW->scriptIsRunning()))
 		return;
 
-	disconnect(this->Tpal, SIGNAL(NewTrans(double)), 0, 0);
-	disconnect(this->Tpal, SIGNAL(NewTransS(double)), 0, 0);
-	disconnect(this->Tpal, SIGNAL(NewGradient(int)), 0, 0);
-	disconnect(this->Tpal, SIGNAL(NewBlend(int)), 0, 0);
-	disconnect(this->Tpal, SIGNAL(NewBlendS(int)), 0, 0);
-	disconnect(this->Tpal, SIGNAL(NewPattern(QString)), 0, 0);
-	disconnect(this->Tpal, SIGNAL(NewPatternProps(double, double, double, double, double, double, double, bool, bool)), 0, 0);
-
-	disconnect(this->Cpal, SIGNAL(NewPen(QString)), 0, 0);
-	disconnect(this->Cpal, SIGNAL(NewBrush(QString)), 0, 0);
-	disconnect(this->Cpal, SIGNAL(NewPenShade(int)), 0, 0);
-	disconnect(this->Cpal, SIGNAL(NewBrushShade(int)), 0, 0);
-	disconnect(this->Cpal, SIGNAL(NewGradient(int)), 0, 0);
-	disconnect(this->Cpal, SIGNAL(NewGradientS(int)), 0, 0);
-	disconnect(this->Cpal, SIGNAL(NewPattern(QString)), 0, 0);
-	disconnect(this->Cpal, SIGNAL(NewPatternProps(double, double, double, double, double, double, double, bool, bool)), 0, 0);
-	disconnect(this->Cpal, SIGNAL(NewOverprint(int)), 0, 0);
-	disconnect(this->Cpal, SIGNAL(NewPatternS(QString)), 0, 0);
-	disconnect(this->Cpal, SIGNAL(NewPatternTypeS(bool)), 0, 0);
-	disconnect(this->Cpal, SIGNAL(NewPatternPropsS(double, double, double, double, double, double, double, double, bool, bool)), 0, 0);
-
 	doc = d;
 	CurItem = NULL;
 	Cpal->setDocument(doc);
@@ -327,27 +305,6 @@
 	textPal->setDoc(doc);
 
 	updateColorList();
-
-	connect(this->Tpal, SIGNAL(NewTrans(double)), doc, SLOT(itemSelection_SetItemFillTransparency(double)));
-	connect(this->Tpal, SIGNAL(NewTransS(double)), doc, SLOT(itemSelection_SetItemLineTransparency(double)));
-	connect(this->Tpal, SIGNAL(NewBlend(int)), doc, SLOT(itemSelection_SetItemFillBlend(int)));
-	connect(this->Tpal, SIGNAL(NewBlendS(int)), doc, SLOT(itemSelection_SetItemLineBlend(int)));
-	connect(this->Tpal, SIGNAL(NewGradient(int)), doc, SLOT(itemSelection_SetItemGradMask(int)));
-	connect(this->Tpal, SIGNAL(NewPattern(QString)), doc, SLOT(itemSelection_SetItemPatternMask(QString)));
-	connect(this->Tpal, SIGNAL(NewPatternProps(double, double, double, double, double, double, double, bool, bool)), doc, SLOT(itemSelection_SetItemPatternMaskProps(double, double, double, double, double, double, double, bool, bool)));
-	
-	connect(this->Cpal, SIGNAL(NewPen(QString)), doc, SLOT(itemSelection_SetItemPen(QString)));
-	connect(this->Cpal, SIGNAL(NewBrush(QString)), doc, SLOT(itemSelection_SetItemBrush(QString)));
-	connect(this->Cpal, SIGNAL(NewPenShade(int)), doc, SLOT(itemSelection_SetItemPenShade(int)));
-	connect(this->Cpal, SIGNAL(NewBrushShade(int)), doc, SLOT(itemSelection_SetItemBrushShade(int)));
-	connect(this->Cpal, SIGNAL(NewGradient(int)), doc, SLOT(itemSelection_SetItemGradFill(int)));
-	connect(this->Cpal, SIGNAL(NewGradientS(int)), doc, SLOT(itemSelection_SetItemGradStroke(int)));
-	connect(this->Cpal, SIGNAL(NewPattern(QString)), doc, SLOT(itemSelection_SetItemPatternFill(QString)));
-	connect(this->Cpal, SIGNAL(NewPatternProps(double, double, double, double, double, double, double, bool, bool)), doc, SLOT(itemSelection_SetItemPatternProps(double, double, double, double, double, double, double, bool, bool)));
-	connect(this->Cpal, SIGNAL(NewOverprint(int)), this, SLOT(handleOverprint(int)));
-	connect(this->Cpal, SIGNAL(NewPatternS(QString)), doc, SLOT(itemSelection_SetItemStrokePattern(QString)));
-	connect(this->Cpal, SIGNAL(NewPatternTypeS(bool)), doc, SLOT(itemSelection_SetItemStrokePatternType(bool)));
-	connect(this->Cpal, SIGNAL(NewPatternPropsS(double, double, double, double, double, double, double, double, bool, bool)), doc, SLOT(itemSelection_SetItemStrokePatternProps(double, double, double, double, double, double, double, double, bool, bool)));
 }
 
 void PropertiesPalette::unsetDoc()
@@ -904,23 +861,10 @@
 	groupPal->updateColorList();
 	textPal->updateColorList();
 
-	Cpal->SetColors(doc->PageColors);
-	Cpal->SetPatterns(&doc->docPatterns);
-	Cpal->SetGradients(&doc->docGradients);
-	Tpal->SetColors(doc->PageColors);
-	Tpal->SetPatterns(&doc->docPatterns);
-	Tpal->SetGradients(&doc->docGradients);
+	Cpal->updateColorList();
+	Tpal->updateColorList();
+
 	assert (doc->PageColors.document());
-}
-
-void PropertiesPalette::handleOverprint(int val)
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	bool setter = true;
-	if (val == 0)
-		setter = false;
-	doc->itemSelection_SetOverprint(setter);
 }
 
 bool PropertiesPalette::userActionOn()
@@ -1023,7 +967,7 @@
 	shapePal->setLocked(isLocked);
 }
 
-void PropertiesPalette::handleShapeEdit2()
+void PropertiesPalette::handleShapeEdit()
 {
 	if (!m_ScMW || m_ScMW->scriptIsRunning())
 		return;
@@ -1032,16 +976,3 @@
 		shapePal->RoundRect->setEnabled(false);
 	}
 }
-
-void PropertiesPalette::endEdit2()
-{
-	if ((HaveDoc) && (HaveItem))
-	{
-		if (tmpSelection->count() > 0)
-		{
-			doc->m_Selection->copy(*tmpSelection, false);
-			doc->m_Selection->connectItemToGUI();
-		}
-		tmpSelection->clear();
-	}
-}

Modified: branches/ScribusOIF/scribus/ui/propertiespalette.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15661&path=/branches/ScribusOIF/scribus/ui/propertiespalette.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertiespalette.h (original)
+++ branches/ScribusOIF/scribus/ui/propertiespalette.h Wed Oct 27 15:14:42 2010
@@ -110,7 +110,6 @@
 	void languageChange();
 
 	void setLocked(bool);
-	void endEdit2();
 
 private slots:
 	void SelTab(int t);
@@ -122,8 +121,7 @@
 	void toggleGradientEdit(int);
 	void NewSpGradientM(double x1, double y1, double x2, double y2, double fx, double fy, double sg, double sk);
 	void toggleGradientEditM();
-	void handleShapeEdit2();
-	void handleOverprint(int);
+	void handleShapeEdit();
 
 signals:
 	void DocChanged();
@@ -143,7 +141,6 @@
 	QVBoxLayout* pageLayout_7;
 
 	QVBoxLayout* page_group_layout;
-	QVBoxLayout* Layout1t;
 	
 	QWidget* page;
 	QWidget* page_2;
@@ -153,11 +150,6 @@
 	QWidget* page_6;
 	QWidget* page_7;
 	QWidget* page_group;
-	
-	QLabel* paraStyleLabel;
-	QLabel* langLabel;
-	QLabel* TransTxt;
-	QLabel* TransTxt2;
 
 	PageItem *CurItem;
 	bool HaveDoc;
@@ -176,7 +168,6 @@
 	int idColorsItem;
 	int idTransparencyItem;
 	int idGroupItem;
-	Selection* tmpSelection;
 };
 
 #endif

Modified: branches/ScribusOIF/scribus/ui/propertiespalette_group.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15661&path=/branches/ScribusOIF/scribus/ui/propertiespalette_group.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertiespalette_group.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertiespalette_group.cpp Wed Oct 27 15:14:42 2010
@@ -59,6 +59,7 @@
 
 #include "text/nlsconfig.h"
 #include "ui/autoform.h"
+#include "ui/nodeeditpalette.h"
 #include "ui/propertiespalette_utils.h"
 #include "ui/transparencypalette.h"
 
@@ -152,7 +153,7 @@
 	connect(textFlowOptionsB2, SIGNAL(buttonClicked(int)), this, SLOT(handleTextFlow()));
 
 	connect(SCustom2  , SIGNAL(FormSel(int, int, qreal *)), this, SLOT(handleNewShape(int, int, qreal *)));
-	connect(EditShape2, SIGNAL(clicked())                 , this, SLOT(handleShapeEdit2()));
+	connect(EditShape2, SIGNAL(clicked())                 , this, SLOT(handleShapeEdit()));
 	connect(TpalGroup , SIGNAL(editGradient())            , this, SLOT(handleGradientEdit()));
 	connect(TpalGroup , SIGNAL(NewSpecial(double, double, double, double, double, double, double, double, double, double)), this, SLOT(handleSpecialGradient(double, double, double, double, double, double, double, double )));
 }
@@ -623,7 +624,7 @@
 	}
 }
 
-void PropertiesPalette_Group::handleShapeEdit2()
+void PropertiesPalette_Group::handleShapeEdit()
 {
 	if (!m_ScMW || m_ScMW->scriptIsRunning())
 		return;
@@ -636,7 +637,22 @@
 		m_item->isSingleSel = true;
 		m_item->update();
 		m_ScMW->view->requestMode(modeEditClip);
+		connect(m_ScMW->nodePalette, SIGNAL(paletteClosed()), this, SLOT(handleShapeEditEnded()));
 		emit shapeEditStarted();
+	}
+}
+
+void PropertiesPalette_Group::handleShapeEditEnded()
+{
+	disconnect(m_ScMW->nodePalette, SIGNAL(paletteClosed()), this, SLOT(handleShapeEditEnded()));
+	if ((m_haveDoc) && (m_haveItem))
+	{
+		if (m_tmpSelection->count() > 0)
+		{
+			m_doc->m_Selection->copy(*m_tmpSelection, false);
+			m_doc->m_Selection->connectItemToGUI();
+		}
+		m_tmpSelection->clear();
 	}
 }
 

Modified: branches/ScribusOIF/scribus/ui/propertiespalette_group.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15661&path=/branches/ScribusOIF/scribus/ui/propertiespalette_group.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertiespalette_group.h (original)
+++ branches/ScribusOIF/scribus/ui/propertiespalette_group.h Wed Oct 27 15:14:42 2010
@@ -111,7 +111,9 @@
 
 	void handleTextFlow();
 	void handleNewShape(int f, int c, qreal *vals);
-	void handleShapeEdit2();
+
+	void handleShapeEdit();
+	void handleShapeEditEnded();
 
 	void handleSpecialGradient(double, double, double, double, double, double, double, double );
 	void handleGradientEdit();

Modified: branches/ScribusOIF/scribus/ui/propertiespalette_shape.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15661&path=/branches/ScribusOIF/scribus/ui/propertiespalette_shape.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertiespalette_shape.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertiespalette_shape.cpp Wed Oct 27 15:14:42 2010
@@ -53,8 +53,6 @@
 #include "sccolorengine.h"
 #include "cpalette.h"
 #include "pageitem_textframe.h"
-#include "propertiespalette_utils.h"
-#include "propertiespalette_xyz.h"
 #include "sccombobox.h"
 #include "scfonts.h"
 #include "scribus.h"
@@ -76,6 +74,10 @@
 #include "fontcombo.h"
 #include "colorcombo.h"
 
+#include "ui/nodeeditpalette.h"
+#include "ui/propertiespalette_utils.h"
+#include "ui/propertiespalette_xyz.h"
+
 PropertiesPalette_Shape::PropertiesPalette_Shape( QWidget* parent) : QWidget(parent)
 {
 	m_ScMW = 0;
@@ -83,8 +85,8 @@
 	m_haveDoc    = false;
 	m_haveItem   = false;
 	m_unitRatio  = 1.0;
-	tmpSelection = new Selection(this, false);
-	tmpSelection->clear();
+	m_tmpSelection = new Selection(this, false);
+	m_tmpSelection->clear();
 	setSizePolicy( QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
 
 	pageLayout_2 = new QVBoxLayout( this );
@@ -536,9 +538,24 @@
 		return;
 	if ((m_haveDoc) && (m_haveItem))
 	{
-		tmpSelection->clear();
+		m_tmpSelection->clear();
 		m_ScMW->view->requestMode(modeEditClip);
 		RoundRect->setEnabled(false);
+		connect(m_ScMW->nodePalette, SIGNAL(paletteClosed()), this, SLOT(handleShapeEditEnded()));
+	}
+}
+
+void PropertiesPalette_Shape::handleShapeEditEnded()
+{
+	disconnect(m_ScMW->nodePalette, SIGNAL(paletteClosed()), this, SLOT(handleShapeEditEnded()));
+	if ((m_haveDoc) && (m_haveItem))
+	{
+		if (m_tmpSelection->count() > 0)
+		{
+			m_doc->m_Selection->copy(*m_tmpSelection, false);
+			m_doc->m_Selection->connectItemToGUI();
+		}
+		m_tmpSelection->clear();
 	}
 }
 

Modified: branches/ScribusOIF/scribus/ui/propertiespalette_shape.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15661&path=/branches/ScribusOIF/scribus/ui/propertiespalette_shape.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertiespalette_shape.h (original)
+++ branches/ScribusOIF/scribus/ui/propertiespalette_shape.h Wed Oct 27 15:14:42 2010
@@ -71,7 +71,7 @@
 	PageItem *m_item;
 	ScGuardedPtr<ScribusDoc> m_doc;
 
-	Selection* tmpSelection;
+	Selection* m_tmpSelection;
 
 private:
 
@@ -130,6 +130,7 @@
 
 	void handleTextFlow();
 	void handleShapeEdit();
+	void handleShapeEditEnded();
 	void handleCornerRadius();
 	void handleFillRule();
 	void handleNewShape(int, int, qreal *);

Modified: branches/ScribusOIF/scribus/ui/scrapbookpalette.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15661&path=/branches/ScribusOIF/scribus/ui/scrapbookpalette.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/scrapbookpalette.h (original)
+++ branches/ScribusOIF/scribus/ui/scrapbookpalette.h Wed Oct 27 15:14:42 2010
@@ -52,11 +52,9 @@
 
 signals:
 	void ToggleAllPalettes();
-	void Schliessen();
-	void CloseMpal();
-	void CloseTpal();
 	void objDropped(QString text);
 	void fileDropped(QString path, int testResult);
+	void paletteClosed();
 
 protected:
 	void dragEnterEvent(QDragEnterEvent *e);

Modified: branches/ScribusOIF/scribus/ui/transparencypalette.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15661&path=/branches/ScribusOIF/scribus/ui/transparencypalette.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/transparencypalette.cpp (original)
+++ branches/ScribusOIF/scribus/ui/transparencypalette.cpp Wed Oct 27 15:14:42 2010
@@ -67,12 +67,41 @@
 
 void Tpalette::setDocument(ScribusDoc* doc)
 {
+	disconnect(this, SIGNAL(NewTrans(double)), 0, 0);
+	disconnect(this, SIGNAL(NewTransS(double)), 0, 0);
+	disconnect(this, SIGNAL(NewGradient(int)), 0, 0);
+	disconnect(this, SIGNAL(NewBlend(int)), 0, 0);
+	disconnect(this, SIGNAL(NewBlendS(int)), 0, 0);
+	disconnect(this, SIGNAL(NewPattern(QString)), 0, 0);
+	disconnect(this, SIGNAL(NewPatternProps(double, double, double, double, double, double, double, bool, bool)), 0, 0);
+
 	currentDoc = doc;
+
 	if (doc != NULL)
 	{
 		gradEdit->setColors(doc->PageColors);
 		currentUnit = doc->unitIndex();
-	}
+
+		updateColorList();
+
+		connect(this, SIGNAL(NewTrans(double)), doc, SLOT(itemSelection_SetItemFillTransparency(double)));
+		connect(this, SIGNAL(NewTransS(double)), doc, SLOT(itemSelection_SetItemLineTransparency(double)));
+		connect(this, SIGNAL(NewBlend(int)), doc, SLOT(itemSelection_SetItemFillBlend(int)));
+		connect(this, SIGNAL(NewBlendS(int)), doc, SLOT(itemSelection_SetItemLineBlend(int)));
+		connect(this, SIGNAL(NewGradient(int)), doc, SLOT(itemSelection_SetItemGradMask(int)));
+		connect(this, SIGNAL(NewPattern(QString)), doc, SLOT(itemSelection_SetItemPatternMask(QString)));
+		connect(this, SIGNAL(NewPatternProps(double, double, double, double, double, double, double, bool, bool)), doc, SLOT(itemSelection_SetItemPatternMaskProps(double, double, double, double, double, double, double, bool, bool)));
+	}
+}
+
+void Tpalette::updateColorList()
+{
+	if (currentDoc)
+	{
+		this->SetColors(currentDoc->PageColors);
+		this->SetPatterns(&currentDoc->docPatterns);
+		this->SetGradients(&currentDoc->docGradients);
+	}
 }
 
 void Tpalette::hideSelectionButtons()

Modified: branches/ScribusOIF/scribus/ui/transparencypalette.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15661&path=/branches/ScribusOIF/scribus/ui/transparencypalette.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/transparencypalette.h (original)
+++ branches/ScribusOIF/scribus/ui/transparencypalette.h Wed Oct 27 15:14:42 2010
@@ -66,6 +66,8 @@
 	void hideSelectionButtons();
 	void updateFromItem();
 
+	void updateColorList();
+
 public slots:
 	void editLineSelectorButton();
 	void editFillSelectorButton();




More information about the scribus-commit mailing list