r16546 by jghali - merge the internals of PP work related to OIF project + experiment on pp colors tab

scribus-commit scribus-commit at lists.scribus.net
Sun Apr 3 17:06:47 CEST 2011


Author: jghali
Date: Sun Apr  3 15:06:46 2011
New Revision: 16546

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16546
Log:
merge the internals of PP work related to OIF project + experiment on pp colors tab

Added:
    trunk/Scribus/scribus/ui/propertiespalette_group.cpp
    trunk/Scribus/scribus/ui/propertiespalette_group.h
    trunk/Scribus/scribus/ui/propertiespalette_groupbase.ui
    trunk/Scribus/scribus/ui/propertiespalette_image.cpp
    trunk/Scribus/scribus/ui/propertiespalette_image.h
    trunk/Scribus/scribus/ui/propertiespalette_imagebase.ui
    trunk/Scribus/scribus/ui/propertiespalette_line.cpp
    trunk/Scribus/scribus/ui/propertiespalette_line.h
    trunk/Scribus/scribus/ui/propertiespalette_linebase.ui
    trunk/Scribus/scribus/ui/propertiespalette_shape.cpp
    trunk/Scribus/scribus/ui/propertiespalette_shape.h
    trunk/Scribus/scribus/ui/propertiespalette_shapebase.ui
    trunk/Scribus/scribus/ui/propertiespalette_text.cpp
    trunk/Scribus/scribus/ui/propertiespalette_text.h
    trunk/Scribus/scribus/ui/propertiespalette_textbase.ui
    trunk/Scribus/scribus/ui/propertiespalette_utils.cpp
    trunk/Scribus/scribus/ui/propertiespalette_utils.h
    trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp
    trunk/Scribus/scribus/ui/propertiespalette_xyz.h
    trunk/Scribus/scribus/ui/propertiespalette_xyzbase.ui
    trunk/Scribus/scribus/ui/propertywidget_advanced.cpp
    trunk/Scribus/scribus/ui/propertywidget_advanced.h
    trunk/Scribus/scribus/ui/propertywidget_advancedbase.ui
    trunk/Scribus/scribus/ui/propertywidget_distance.cpp
    trunk/Scribus/scribus/ui/propertywidget_distance.h
    trunk/Scribus/scribus/ui/propertywidget_distancebase.ui
    trunk/Scribus/scribus/ui/propertywidget_flop.cpp
    trunk/Scribus/scribus/ui/propertywidget_flop.h
    trunk/Scribus/scribus/ui/propertywidget_flopbase.ui
    trunk/Scribus/scribus/ui/propertywidget_optmargins.cpp
    trunk/Scribus/scribus/ui/propertywidget_optmargins.h
    trunk/Scribus/scribus/ui/propertywidget_optmarginsbase.ui
    trunk/Scribus/scribus/ui/propertywidget_pathtext.cpp
    trunk/Scribus/scribus/ui/propertywidget_pathtext.h
    trunk/Scribus/scribus/ui/propertywidget_pathtextbase.ui
    trunk/Scribus/scribus/ui/propertywidget_textcolor.cpp
    trunk/Scribus/scribus/ui/propertywidget_textcolor.h
    trunk/Scribus/scribus/ui/propertywidget_textcolorbase.ui
    trunk/Scribus/scribus/ui/propertywidgetbase.cpp
    trunk/Scribus/scribus/ui/propertywidgetbase.h
    trunk/Scribus/scribus/ui/scdockpalette.cpp
    trunk/Scribus/scribus/ui/scdockpalette.h
Modified:
    trunk/Scribus/scribus/CMakeLists.txt
    trunk/Scribus/scribus/canvasgesture_resize.cpp
    trunk/Scribus/scribus/canvasmode.cpp
    trunk/Scribus/scribus/canvasmode_editarc.cpp
    trunk/Scribus/scribus/canvasmode_editarc.h
    trunk/Scribus/scribus/canvasmode_editpolygon.cpp
    trunk/Scribus/scribus/canvasmode_editpolygon.h
    trunk/Scribus/scribus/canvasmode_editspiral.cpp
    trunk/Scribus/scribus/canvasmode_editspiral.h
    trunk/Scribus/scribus/canvasmode_nodeedit.cpp
    trunk/Scribus/scribus/canvasmode_nodeedit.h
    trunk/Scribus/scribus/canvasmode_normal.cpp
    trunk/Scribus/scribus/canvasmode_rotate.cpp
    trunk/Scribus/scribus/collect4output.cpp
    trunk/Scribus/scribus/gtaction.cpp
    trunk/Scribus/scribus/hyphenator.cpp
    trunk/Scribus/scribus/loadsaveplugin.cpp
    trunk/Scribus/scribus/main_nix.cpp
    trunk/Scribus/scribus/main_win32.cpp
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/pageitem.h
    trunk/Scribus/scribus/pageitem_group.cpp
    trunk/Scribus/scribus/pageitem_imageframe.cpp
    trunk/Scribus/scribus/pageitem_latexframe.cpp
    trunk/Scribus/scribus/pageitem_symbol.cpp
    trunk/Scribus/scribus/pluginmanager.cpp
    trunk/Scribus/scribus/plugins/colorwheel/cwdialog.cpp
    trunk/Scribus/scribus/plugins/gettext/pdbim/pdbim.cpp
    trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp
    trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
    trunk/Scribus/scribus/plugins/import/ps/importps.cpp
    trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
    trunk/Scribus/scribus/plugins/import/wmf/wmfimportplugin.cpp
    trunk/Scribus/scribus/plugins/scripter/api_page.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/cmddoc.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/cmdmani.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/cmdpage.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/guiapp.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/svgimport.cpp
    trunk/Scribus/scribus/plugins/short-words/parse.cpp
    trunk/Scribus/scribus/plugins/tools/spellcheck/aspellplugin.cpp
    trunk/Scribus/scribus/plugins/tools/spellcheck/aspellpluginimpl.cpp
    trunk/Scribus/scribus/scguardedptr.h
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribus.h
    trunk/Scribus/scribus/scribuscore.cpp
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scribusdoc.h
    trunk/Scribus/scribus/scribusstructs.h
    trunk/Scribus/scribus/scribusview.cpp
    trunk/Scribus/scribus/scribusview.h
    trunk/Scribus/scribus/scribuswin.cpp
    trunk/Scribus/scribus/selection.cpp
    trunk/Scribus/scribus/selection.h
    trunk/Scribus/scribus/ui/annot.cpp
    trunk/Scribus/scribus/ui/collectforoutput_ui.cpp
    trunk/Scribus/scribus/ui/colorpalette.ui
    trunk/Scribus/scribus/ui/contextmenu.cpp
    trunk/Scribus/scribus/ui/cpalette.cpp
    trunk/Scribus/scribus/ui/cpalette.h
    trunk/Scribus/scribus/ui/gradienteditor.cpp
    trunk/Scribus/scribus/ui/gradienteditor.h
    trunk/Scribus/scribus/ui/gradienteditor.ui
    trunk/Scribus/scribus/ui/gradientpreview.cpp
    trunk/Scribus/scribus/ui/gradientpreview.h
    trunk/Scribus/scribus/ui/masterpagepalette.cpp
    trunk/Scribus/scribus/ui/nodeeditpalette.cpp
    trunk/Scribus/scribus/ui/nodeeditpalette.h
    trunk/Scribus/scribus/ui/outlinepalette.cpp
    trunk/Scribus/scribus/ui/pagepalette.cpp
    trunk/Scribus/scribus/ui/propertiespalette.cpp
    trunk/Scribus/scribus/ui/propertiespalette.h
    trunk/Scribus/scribus/ui/scrapbookpalette.h
    trunk/Scribus/scribus/ui/scrspinbox.cpp
    trunk/Scribus/scribus/ui/scrspinbox.h
    trunk/Scribus/scribus/ui/smlinestyle.cpp
    trunk/Scribus/scribus/ui/smtextstyles.cpp
    trunk/Scribus/scribus/ui/symbolpalette.cpp
    trunk/Scribus/scribus/ui/symbolpalette.h
    trunk/Scribus/scribus/ui/transparencypalette.cpp
    trunk/Scribus/scribus/ui/transparencypalette.h
    trunk/Scribus/scribus/undogui.cpp
    trunk/Scribus/scribus/upgradechecker.cpp
    trunk/Scribus/scribus/util.cpp
    trunk/Scribus/scribus/util_ghostscript.cpp
    trunk/Scribus/win32/vc9/Scribus.vcproj

Modified: trunk/Scribus/scribus/CMakeLists.txt
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/CMakeLists.txt
==============================================================================
--- trunk/Scribus/scribus/CMakeLists.txt (original)
+++ trunk/Scribus/scribus/CMakeLists.txt Sun Apr  3 15:06:46 2011
@@ -120,6 +120,18 @@
   ui/prefs_tableofcontentsbase.ui
   ui/prefs_documentitemattributesbase.ui
   ui/printdialogbase.ui
+  ui/propertiespalette_groupbase.ui
+  ui/propertiespalette_imagebase.ui
+  ui/propertiespalette_linebase.ui
+  ui/propertiespalette_shapebase.ui
+  ui/propertiespalette_textbase.ui
+  ui/propertiespalette_xyzbase.ui
+  ui/propertywidget_advancedbase.ui
+  ui/propertywidget_distancebase.ui
+  ui/propertywidget_flopbase.ui
+  ui/propertywidget_optmarginsbase.ui
+  ui/propertywidget_pathtextbase.ui
+  ui/propertywidget_textcolorbase.ui
   ui/replacecolors.ui
   ui/replaceonecolor.ui
   ui/selectobjects.ui
@@ -338,10 +350,24 @@
   ui/preview.h
   ui/printdialog.h
   ui/propertiespalette.h
+  ui/propertiespalette_group.h
+  ui/propertiespalette_image.h
+  ui/propertiespalette_line.h
+  ui/propertiespalette_shape.h
+  ui/propertiespalette_text.h
+  ui/propertiespalette_utils.h
+  ui/propertiespalette_xyz.h
+  ui/propertywidget_advanced.h
+  ui/propertywidget_distance.h
+  ui/propertywidget_flop.h
+  ui/propertywidget_optmargins.h
+  ui/propertywidget_pathtext.h
+  ui/propertywidget_textcolor.h
   ui/query.h
   ui/replacecolors.h
   ui/replaceonecolor.h
   ui/rulermover.h
+  ui/scdockpalette.h
   ui/scfilewidget.h
   ui/scinputdialog.h
   ui/scmenu.h
@@ -719,11 +745,26 @@
   ui/preview.cpp
   ui/printdialog.cpp
   ui/propertiespalette.cpp
+  ui/propertiespalette_image.cpp
+  ui/propertiespalette_group.cpp
+  ui/propertiespalette_line.cpp
+  ui/propertiespalette_shape.cpp
+  ui/propertiespalette_text.cpp
+  ui/propertiespalette_utils.cpp
+  ui/propertiespalette_xyz.cpp
+  ui/propertywidget_advanced.cpp
+  ui/propertywidget_distance.cpp
+  ui/propertywidget_flop.cpp
+  ui/propertywidget_optmargins.cpp
+  ui/propertywidget_pathtext.cpp
+  ui/propertywidget_textcolor.cpp
+  ui/propertywidgetbase.cpp
   ui/query.cpp
   ui/replacecolors.cpp
   ui/replaceonecolor.cpp
   ui/rulermover.cpp
   ui/sccombobox.cpp
+  ui/scdockpalette.cpp
   ui/scfilewidget.cpp
   ui/scinputdialog.cpp
   ui/scmenu.cpp

Modified: trunk/Scribus/scribus/canvasgesture_resize.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/canvasgesture_resize.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_resize.cpp (original)
+++ trunk/Scribus/scribus/canvasgesture_resize.cpp Sun Apr  3 15:06:46 2011
@@ -169,6 +169,7 @@
 				m_doc->m_Selection->itemAt(i)->checkChanges();
 			m_doc->invalidateRegion(m_mousePressBounds.unite(m_bounds));
 			m_doc->regionsChanged()->update(m_mousePressBounds.unite(m_bounds));
+			m_doc->changed();
 		}
 	}
 //	qDebug() << "ResizeGesture::release: transaction" << m_transactionStarted;

Modified: trunk/Scribus/scribus/canvasmode.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/canvasmode.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode.cpp (original)
+++ trunk/Scribus/scribus/canvasmode.cpp Sun Apr  3 15:06:46 2011
@@ -60,6 +60,8 @@
 #include "units.h"
 #include "util_icon.h"
 
+#include <QMdiArea>
+#include <QMdiSubWindow>
 #include <QPainter>
 
 

Modified: trunk/Scribus/scribus/canvasmode_editarc.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/canvasmode_editarc.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editarc.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editarc.cpp Sun Apr  3 15:06:46 2011
@@ -63,6 +63,7 @@
 CanvasMode_EditArc::CanvasMode_EditArc(ScribusView* view) : CanvasMode(view), m_ScMW(view->m_ScMW) 
 {
 	Mxp = Myp = -1;
+	m_blockUpdateFromItem = 0;
 	m_arcPoint = noPointDefined;
 }
 
@@ -185,12 +186,13 @@
 	connect(VectorDialog, SIGNAL(NewVectors(double, double, double, double)), this, SLOT(applyValues(double, double, double, double)));
 	connect(VectorDialog, SIGNAL(endEdit()), this, SLOT(endEditing()));
 	connect(VectorDialog, SIGNAL(paletteShown(bool)), this, SLOT(endEditing(bool)));
-	connect(m_doc, SIGNAL(updateEditItem()), this, SLOT(updateFromItem()));
-	connect(m_ScMW->propertiesPalette, SIGNAL(updateEditItem()), this, SLOT(updateFromItem()));
+	connect(m_doc, SIGNAL(docChanged()), this, SLOT(updateFromItem()));
 }
 
 void CanvasMode_EditArc::updateFromItem()
 {
+	if (updateFromItemBlocked())
+		return;
 	PageItem *currItem = m_doc->m_Selection->itemAt(0);
 	PageItem_Arc* item = currItem->asArc();
 	centerPoint = currItem->PoLine.pointQF(0);
@@ -263,8 +265,7 @@
 	delete VectorDialog;
 	m_view->redrawMarker->hide();
 	m_arcPoint = noPointDefined;
-	disconnect(m_doc, SIGNAL(updateEditItem()), this, SLOT(updateFromItem()));
-	disconnect(m_ScMW->propertiesPalette, SIGNAL(updateEditItem()), this, SLOT(updateFromItem()));
+	disconnect(m_doc, SIGNAL(docChanged()), this, SLOT(updateFromItem()));
 }
 
 void CanvasMode_EditArc::mouseDoubleClickEvent(QMouseEvent *m)
@@ -327,7 +328,9 @@
 		QLineF res = QLineF(centerPoint, startPoint);
 		QLineF swe = QLineF(centerPoint, endPoint);
 		VectorDialog->setValues(res.angle(), swe.angle(), nHeight * 2, nWidth * 2);
+		blockUpdateFromItem(true);
 		currItem->update();
+		blockUpdateFromItem(false);
 		QRectF upRect;
 		upRect = QRectF(QPointF(0, 0), QPointF(currItem->width(), currItem->height())).normalized();
 		upRect.translate(currItem->xPos(), currItem->yPos());

Modified: trunk/Scribus/scribus/canvasmode_editarc.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/canvasmode_editarc.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editarc.h (original)
+++ trunk/Scribus/scribus/canvasmode_editarc.h Sun Apr  3 15:06:46 2011
@@ -82,6 +82,10 @@
 	eArcPoint m_arcPoint;
 	ArcVectorDialog* VectorDialog;
 
+	int    m_blockUpdateFromItem;
+	void   blockUpdateFromItem(bool block) { if (block) ++m_blockUpdateFromItem; else --m_blockUpdateFromItem; }
+	bool   updateFromItemBlocked() { return (m_blockUpdateFromItem > 0); }
+
 public slots:
 	void updateFromItem();
 

Modified: trunk/Scribus/scribus/canvasmode_editpolygon.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/canvasmode_editpolygon.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editpolygon.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editpolygon.cpp Sun Apr  3 15:06:46 2011
@@ -62,6 +62,7 @@
 CanvasMode_EditPolygon::CanvasMode_EditPolygon(ScribusView* view) : CanvasMode(view), m_ScMW(view->m_ScMW) 
 {
 	Mxp = Myp = -1;
+	m_blockUpdateFromItem = 0;
 	m_polygonPoint = noPointDefined;
 }
 
@@ -143,6 +144,8 @@
 
 void CanvasMode_EditPolygon::updateFromItem()
 {
+	if (updateFromItemBlocked())
+		return;
 	PageItem *currItem = m_doc->m_Selection->itemAt(0);
 	PageItem_RegularPolygon* item = currItem->asRegularPolygon();
 	centerPoint = QPointF(currItem->width() / 2.0, currItem->height() / 2.0);
@@ -206,8 +209,7 @@
 	setModeCursor();
 	if (fromGesture)
 		m_view->update();
-	connect(m_doc, SIGNAL(updateEditItem()), this, SLOT(updateFromItem()));
-	connect(m_ScMW->propertiesPalette, SIGNAL(updateEditItem()), this, SLOT(updateFromItem()));
+	connect(m_doc, SIGNAL(docChanged()), this, SLOT(updateFromItem()));
 	
 	connect(VectorDialog, SIGNAL(NewVectors(int, double, bool, double, double, double, double)), this, SLOT(applyValues(int, double, bool, double, double, double, double)));
 	connect(VectorDialog, SIGNAL(endEdit()), this, SLOT(endEditing()));
@@ -221,8 +223,7 @@
 	delete VectorDialog;
 	m_view->redrawMarker->hide();
 	m_polygonPoint = noPointDefined;
-	disconnect(m_doc, SIGNAL(updateEditItem()), this, SLOT(updateFromItem()));
-	disconnect(m_ScMW->propertiesPalette, SIGNAL(updateEditItem()), this, SLOT(updateFromItem()));
+	disconnect(m_doc, SIGNAL(docChanged()), this, SLOT(updateFromItem()));
 }
 
 void CanvasMode_EditPolygon::endEditing(bool active)
@@ -358,7 +359,9 @@
 		outerLine.setLength(outerLine.length() * polyOuterCurvature);
 		outerCPoint = outerLine.p2();
 		VectorDialog->setValues(polyCorners, polyFactor, polyUseFactor, polyRotation, polyCurvature, polyInnerRot, polyOuterCurvature);
+		blockUpdateFromItem(true);
 		currItem->update();
+		blockUpdateFromItem(false);
 		QRectF upRect;
 		upRect = QRectF(QPointF(0, 0), QPointF(currItem->width(), currItem->height())).normalized();
 		upRect.translate(currItem->xPos(), currItem->yPos());

Modified: trunk/Scribus/scribus/canvasmode_editpolygon.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/canvasmode_editpolygon.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editpolygon.h (original)
+++ trunk/Scribus/scribus/canvasmode_editpolygon.h Sun Apr  3 15:06:46 2011
@@ -90,6 +90,10 @@
 	ePolygonPoint m_polygonPoint;
 	PolyVectorDialog *VectorDialog;
 
+	int    m_blockUpdateFromItem;
+	void   blockUpdateFromItem(bool block) { if (block) ++m_blockUpdateFromItem; else --m_blockUpdateFromItem; }
+	bool   updateFromItemBlocked() { return (m_blockUpdateFromItem > 0); }
+
 public slots:
 	void applyValues(int polyC, double polyF, bool polyUseCF, double polyR, double polyCur, double polyIRot, double polyOCur);
 	void updateFromItem();

Modified: trunk/Scribus/scribus/canvasmode_editspiral.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/canvasmode_editspiral.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editspiral.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editspiral.cpp Sun Apr  3 15:06:46 2011
@@ -47,6 +47,7 @@
 CanvasMode_EditSpiral::CanvasMode_EditSpiral(ScribusView* view) : CanvasMode(view), m_ScMW(view->m_ScMW) 
 {
 	Mxp = Myp = -1;
+	m_blockUpdateFromItem = 0;
 	m_arcPoint = noPointDefined;
 }
 
@@ -136,12 +137,13 @@
 	connect(VectorDialog, SIGNAL(NewVectors(double, double, double)), this, SLOT(applyValues(double, double, double)));
 	connect(VectorDialog, SIGNAL(endEdit()), this, SLOT(endEditing()));
 	connect(VectorDialog, SIGNAL(paletteShown(bool)), this, SLOT(endEditing(bool)));
-	connect(m_doc, SIGNAL(updateEditItem()), this, SLOT(updateFromItem()));
-	connect(m_ScMW->propertiesPalette, SIGNAL(updateEditItem()), this, SLOT(updateFromItem()));
+	connect(m_doc, SIGNAL(docChanged()), this, SLOT(updateFromItem()));
 }
 
 void CanvasMode_EditSpiral::updateFromItem()
 {
+	if (updateFromItemBlocked())
+		return;
 	PageItem *currItem = m_doc->m_Selection->itemAt(0);
 	PageItem_Spiral* item = currItem->asSpiral();
 	startPoint = currItem->PoLine.pointQF(0);
@@ -248,8 +250,7 @@
 	delete VectorDialog;
 	m_view->redrawMarker->hide();
 	m_arcPoint = noPointDefined;
-	disconnect(m_doc, SIGNAL(updateEditItem()), this, SLOT(updateFromItem()));
-	disconnect(m_ScMW->propertiesPalette, SIGNAL(updateEditItem()), this, SLOT(updateFromItem()));
+	disconnect(m_doc, SIGNAL(docChanged()), this, SLOT(updateFromItem()));
 }
 
 void CanvasMode_EditSpiral::mouseDoubleClickEvent(QMouseEvent *m)

Modified: trunk/Scribus/scribus/canvasmode_editspiral.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/canvasmode_editspiral.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editspiral.h (original)
+++ trunk/Scribus/scribus/canvasmode_editspiral.h Sun Apr  3 15:06:46 2011
@@ -79,6 +79,10 @@
 	eSpiralPoint m_arcPoint;
 	SpiralVectorDialog* VectorDialog;
 
+	int    m_blockUpdateFromItem;
+	void   blockUpdateFromItem(bool block) { if (block) ++m_blockUpdateFromItem; else --m_blockUpdateFromItem; }
+	bool   updateFromItemBlocked() { return (m_blockUpdateFromItem > 0); }
+
 public slots:
 	void updateFromItem();
 

Modified: trunk/Scribus/scribus/canvasmode_nodeedit.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/canvasmode_nodeedit.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_nodeedit.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_nodeedit.cpp Sun Apr  3 15:06:46 2011
@@ -17,6 +17,7 @@
 
 #include <QMenu>
 #include <QMouseEvent>
+#include <QPainter>
 
 #include "canvas.h"
 #include "canvasgesture_rectselect.h"

Modified: trunk/Scribus/scribus/canvasmode_nodeedit.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/canvasmode_nodeedit.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_nodeedit.h (original)
+++ trunk/Scribus/scribus/canvasmode_nodeedit.h Sun Apr  3 15:06:46 2011
@@ -22,6 +22,8 @@
 
 #include <QTransform>
 #include <QRect>
+
+class QPainter;
 
 class PageItem;
 class RectSelect;

Modified: trunk/Scribus/scribus/canvasmode_normal.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/canvasmode_normal.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_normal.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_normal.cpp Sun Apr  3 15:06:46 2011
@@ -62,6 +62,8 @@
 #include "ui/pageselector.h"
 #include "ui/polyprops.h"
 #include "ui/propertiespalette.h"
+#include "ui/propertiespalette_line.h"
+#include "ui/propertiespalette_text.h"
 #include "plugins/formatidlist.h"
 
 
@@ -931,6 +933,7 @@
 			//currItem->emitAllToGUI();
 			m_view->updatesOn(true);
 			m_view->updateContents();
+			m_doc->changed();
 		}
 	}
 	//CB Drag selection performed here
@@ -1011,8 +1014,9 @@
 			m_canvas->m_viewMode.operItemMoving = false;
 			m_canvas->m_viewMode.operItemResizing = false;
 			m_view->updateContents(QRect(static_cast<int>(x-5), static_cast<int>(y-5), static_cast<int>(w+10), static_cast<int>(h+10)));
-			m_ScMW->propertiesPalette->setXY(x,y);
-			m_ScMW->propertiesPalette->setBH(w,h);
+			//Now unuseful as PropertiesPalette_XYZ::setCurrentItem() handles multiple selection
+			//m_ScMW->propertiesPalette->setXY(x,y);
+			//m_ScMW->propertiesPalette->setBH(w,h);
 		}
 		/*else
 			currItem->emitAllToGUI();*/
@@ -1332,10 +1336,7 @@
 				double x2, y2, w, h;
 				m_doc->m_Selection->getGroupRect(&x2, &y2, &w, &h);
 				m_doc->moveGroup(pastePoint.x() - x2, pastePoint.y() - y2);
-				m_ScMW->propertiesPalette->updateColorList();
-				m_ScMW->propertiesPalette->paraStyleCombo->updateFormatList();
-				m_ScMW->propertiesPalette->charStyleCombo->updateFormatList();
-				m_ScMW->propertiesPalette->SetLineFormats(m_doc);
+				m_ScMW->requestUpdate(reqColorsUpdate | reqLineStylesUpdate | reqTextStylesUpdate);
 			}
 		}
 		for (int a = 0; a < m_doc->m_Selection->count(); ++a)

Modified: trunk/Scribus/scribus/canvasmode_rotate.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/canvasmode_rotate.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_rotate.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_rotate.cpp Sun Apr  3 15:06:46 2011
@@ -316,24 +316,20 @@
 		{
 			m_view->startGroupTransaction(Um::Rotate, "", Um::IRotate);
 		}
-		double newW = xy2Deg(mousePointDoc.x()-m_view->RCenter.x(), mousePointDoc.y()-m_view->RCenter.y()); //xy2Deg(m->x()/sc - m_view->RCenter.x(), m->y()/sc - m_view->RCenter.y());
+		double angle = 0;
+		double newW  = xy2Deg(mousePointDoc.x()-m_view->RCenter.x(), mousePointDoc.y()-m_view->RCenter.y()); //xy2Deg(m->x()/sc - m_view->RCenter.x(), m->y()/sc - m_view->RCenter.y());
 		if (m->modifiers() & Qt::ControlModifier)
 		{
 			newW=constrainAngle(newW, m_doc->opToolPrefs().constrain);
 			m_view->oldW=constrainAngle(m_view->oldW, m_doc->opToolPrefs().constrain);
 			//RotateGroup uses MoveBy so its pretty hard to constrain the result
-			if (m_doc->m_Selection->isMultipleSelection())
-				m_doc->rotateGroup(newW-m_view->oldW, m_view->RCenter);
-			else
-				m_doc->RotateItem(newW, currItem->ItemNr);
+			angle = m_doc->m_Selection->isMultipleSelection() ? (newW-m_view->oldW) : newW;
 		}
 		else
 		{
-			if (m_doc->m_Selection->isMultipleSelection())
-				m_doc->rotateGroup(newW - m_view->oldW, m_view->RCenter);
-			else
-				m_doc->RotateItem(currItem->rotation() - (m_view->oldW - newW), currItem->ItemNr);
-		}
+			angle = m_doc->m_Selection->isMultipleSelection() ? (newW - m_view->oldW) : (currItem->rotation() - (m_view->oldW - newW));
+		}
+		m_doc->itemSelection_Rotate(angle);
 		m_view->oldW = newW;
 		m_canvas->setRenderModeUseBuffer(false);
 		if (!m_doc->m_Selection->isMultipleSelection())

Modified: trunk/Scribus/scribus/collect4output.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/collect4output.cpp
==============================================================================
--- trunk/Scribus/scribus/collect4output.cpp (original)
+++ trunk/Scribus/scribus/collect4output.cpp Sun Apr  3 15:06:46 2011
@@ -24,6 +24,7 @@
 #include "util_file.h"
 
 #include <QMessageBox>
+#include <QProgressBar>
 #include <QString>
 #include <QMap>
 #include <QDir>

Modified: trunk/Scribus/scribus/gtaction.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/gtaction.cpp
==============================================================================
--- trunk/Scribus/scribus/gtaction.cpp (original)
+++ trunk/Scribus/scribus/gtaction.cpp Sun Apr  3 15:06:46 2011
@@ -26,6 +26,7 @@
 
 #include <QCursor>
 #include <QList>
+#include <QProgressBar>
 #include <QStringList>
 
 #include "gtaction.h"
@@ -45,6 +46,7 @@
 
 #include "util_icon.h"
 #include "ui/propertiespalette.h"
+#include "ui/propertiespalette_text.h"
 #include "ui/missing.h"
 
 
@@ -416,7 +418,7 @@
 	tmp.create(vg);
 	textFrame->doc()->redefineStyles(tmp, false);
 	
-	m_ScMW->propertiesPalette->paraStyleCombo->updateFormatList();
+	m_ScMW->propertiesPalette->textPal->updateParagraphStyles();
 }
 
 void gtAction:: setCharStyleAttributes(gtFont *font, CharStyle& style)

Modified: trunk/Scribus/scribus/hyphenator.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/hyphenator.cpp
==============================================================================
--- trunk/Scribus/scribus/hyphenator.cpp (original)
+++ trunk/Scribus/scribus/hyphenator.cpp Sun Apr  3 15:06:46 2011
@@ -25,6 +25,7 @@
 
 #include "scconfig.h"
 
+#include <QApplication>
 #include <QRegExp>
 #include <QCursor>
 #include <QDir>

Modified: trunk/Scribus/scribus/loadsaveplugin.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/loadsaveplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/loadsaveplugin.cpp (original)
+++ trunk/Scribus/scribus/loadsaveplugin.cpp Sun Apr  3 15:06:46 2011
@@ -8,7 +8,9 @@
 #include "commonstrings.h"
 #include "scribuscore.h"
 #include "plugins/formatidlist.h"
+
 #include <QList>
+#include <QMessageBox>
 
 QList<FileFormat> LoadSavePlugin::formats;
 

Modified: trunk/Scribus/scribus/main_nix.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/main_nix.cpp
==============================================================================
--- trunk/Scribus/scribus/main_nix.cpp (original)
+++ trunk/Scribus/scribus/main_nix.cpp Sun Apr  3 15:06:46 2011
@@ -29,6 +29,7 @@
 #include <signal.h>
 
 #include <QApplication>
+#include <QMessageBox>
 
 #define BASE_QM "scribus"
 

Modified: trunk/Scribus/scribus/main_win32.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/main_win32.cpp
==============================================================================
--- trunk/Scribus/scribus/main_win32.cpp (original)
+++ trunk/Scribus/scribus/main_win32.cpp Sun Apr  3 15:06:46 2011
@@ -37,6 +37,7 @@
 #include <io.h>
 
 #include <QApplication>
+#include <QMessageBox>
 #include <exception>
 using namespace std;
 

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp (original)
+++ trunk/Scribus/scribus/pageitem.cpp Sun Apr  3 15:06:46 2011
@@ -40,7 +40,6 @@
 #include "cmsettings.h"
 #include "colorblind.h"
 #include "commonstrings.h"
-#include "ui/cpalette.h"
 #include "ui/guidemanager.h"
 #include "page.h"
 #include "pageitem_textframe.h"
@@ -850,7 +849,6 @@
 	if (drawingOnly || m_Doc->isLoading())
 		return;
 	checkChanges();
-	emit position(Xpos, Ypos);
 }
 
 void PageItem::setYPos(const double newYPos, bool drawingOnly)
@@ -859,7 +857,6 @@
 	if (drawingOnly || m_Doc->isLoading())
 		return;
 	checkChanges();
-	emit position(Xpos, Ypos);
 }
 
 void PageItem::setXYPos(const double newXPos, const double newYPos, bool drawingOnly)
@@ -869,7 +866,6 @@
 	if (drawingOnly || m_Doc->isLoading())
 		return;
 	checkChanges();
-	emit position(Xpos, Ypos);
 }
 
 void PageItem::moveBy(const double dX, const double dY, bool drawingOnly)
@@ -890,7 +886,6 @@
 	if (drawingOnly || m_Doc->isLoading())
 		return;
 	checkChanges();
-	emit position(Xpos, Ypos);
 }
 
 void PageItem::setWidth(const double newWidth)
@@ -900,7 +895,6 @@
 	if (m_Doc->isLoading())
 		return;
 	checkChanges();
-	emit widthAndHeight(Width, Height);
 }
 
 void PageItem::setHeight(const double newHeight)
@@ -910,7 +904,6 @@
 	if (m_Doc->isLoading())
 		return;
 	checkChanges();
-	emit widthAndHeight(Width, Height);
 }
 
 void PageItem::setWidthHeight(const double newWidth, const double newHeight, bool drawingOnly)
@@ -921,7 +914,6 @@
 	if (drawingOnly)
 		return;
 	checkChanges();
-	emit widthAndHeight(Width, Height);
 }
 
 void PageItem::setWidthHeight(const double newWidth, const double newHeight)
@@ -932,7 +924,6 @@
 	if (m_Doc->isLoading())
 		return;
 	checkChanges();
-	emit widthAndHeight(Width, Height);
 }
 
 void PageItem::resizeBy(const double dH, const double dW)
@@ -947,7 +938,6 @@
 	if (m_Doc->isLoading())
 		return;
 	checkChanges();
-	emit widthAndHeight(Width, Height);
 }
 
 void PageItem::setRotation(const double newRotation, bool drawingOnly)
@@ -956,7 +946,6 @@
 	if (drawingOnly || m_Doc->isLoading())
 		return;
 	checkChanges();
-	emit rotation(Rot);
 }
 
 void PageItem::rotateBy(const double dR)
@@ -967,7 +956,6 @@
 	if (m_Doc->isLoading())
 		return;
 	checkChanges();
-	emit rotation(Rot);
 }
 
 void PageItem::setSelected(const bool toSelect)
@@ -981,7 +969,6 @@
 	if (m_Doc->isLoading())
 		return;
 	checkChanges();
-	emit imageOffsetScale(LocalScX, LocalScY, LocalX, LocalY);
 }
 
 void PageItem::setImageYScale(const double newImageYScale)
@@ -990,7 +977,6 @@
 	if (m_Doc->isLoading())
 		return;
 	checkChanges();
-	emit imageOffsetScale(LocalScX, LocalScY, LocalX, LocalY);
 }
 
 void PageItem::setImageXYScale(const double newImageXScale, const double newImageYScale)
@@ -1000,7 +986,6 @@
 	if (m_Doc->isLoading())
 		return;
 	checkChanges();
-	emit imageOffsetScale(LocalScX, LocalScY, LocalX, LocalY);
 }
 
 void PageItem::setImageXOffset(const double newImageXOffset)
@@ -1009,7 +994,6 @@
 	if (m_Doc->isLoading())
 		return;
 	checkChanges();
-	emit imageOffsetScale(LocalScX, LocalScY, LocalX, LocalY);
 }
 
 void PageItem::setImageYOffset(const double newImageYOffset)
@@ -1018,7 +1002,6 @@
 	if (m_Doc->isLoading())
 		return;
 	checkChanges();
-	emit imageOffsetScale(LocalScX, LocalScY, LocalX, LocalY);
 }
 
 void PageItem::setImageXYOffset(const double newImageXOffset, const double newImageYOffset)
@@ -1028,7 +1011,6 @@
 	if (m_Doc->isLoading())
 		return;
 	checkChanges();
-	emit imageOffsetScale(LocalScX, LocalScY, LocalX, LocalY);
 }
 
 void PageItem::moveImageXYOffsetBy(const double dX, const double dY)
@@ -1042,7 +1024,6 @@
 	if (m_Doc->isLoading())
 		return;
 	checkChanges();
-	emit imageOffsetScale(LocalScX, LocalScY, LocalX, LocalY);
 }
 
 void PageItem::setImageRotation(const double newRotation)
@@ -1051,7 +1032,6 @@
 	if (m_Doc->isLoading())
 		return;
 	checkChanges();
-	emit imageRotation(LocalRot);
 }
 
 void PageItem::setReversed(bool newReversed)
@@ -1273,25 +1253,25 @@
 void PageItem::setTextToFrameDistLeft(double newLeft)
 {
 	Extra=newLeft;
-	emit textToFrameDistances(Extra, TExtra, BExtra, RExtra);
+	//emit textToFrameDistances(Extra, TExtra, BExtra, RExtra);
 }
 
 void PageItem::setTextToFrameDistRight(double newRight)
 {
 	RExtra=newRight;
-	emit textToFrameDistances(Extra, TExtra, BExtra, RExtra);
+	//emit textToFrameDistances(Extra, TExtra, BExtra, RExtra);
 }
 
 void PageItem::setTextToFrameDistTop(double newTop)
 {
 	TExtra=newTop;
-	emit textToFrameDistances(Extra, TExtra, BExtra, RExtra);
+	//emit textToFrameDistances(Extra, TExtra, BExtra, RExtra);
 }
 
 void PageItem::setTextToFrameDistBottom(double newBottom)
 {
 	BExtra=newBottom;
-	emit textToFrameDistances(Extra, TExtra, BExtra, RExtra);
+	//emit textToFrameDistances(Extra, TExtra, BExtra, RExtra);
 }
 
 void PageItem::setTextToFrameDist(double newLeft, double newRight, double newTop, double newBottom)
@@ -1300,7 +1280,7 @@
 	RExtra=newRight;
 	TExtra=newTop;
 	BExtra=newBottom;
-	emit textToFrameDistances(Extra, TExtra, BExtra, RExtra);
+	//emit textToFrameDistances(Extra, TExtra, BExtra, RExtra);
 }
 
 double PageItem::gridOffset() const { return m_Doc->guidesPrefs().offsetBaselineGrid; }
@@ -1320,7 +1300,7 @@
 void PageItem::setCornerRadius(double newRadius)
 {
 	RadRect=newRadius;
-	emit cornerRadius(RadRect);
+	//emit cornerRadius(RadRect);
 }
 
 
@@ -3164,7 +3144,6 @@
 	}
 	fillShadeVal = newShade;
 	setFillQColor();
-//CB unused in 135	emit colors(lineColorVal, fillColorVal, lineShadeVal, fillShadeVal);
 }
 
 void PageItem::setFillTransparency(double newTransparency)
@@ -3239,7 +3218,6 @@
 	}
 	lineColorVal = tmp;
 	setLineQColor();
-//CB unused in 135	emit colors(lineColorVal, fillColorVal, lineShadeVal, fillShadeVal);
 }
 
 void PageItem::setLineShade(double newShade)
@@ -3261,7 +3239,6 @@
 	}
 	lineShadeVal = newShade;
 	setLineQColor();
-//CB unused in 135	emit colors(lineColorVal, fillColorVal, lineShadeVal, fillShadeVal);
 }
 
 void PageItem::setStrokePattern(const QString &newPattern)
@@ -3559,7 +3536,6 @@
 		undoManager->action(this, ss);
 	}
 	m_ImageIsFlippedH = !m_ImageIsFlippedH;
-	emit frameFlippedH(m_ImageIsFlippedH);
 }
 
 void PageItem::setImageFlippedV(bool flipped)
@@ -3577,7 +3553,6 @@
 		undoManager->action(this, ss);
 	}
 	m_ImageIsFlippedV = !m_ImageIsFlippedV;
-	emit frameFlippedV(m_ImageIsFlippedV);
 }
 
 void PageItem::setImageScalingMode(bool freeScale, bool keepRatio)
@@ -3618,7 +3593,7 @@
 		undoManager->action(this, ss);
 	}
 	m_Locked = !m_Locked;
-	emit frameLocked(m_Locked);
+	//emit frameLocked(m_Locked);
 }
 
 void PageItem::setLocked(bool isLocked)
@@ -3647,7 +3622,7 @@
 		undoManager->action(this, ss);
 	}
 	m_SizeLocked = !m_SizeLocked;
-	emit frameSizeLocked(m_SizeLocked);
+	//emit frameSizeLocked(m_SizeLocked);
 }
 
 void PageItem::setSizeLocked(bool isLocked)
@@ -3676,7 +3651,6 @@
 		undoManager->action(this, ss);
 	}
 	m_PrintEnabled=!m_PrintEnabled;
-	emit printEnabled(m_PrintEnabled);
 }
 
 void PageItem::setTextFlowMode(TextFlowMode mode)
@@ -6061,8 +6035,6 @@
 		cl.scale(LocalScX, LocalScY);
 		imageClip.map(cl);
 	}
-	emit imageOffsetScale(LocalScX, LocalScY, LocalX, LocalY );
-	emit imageRotation(LocalRot);
 }
 
 void PageItem::setExternalFile(QString val)
@@ -6174,7 +6146,6 @@
 	//	ScMW->propertiesPalette->updateColorSpecialGradient();
 	//CB Will only emit if connected, ie is first in GUI selection
 	double dur=m_Doc->unitRatio();
-	emit gradientColorUpdate(GrStartX*dur, GrStartY*dur, GrEndX*dur, GrEndY*dur, Width*dur, Height*dur);
 }
 
 void PageItem::setPolyClip(int up, int down)
@@ -6253,52 +6224,26 @@
 	if (!m_Doc->m_Selection->primarySelectionIs(this))
 		return false;
 	PropertiesPalette* pp=m_Doc->scMW()->propertiesPalette;
-	connect(this, SIGNAL(myself(PageItem *)), pp, SLOT(SetCurItem(PageItem *)));
+	//connect(this, SIGNAL(myself(PageItem *)), pp, SLOT(setCurrentItem(PageItem *)));
 	connect(this, SIGNAL(frameType(int)), m_Doc->scMW(), SLOT(HaveNewSel(int)));
 	connect(this, SIGNAL(frameType(int)), m_Doc, SLOT(selectionChanged()));
-	connect(this, SIGNAL(frameType(int)), pp, SLOT(NewSel(int)));
-	connect(this, SIGNAL(frameLocked(bool)), pp, SLOT(setLocked(bool)));
-	connect(this, SIGNAL(frameSizeLocked(bool)), pp, SLOT(setSizeLocked(bool)));
-	connect(this, SIGNAL(frameFlippedH(bool)), pp, SLOT(setFlippedH(bool)));
-	connect(this, SIGNAL(frameFlippedV(bool)), pp, SLOT(setFlippedV(bool)));
-	connect(this, SIGNAL(printEnabled(bool)), pp, SLOT(setPrintingEnabled(bool)));
-	connect(this, SIGNAL(position(double, double)), pp, SLOT(setXY(double, double)));
-	connect(this, SIGNAL(widthAndHeight(double, double)), pp, SLOT(setBH(double, double)));
-//CB unused in 135 connect(this, SIGNAL(colors(QString, QString, double, double)), m_Doc->scMW(), SLOT(setCSMenu()));
-//	connect(this, SIGNAL(colors(QString, QString, double, double)), pp->Cpal, SLOT(setActFarben(QString, QString, int, int)));
-//	connect(this, SIGNAL(gradientType(int)), pp->Cpal, SLOT(setActGradient(int)));
-	connect(this, SIGNAL(patternFill(QString, double, double, double, double, double, double, double, bool, bool)), pp->Cpal, SLOT(setActPattern(QString, double, double, double, double, double, double, double, bool, bool)));
-//	connect(this, SIGNAL(gradientColorUpdate(double, double, double, double, double, double)), pp->Cpal, SLOT(setSpecialGradient(double, double, double, double, double, double)));
-	connect(this, SIGNAL(rotation(double)), pp, SLOT(setR(double)));
-//	connect(this, SIGNAL(transparency(double, double)), pp->Cpal, SLOT(setActTrans(double, double)));
-//	connect(this, SIGNAL(blendmode(int, int)), pp->Cpal, SLOT(setActBlend(int, int)));
+	//connect(this, SIGNAL(frameType(int)), pp, SLOT(handleSelectionChanged()));
+	//connect(this, SIGNAL(frameLocked(bool)), pp, SLOT(setLocked(bool)));
+	//connect(this, SIGNAL(frameSizeLocked(bool)), pp, SLOT(setSizeLocked(bool)));
 	//Shape signals
-	//Not connected when transferring code: void columns(int, double); //Number, gap
-	connect(this, SIGNAL(cornerRadius(double)), pp, SLOT(setRR(double)));
+	//connect(this, SIGNAL(cornerRadius(double)), pp, SLOT(setRR(double)));
 	//	connect(view, SIGNAL(ItemTextCols(int, double)), propertiesPalette, SLOT(setCols(int, double)));
 	//Line signals
-	connect(this, SIGNAL(lineWidth(double)), pp, SLOT(setLineWidth(double)));
-	connect(this, SIGNAL(imageOffsetScale(double, double, double, double)), pp, SLOT(setScaleAndOffset(double, double, double, double)));
-	connect(this, SIGNAL(imageRotation(double)), pp, SLOT(setImgRotation(double)));
-	connect(this, SIGNAL(lineStyleCapJoin(Qt::PenStyle, Qt::PenCapStyle, Qt::PenJoinStyle)), pp, SLOT( setLIvalue(Qt::PenStyle, Qt::PenCapStyle, Qt::PenJoinStyle)));
+	//connect(this, SIGNAL(lineWidth(double)), pp, SLOT(setLineWidth(double)));
+	//connect(this, SIGNAL(lineStyleCapJoin(Qt::PenStyle, Qt::PenCapStyle, Qt::PenJoinStyle)), pp, SLOT( setLIvalue(Qt::PenStyle, Qt::PenCapStyle, Qt::PenJoinStyle)));
 	//Frame text signals
-	connect(this, SIGNAL(lineSpacing(double)), pp, SLOT(setLsp(double)));
-	connect(this, SIGNAL(textToFrameDistances(double, double, double, double)), pp, SLOT(setTextToFrameDistances(double, double, double, double)));
-	connect(this, SIGNAL(textKerning(double)), pp, SLOT(setExtra(double)));
-	connect(this, SIGNAL(textStyle(int)), pp, SLOT(setStil(int)));
-	connect(this, SIGNAL(textStyle(int)), m_Doc->scMW(), SLOT(setStilvalue(int)));
-	connect(this, SIGNAL(textFont(const QString&)), pp, SLOT(setFontFace(const QString&)));
-	connect(this, SIGNAL(textSize(double)), pp, SLOT(setSize(double)));
-	connect(this, SIGNAL(textWidthScale(double)), pp, SLOT(setTScale(double)));
-	connect(this, SIGNAL(textHeightScale(double)), pp, SLOT(setTScaleV(double)));
-	connect(this, SIGNAL(textBaseLineOffset(double)), pp, SLOT(setTBase(double)));
-	connect(this, SIGNAL(textOutline(double)), pp, SLOT(setOutlineW(double)));
-	connect(this, SIGNAL(textShadow(double, double )), pp, SLOT(setShadowOffs(double, double )));
-	connect(this, SIGNAL(textUnderline(double, double)), pp, SLOT(setUnderline(double, double)));
-	connect(this, SIGNAL(textStrike(double, double)), pp, SLOT(setStrike(double, double)));
-	connect(this, SIGNAL(textColor(QString, QString, double, double)), pp, SLOT(setActFarben(QString, QString, double, double)));
-//	connect(this, SIGNAL(textFormatting(int)), pp, SLOT(setAli(int)));
-//	connect(this, SIGNAL(textFormatting(int)), ScMW, SLOT(setAbsValue(int)));
+	//connect(this, SIGNAL(lineSpacing(double)), pp, SLOT(setLsp(double)));
+	//connect(this, SIGNAL(textToFrameDistances(double, double, double, double)), pp, SLOT(setTextToFrameDistances(double, double, double, double)));
+	//connect(this, SIGNAL(textKerning(double)), pp, SLOT(setExtra(double)));
+	//connect(this, SIGNAL(textStyle(int)), pp, SLOT(setStil(int)));
+	connect(this, SIGNAL(textStyle(int)), m_Doc->scMW(), SLOT(setStyleEffects(int)));
+	//connect(this, SIGNAL(textFont(const QString&)), pp, SLOT(setFontFace(const QString&)));
+	//connect(this, SIGNAL(textSize(double)), pp, SLOT(setSize(double)));
 
 	return true;
 }
@@ -6321,49 +6266,21 @@
 
 	emit myself(this);
 	emit frameType(m_ItemType);
-/*CB using the emit myself* instead of all of these
-	emit position(Xpos, Ypos);
-	emit widthAndHeight(Width, Height);
-	emit rotation(Rot);
-	emit frameLocked(m_Locked);
-	emit frameSizeLocked(m_SizeLocked);
-	emit frameFlippedH(m_ImageIsFlippedH);
-	emit frameFlippedV(m_ImageIsFlippedV);
-	emit printEnabled(m_PrintEnabled);
-	emit lineWidth(m_lineWidth);
-	emit lineStyleCapJoin(PLineArt, PLineEnd, PLineJoin);
-	emit imageOffsetScale(LocalScX, LocalScY, LocalX, LocalY);
-*/
-//CB unused in 135 emit colors(lineColorVal, fillColorVal, lineShadeVal, fillShadeVal);
-//	emit gradientType(GrType);
+
+//CB unused in 135
 //	double dur=m_Doc->unitRatio();
-//	emit gradientColorUpdate(GrStartX*dur, GrStartY*dur, GrEndX*dur, GrEndY*dur, Width*dur, Height*dur);
-//	emit transparency(fillTransparencyVal, lineTransparencyVal);
 //	emit blendmode(fillBlendmodeVal, lineBlendmodeVal);
 /*CB using the emit myself* instead of all of these
-	emit patternFill(patternVal, patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
 	emit textToFrameDistances(Extra, TExtra, BExtra, RExtra);
-	emit columns(Cols, ColGap);
 */
-	if (m_Doc->appMode == modeEdit)
-	{
-/* maybe already done elsewhere? -- av
-		emit lineSpacing(currentStyle().lineSpacing());
-		emit textKerning(currentCharStyle().tracking());
-		emit textStyle(currentCharStyle().effects());
-		emit textFont(currentCharStyle().font()->scName());
-		emit textSize(currentCharStyle().fontSize());
-*/
-		//		emit textFormatting(currentStyle().alignment());
-	}
-	else
+	if (m_Doc->appMode != modeEdit)
 	{
 //TODO remove and use the emit myself
-		emit lineSpacing(itemText.defaultStyle().lineSpacing());
-		emit textKerning(itemText.defaultStyle().charStyle().tracking());
+		//emit lineSpacing(itemText.defaultStyle().lineSpacing());
+		//emit textKerning(itemText.defaultStyle().charStyle().tracking());
 		emit textStyle(itemText.defaultStyle().charStyle().effects());
-		emit textFont(itemText.defaultStyle().charStyle().font().scName());
-		emit textSize(itemText.defaultStyle().charStyle().fontSize());
+		//emit textFont(itemText.defaultStyle().charStyle().font().scName());
+		//emit textSize(itemText.defaultStyle().charStyle().fontSize());
 //		emit textFormatting(itemText.defaultStyle().alignment());
 	}
 }

Modified: trunk/Scribus/scribus/pageitem.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/pageitem.h
==============================================================================
--- trunk/Scribus/scribus/pageitem.h (original)
+++ trunk/Scribus/scribus/pageitem.h Sun Apr  3 15:06:46 2011
@@ -62,21 +62,19 @@
 class QFrame;
 class QGridLayout;
 
+class PageItem_Arc;
+class PageItem_Group;
 class PageItem_ImageFrame;
 class PageItem_Line;
+class PageItem_OSGFrame;
 class PageItem_Polygon;
 class PageItem_PolyLine;
 class PageItem_RegularPolygon;
 class PageItem_TextFrame;
 class PageItem_PathText;
 class PageItem_LatexFrame;
+class PageItem_Spiral;
 class PageItem_Symbol;
-class PageItem_Group;
-class PageItem_Arc;
-class PageItem_Spiral;
-#ifdef HAVE_OSG
-class PageItem_OSGFrame;
-#endif
 
 /**
   *@author Franz Schmid
@@ -197,9 +195,8 @@
 	virtual PageItem_PolyLine * asPolyLine() { return NULL; }
 	virtual PageItem_TextFrame * asTextFrame() { return NULL; }
 	virtual PageItem_LatexFrame * asLatexFrame() { return NULL; }
-#ifdef HAVE_OSG
+
 	virtual PageItem_OSGFrame * asOSGFrame() { return NULL; }
-#endif
 	virtual PageItem_Symbol * asSymbolFrame() { return NULL; }
 	virtual PageItem_Group * asGroupFrame() { return NULL; }
 	virtual PageItem_RegularPolygon * asRegularPolygon() { return NULL; }
@@ -1533,46 +1530,18 @@
 	//Frame signals
 	void myself(PageItem *);
 	void frameType(int);   // not related to Frametype but to m_itemIype :-/
-	void position(double, double); //X,Y
-	void widthAndHeight(double, double); //W,H
-	void rotation(double); //Degrees rotation	
-	void colors(QString, QString, double, double); //lineColor, fillColor, lineShade, fillShade
-	void gradientType(int); //Normal, horizontal, vertical, etc.
-	void patternFill(QString, double, double, double, double, double, double, double, bool, bool);
-	void gradientColorUpdate(double, double, double, double, double, double); //Cpal updatespecialgradient
-	void transparency(double, double); //fillTransparency, lineTransparency
-	void blendmode(int, int); //fillBlendmode, lineBlendmode
-	void frameLocked(bool); //Frame lock
-	void frameSizeLocked(bool); //Frame size lock
-	void frameFlippedH(bool); //Frame flipped horizontally
-	void frameFlippedV(bool); //Frame flipped vertically
-	void printEnabled(bool); //Frame is set to print or not
+	//void frameLocked(bool); //Frame lock
+	//void frameSizeLocked(bool); //Frame size lock
 	//Shape signals
-	void columns(int, double); //Number, gap
-	void cornerRadius(double); //Corner radius of the shape
-	//Line signals
-	void lineWidth(double);
-	void lineStyleCapJoin(Qt::PenStyle, Qt::PenCapStyle, Qt::PenJoinStyle);
+	//void cornerRadius(double); //Corner radius of the shape
 	//Frame text signals
-	void lineSpacing(double);
-	void textKerning(double);
+	//void lineSpacing(double);
+	//void textKerning(double);
 	void textStyle(int);
-	void textFont(const QString&);
-	void textSize(double);
-	void textWidthScale(double);
-	void textHeightScale(double);
-	void textBaseLineOffset(double);
-	void textOutline(double);
-	void textShadow(double, double);
-	void textUnderline(double, double);
-	void textStrike(double, double);
-	void textColor(QString, QString, double, double);
-	void textFormatting(int);
-	void textToFrameDistances(double, double, double, double); //left, top, bottom, right: Extra, TExtra, BExtra, RExtra
+	//void textFont(const QString&);
+	//void textSize(double);
+	//void textToFrameDistances(double, double, double, double); //left, top, bottom, right: Extra, TExtra, BExtra, RExtra
 	//FIXME: columns, grid ?
-	//Frame image signals
-	void imageOffsetScale(double, double, double, double);
-	void imageRotation(double);
 };
 
 Q_DECLARE_METATYPE(PageItem*);

Modified: trunk/Scribus/scribus/pageitem_group.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/pageitem_group.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_group.cpp (original)
+++ trunk/Scribus/scribus/pageitem_group.cpp Sun Apr  3 15:06:46 2011
@@ -24,6 +24,8 @@
 #include <cmath>
 #include <cassert>
 
+#include <QApplication>
+
 #include "commonstrings.h"
 #include "page.h"
 #include "pageitem_group.h"
@@ -155,7 +157,7 @@
 				p->save();
 				p->translate(embedded->gXpos, embedded->gYpos);
 				embedded->isEmbedded = true;
-				embedded->invalid = true;
+				embedded->invalidateLayout();
 				embedded->DrawObj(p, QRectF());
 				embedded->isEmbedded = false;
 				p->restore();
@@ -169,7 +171,7 @@
 				p->translate(embedded->gXpos, embedded->gYpos);
 				p->rotate(embedded->rotation());
 				embedded->isEmbedded = true;
-				embedded->invalid = true;
+				embedded->invalidateLayout();
 				if ((embedded->lineColor() != CommonStrings::None) && (embedded->lineWidth() != 0.0))
 				{
 					QColor tmp;

Modified: trunk/Scribus/scribus/pageitem_imageframe.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/pageitem_imageframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_imageframe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_imageframe.cpp Sun Apr  3 15:06:46 2011
@@ -22,6 +22,7 @@
  ***************************************************************************/
 
 // #include <QDebug>
+#include <QApplication>
 #include <QGridLayout>
 #include <QKeyEvent>
 

Modified: trunk/Scribus/scribus/pageitem_latexframe.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/pageitem_latexframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_latexframe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_latexframe.cpp Sun Apr  3 15:06:46 2011
@@ -24,6 +24,7 @@
 #include "pageitem_latexframe.h"
 
 #include <QDebug>
+#include <QMessageBox>
 #include <QTemporaryFile>
 
 #include "prefsmanager.h"
@@ -213,7 +214,7 @@
 	LocalScY = scaleY / pixm.imgInfo.yres;
 	LocalX   = offX   * pixm.imgInfo.xres;
 	LocalY   = offY   * pixm.imgInfo.yres;
-	emit imageOffsetScale(LocalScX, LocalScY, LocalX, LocalY);
+	//emit imageOffsetScale(LocalScX, LocalScY, LocalX, LocalY);
 	update();
 }
 

Modified: trunk/Scribus/scribus/pageitem_symbol.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/pageitem_symbol.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_symbol.cpp (original)
+++ trunk/Scribus/scribus/pageitem_symbol.cpp Sun Apr  3 15:06:46 2011
@@ -23,6 +23,8 @@
 
 #include <cmath>
 #include <cassert>
+
+#include <QApplication>
 
 #include "commonstrings.h"
 #include "page.h"

Modified: trunk/Scribus/scribus/pluginmanager.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/pluginmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/pluginmanager.cpp (original)
+++ trunk/Scribus/scribus/pluginmanager.cpp Sun Apr  3 15:06:46 2011
@@ -10,6 +10,7 @@
 
 #include <QDir>
 #include <QEvent>
+#include <QMessageBox>
 
 #include "scconfig.h"
 

Modified: trunk/Scribus/scribus/plugins/colorwheel/cwdialog.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/plugins/colorwheel/cwdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/colorwheel/cwdialog.cpp (original)
+++ trunk/Scribus/scribus/plugins/colorwheel/cwdialog.cpp Sun Apr  3 15:06:46 2011
@@ -6,6 +6,7 @@
 */
 
 #include <QHeaderView>
+#include <QMessageBox>
 
 #include "ui/cmykfw.h"
 #include "colorblind.h"

Modified: trunk/Scribus/scribus/plugins/gettext/pdbim/pdbim.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/plugins/gettext/pdbim/pdbim.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/gettext/pdbim/pdbim.cpp (original)
+++ trunk/Scribus/scribus/plugins/gettext/pdbim/pdbim.cpp Sun Apr  3 15:06:46 2011
@@ -4,8 +4,11 @@
 a copyright and/or license notice that predates the release of Scribus 1.3.2
 for which a new license (GPL+exception) is in place.
 */
+#include <QApplication>
 #include <QFile>
 #include <QFileInfo>
+#include <QMessageBox>
+#include <QProgressBar>
 #include <QString>
 #include <QStringList>
 #include <QTextCodec>

Modified: trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp Sun Apr  3 15:06:46 2011
@@ -18,6 +18,7 @@
 #include "undomanager.h"
 #include "util_formats.h"
 
+#include <QMessageBox>
 
 int importai_getPluginAPIVersion()
 {

Modified: trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp Sun Apr  3 15:06:46 2011
@@ -4,15 +4,17 @@
 a copyright and/or license notice that predates the release of Scribus 1.3.2
 for which a new license (GPL+exception) is in place.
 */
-#include <QWidget>
-#include <QFile>
-#include <QRegExp>
+
 #include <QCursor>
 #include <QDir>
+#include <QDrag>
+#include <QDomElement>
+#include <QFile>
+#include <QMessageBox>
+#include <QMimeData>
 #include <QString>
-#include <QDomElement>
-#include <QDrag>
-#include <QMimeData>
+#include <QRegExp>
+#include <QWidget>
 
 #include "oodrawimp.h"
 

Modified: trunk/Scribus/scribus/plugins/import/ps/importps.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/plugins/import/ps/importps.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/ps/importps.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/ps/importps.cpp Sun Apr  3 15:06:46 2011
@@ -11,6 +11,7 @@
 #include <QDrag>
 #include <QFile>
 #include <QList>
+#include <QMessageBox>
 #include <QMimeData>
 #include <QRegExp>
 #include <QStack>

Modified: trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp Sun Apr  3 15:06:46 2011
@@ -10,6 +10,7 @@
 #include <QDrag>
 #include <QFile>
 #include <QList>
+#include <QMessageBox>
 #include <QMimeData>
 #include <QPainterPath>
 #include <QRegExp>

Modified: trunk/Scribus/scribus/plugins/import/wmf/wmfimportplugin.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/plugins/import/wmf/wmfimportplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/wmf/wmfimportplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/wmf/wmfimportplugin.cpp Sun Apr  3 15:06:46 2011
@@ -7,9 +7,10 @@
 #include "scconfig.h"
 #include "wmfimportplugin.h"
 
+#include <QCursor>
 #include <QFile>
+#include <QMessageBox>
 #include <QRegExp>
-#include <QCursor>
 
 #include "ui/customfdialog.h"
 #include "scribus.h"

Modified: trunk/Scribus/scribus/plugins/scripter/api_page.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/plugins/scripter/api_page.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/api_page.cpp (original)
+++ trunk/Scribus/scribus/plugins/scripter/api_page.cpp Sun Apr  3 15:06:46 2011
@@ -290,10 +290,9 @@
                 pageXtoDocX(x) - x2, pageYtoDocY(y) - y2);
             ScCore->primaryMainWindow()->view->endGroupTransaction();
             ScCore->primaryMainWindow()->propertiesPalette->updateColorList();
-            ScCore->primaryMainWindow()->propertiesPalette->paraStyleCombo->updateFormatList();
-            ScCore->primaryMainWindow()->propertiesPalette->charStyleCombo->updateFormatList();
-            ScCore->primaryMainWindow()->propertiesPalette->SetLineFormats(
-                ScCore->primaryMainWindow()->doc);
+            ScCore->primaryMainWindow()->propertiesPalette->textPal->paraStyleCombo->updateFormatList();
+            ScCore->primaryMainWindow()->propertiesPalette->textPal->charStyleCombo->updateFormatList();
+            ScCore->primaryMainWindow()->propertiesPalette->linePal->updateLineStyles();
         }
     } else RAISE("Format plug-in not loaded.");
 }

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmddoc.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmddoc.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmddoc.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmddoc.cpp Sun Apr  3 15:06:46 2011
@@ -11,6 +11,8 @@
 #include "scribuscore.h"
 #include "scribusdoc.h"
 
+#include <QApplication>
+
 /*
 newDocument(size, margins, orientation, firstPageNumber,
             unit, pagesType, firstPageOrder)*/

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdmani.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdmani.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdmani.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdmani.cpp Sun Apr  3 15:06:46 2011
@@ -6,10 +6,11 @@
 */
 #include "cmdmani.h"
 #include "cmdutil.h"
-#include "ui/propertiespalette.h" //CB argh.. noooooooooooooooooooooooooooooooooooo FIXME see other FIXME
 #include "selection.h"
 #include "scribuscore.h"
 #include "scribusdoc.h"
+#include "ui/propertiespalette.h" //CB argh.. noooooooooooooooooooooooooooooooooooo FIXME see other FIXME
+#include "ui/propertiespalette_image.h"
 #include "undomanager.h"
 #include "sctextstream.h"
 
@@ -562,7 +563,7 @@
 	// Force the braindead app to notice the changes
 
 	//FIXME emit or something so we dont need this
-	ScCore->primaryMainWindow()->propertiesPalette->setScaleAndOffset(item->imageXScale(), item->imageYScale(), item->imageXOffset(), item->imageYOffset());
+	ScCore->primaryMainWindow()->propertiesPalette->imagePal->displayScaleAndOffset(item->imageXScale(), item->imageYScale(), item->imageXOffset(), item->imageYOffset());
 	item->AdjustPictScale();
 	//ScCore->primaryMainWindow()->view->AdjustPictScale(item);
 

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdpage.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdpage.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdpage.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdpage.cpp Sun Apr  3 15:06:46 2011
@@ -10,6 +10,8 @@
 #include "scribuscore.h"
 #include "commonstrings.h"
 #include "scribusdoc.h"
+
+#include <QApplication>
 
 PyObject *scribus_actualpage(PyObject* /* self */)
 {

Modified: trunk/Scribus/scribus/plugins/scriptplugin/guiapp.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/plugins/scriptplugin/guiapp.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/guiapp.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/guiapp.cpp Sun Apr  3 15:06:46 2011
@@ -7,8 +7,11 @@
 #include "guiapp.h"
 #include "cmdutil.h"
 #include "scribuscore.h"
+
+#include <QApplication>
+#include <QCursor>
+#include <QProgressBar>
 #include <QString>
-#include <QCursor>
 
 PyObject *scribus_messagebartext(PyObject* /* self */, PyObject* args)
 {

Modified: trunk/Scribus/scribus/plugins/scriptplugin/svgimport.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/plugins/scriptplugin/svgimport.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/svgimport.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/svgimport.cpp Sun Apr  3 15:06:46 2011
@@ -16,6 +16,8 @@
 #include "scribuscore.h"
 #include "selection.h"
 #include "ui/propertiespalette.h"
+#include "ui/propertiespalette_line.h"
+#include "ui/propertiespalette_text.h"
 
 #include <QString>
 
@@ -53,10 +55,7 @@
 				ScCore->primaryMainWindow()->view->startGroupTransaction();
 				ScCore->primaryMainWindow()->doc->moveGroup(pageUnitXToDocX(x) - x2, pageUnitYToDocY(y) - y2);
 				ScCore->primaryMainWindow()->view->endGroupTransaction();
-				ScCore->primaryMainWindow()->propertiesPalette->updateColorList();
-				ScCore->primaryMainWindow()->propertiesPalette->paraStyleCombo->updateFormatList();
-				ScCore->primaryMainWindow()->propertiesPalette->charStyleCombo->updateFormatList();
-				ScCore->primaryMainWindow()->propertiesPalette->SetLineFormats(ScCore->primaryMainWindow()->doc);
+				ScCore->primaryMainWindow()->requestUpdate(reqColorsUpdate | reqLineStylesUpdate | reqTextStylesUpdate);
 			}
 		}
 	}
@@ -90,10 +89,7 @@
 			ScCore->primaryMainWindow()->view->startGroupTransaction();
 			ScCore->primaryMainWindow()->doc->moveGroup(pageUnitXToDocX(x) - x2, pageUnitYToDocY(y) - y2);
 			ScCore->primaryMainWindow()->view->endGroupTransaction();
-			ScCore->primaryMainWindow()->propertiesPalette->updateColorList();
-			ScCore->primaryMainWindow()->propertiesPalette->paraStyleCombo->updateFormatList();
-			ScCore->primaryMainWindow()->propertiesPalette->charStyleCombo->updateFormatList();
-			ScCore->primaryMainWindow()->propertiesPalette->SetLineFormats(ScCore->primaryMainWindow()->doc);
+			ScCore->primaryMainWindow()->requestUpdate(reqColorsUpdate | reqLineStylesUpdate | reqTextStylesUpdate);
 		}
 	}
 	else
@@ -126,10 +122,7 @@
 			ScCore->primaryMainWindow()->view->startGroupTransaction();
 			ScCore->primaryMainWindow()->doc->moveGroup(pageUnitXToDocX(x) - x2, pageUnitYToDocY(y) - y2);
 			ScCore->primaryMainWindow()->view->endGroupTransaction();
-			ScCore->primaryMainWindow()->propertiesPalette->updateColorList();
-			ScCore->primaryMainWindow()->propertiesPalette->paraStyleCombo->updateFormatList();
-			ScCore->primaryMainWindow()->propertiesPalette->charStyleCombo->updateFormatList();
-			ScCore->primaryMainWindow()->propertiesPalette->SetLineFormats(ScCore->primaryMainWindow()->doc);
+			ScCore->primaryMainWindow()->requestUpdate(reqColorsUpdate | reqLineStylesUpdate | reqTextStylesUpdate);
 		}
 	}
 	else
@@ -162,10 +155,7 @@
 			ScCore->primaryMainWindow()->view->startGroupTransaction();
 			ScCore->primaryMainWindow()->doc->moveGroup(pageUnitXToDocX(x) - x2, pageUnitYToDocY(y) - y2);
 			ScCore->primaryMainWindow()->view->endGroupTransaction();
-			ScCore->primaryMainWindow()->propertiesPalette->updateColorList();
-			ScCore->primaryMainWindow()->propertiesPalette->paraStyleCombo->updateFormatList();
-			ScCore->primaryMainWindow()->propertiesPalette->charStyleCombo->updateFormatList();
-			ScCore->primaryMainWindow()->propertiesPalette->SetLineFormats(ScCore->primaryMainWindow()->doc);
+			ScCore->primaryMainWindow()->requestUpdate(reqColorsUpdate | reqLineStylesUpdate | reqTextStylesUpdate)
 		}
 	}
 	else
@@ -198,10 +188,7 @@
 			ScCore->primaryMainWindow()->view->startGroupTransaction();
 			ScCore->primaryMainWindow()->doc->moveGroup(pageUnitXToDocX(x) - x2, pageUnitYToDocY(y) - y2);
 			ScCore->primaryMainWindow()->view->endGroupTransaction();
-			ScCore->primaryMainWindow()->propertiesPalette->updateColorList();
-			ScCore->primaryMainWindow()->propertiesPalette->paraStyleCombo->updateFormatList();
-			ScCore->primaryMainWindow()->propertiesPalette->charStyleCombo->updateFormatList();
-			ScCore->primaryMainWindow()->propertiesPalette->SetLineFormats(ScCore->primaryMainWindow()->doc);
+			ScCore->primaryMainWindow()->requestUpdate(reqColorsUpdate | reqLineStylesUpdate | reqTextStylesUpdate)
 		}
 	}
 	else

Modified: trunk/Scribus/scribus/plugins/short-words/parse.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/plugins/short-words/parse.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/short-words/parse.cpp (original)
+++ trunk/Scribus/scribus/plugins/short-words/parse.cpp Sun Apr  3 15:06:46 2011
@@ -16,6 +16,7 @@
 or documentation
 */
 
+#include <QProgressBar>
 #include <QRegExp>
 
 #include "shortwords.h"

Modified: trunk/Scribus/scribus/plugins/tools/spellcheck/aspellplugin.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/plugins/tools/spellcheck/aspellplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/spellcheck/aspellplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/tools/spellcheck/aspellplugin.cpp Sun Apr  3 15:06:46 2011
@@ -11,6 +11,8 @@
 #include "scribus.h"
 #include "scribusdoc.h"
 #include "pageitem.h"
+
+#include <QMessageBox>
 
 // See scplugin.h and pluginmanager.{cpp,h} for detail on what these methods
 // do. That documentatation is not duplicated here.

Modified: trunk/Scribus/scribus/plugins/tools/spellcheck/aspellpluginimpl.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/plugins/tools/spellcheck/aspellpluginimpl.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/spellcheck/aspellpluginimpl.cpp (original)
+++ trunk/Scribus/scribus/plugins/tools/spellcheck/aspellpluginimpl.cpp Sun Apr  3 15:06:46 2011
@@ -15,7 +15,9 @@
 #include "pageitem_textframe.h"
 #include "text/specialchars.h"
 #include "util.h"
+
 #include <QMessageBox>
+#include <QProgressBar>
 
 const char* AspellPluginImpl::kDEF_CONTEXT = "AspellPlugin";
 const QString AspellPluginImpl::kDEF_ASPELL_ENTRY =

Modified: trunk/Scribus/scribus/scguardedptr.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/scguardedptr.h
==============================================================================
--- trunk/Scribus/scribus/scguardedptr.h (original)
+++ trunk/Scribus/scribus/scguardedptr.h Sun Apr  3 15:06:46 2011
@@ -22,7 +22,7 @@
 	int refs;
 	T* pointer;
 
-	ScGuardedPtrData(void) { pointer = NULL; refs = 0; }
+	ScGuardedPtrData(void) { pointer = 0; refs = 0; }
 	ScGuardedPtrData(T* ptr) { pointer = ptr; refs = 0; }
 };
 
@@ -40,6 +40,8 @@
 	ScGuardedPtr& operator=(const ScGuardedPtr& gPtr);
 	bool operator==( const ScGuardedPtr<T> &p ) const { return (T*)(*this) == (T*) p;}
 	bool operator!= ( const ScGuardedPtr<T>& p ) const { return !( *this == p ); }
+
+	bool isNull(void);
 
 	T* operator->() const { return (T*)(data ? data->pointer : 0); }
 	T& operator*() const { return *((T*)(data ? data->pointer : 0)); }
@@ -104,12 +106,20 @@
 };
 
 template<typename T>
+bool ScGuardedPtr<T>::isNull(void)
+{
+	if (data)
+		return (data->pointer == 0);
+	return true;
+};
+
+template<typename T>
 void ScGuardedPtr<T>::deref(void)
 {
 	if (data && --(data->refs) == 0)
 	{
 		delete data;
-		data = NULL;
+		data = 0;
 	}
 };
 
@@ -121,7 +131,7 @@
 template<typename T>
 ScGuardedObject<T>::ScGuardedObject(const ScGuardedObject& other)
 {
-	this->data=NULL;
+	this->data = 0;
 	// Must never be used
 	assert(false);
 };
@@ -138,7 +148,7 @@
 void ScGuardedObject<T>::nullify(void)
 {
 	if (this->data)
-		this->data->pointer = NULL;
+		this->data->pointer = 0;
 };
 
 template<typename T>

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Sun Apr  3 15:06:46 2011
@@ -21,6 +21,7 @@
  *                                                                         *
  ***************************************************************************/
 
+#include <QAction>
 #include <QApplication>
 #include <QByteArray>
 #include <QCloseEvent>
@@ -34,6 +35,7 @@
 #include <QEventLoop>
 #include <QFileDialog>
 #include <QFrame>
+#include <QFont>
 #include <QIcon>
 #include <QInputDialog>
 #include <QKeyEvent>
@@ -41,12 +43,17 @@
 #include <QLabel>
 #include <QList>
 #include <QLocale>
+#include <QMdiArea>
+#include <QMdiSubWindow>
+#include <QMessageBox>
 #include <QMouseEvent>
 #include <QPixmap>
+#include <QProgressBar>
 #include <QRegExp>
 #include <QStyleFactory>
 #include <QTableWidget>
 #include <QTextCodec>
+#include <QToolButton>
 #include <QTranslator>
 #include <QWheelEvent>
 
@@ -75,9 +82,55 @@
 #include <signal.h>
 #include <string>
 
+
+#include "actionmanager.h"
+#include "canvasmode.h"
+#include "commonstrings.h"
+#include "desaxe/digester.h"
+#include "desaxe/saxXML.h"
+#include "desaxe/simple_actions.h"
+#include "docinfo.h"
+#include "documentchecker.h"
+#include "documentinformation.h"
+#include "fileloader.h"
+#include "filewatcher.h"
+#include "fpoint.h"
+#include "fpointarray.h"
+#include "gtgettext.h"
+#include "hyphenator.h"
+#include "langmgr.h"
+#include "page.h"
+#include "pageitem_imageframe.h"
+#include "pageitem_latexframe.h"
+#include "pageitem_textframe.h"
+#include "pagesize.h"
+#include "pdflib.h"
+#include "pdfoptions.h"
+#include "pluginmanager.h"
+#include "plugins/formatidlist.h"
+#include "prefscontext.h"
+#include "prefsfile.h"
+#include "prefsmanager.h"
+#include "prefstable.h"
+#include "pslib.h"
+#include "resourcecollection.h"
+#include "sccolorengine.h"
+#include "scgtplugin.h"
+#include "scmimedata.h"
+#include "scpaths.h"
+#include "scprintengine_ps.h"
+#include "scraction.h"
+#include "scribus.h"
+#include "scribusdoc.h"
+#include "scribusXml.h"
+#include "scribusapp.h"
+#include "scribuscore.h"
+#include "scribusview.h"
+#include "scribuswin.h"
+#include "selection.h"
+#include "serializer.h"
 #include "ui/about.h"
 #include "ui/aboutplugins.h"
-#include "actionmanager.h"
 #include "ui/aligndistribute.h"
 #include "ui/annot.h"
 #include "ui/annota.h"
@@ -86,33 +139,19 @@
 #include "ui/autoform.h"
 #include "ui/basepointwidget.h"
 #include "ui/bookmarkpalette.h"
-#include "canvasmode.h"
 #include "ui/charselect.h"
 #include "ui/checkDocument.h"
 #include "ui/collectforoutput_ui.h"
 #include "ui/colorcombo.h"
-#include "commonstrings.h"
 #include "ui/contextmenu.h"
 #include "ui/cpalette.h"
 #include "ui/customfdialog.h"
 #include "ui/delpages.h"
-#include "desaxe/digester.h"
-#include "desaxe/saxXML.h"
-#include "desaxe/simple_actions.h"
-#include "docinfo.h"
-#include "documentchecker.h"
-#include "documentinformation.h"
 #include "ui/effectsdialog.h"
-#include "fileloader.h"
-#include "filewatcher.h"
 #include "ui/fontcombo.h"
-#include "fpoint.h"
-#include "fpointarray.h"
-#include "gtgettext.h"
 #include "ui/guidemanager.h"
 #include "ui/helpbrowser.h"
 #include "ui/hruler.h"
-#include "hyphenator.h"
 #include "ui/imageinfodialog.h"
 #include "ui/insertaframe.h"
 #include "ui/inspage.h"
@@ -137,56 +176,31 @@
 	#include "ui/osgeditor.h"
 #endif
 #include "ui/outlinepalette.h"
-#include "page.h"
-#include "pageitem_imageframe.h"
-#include "pageitem_latexframe.h"
-#include "pageitem_textframe.h"
 #include "ui/pageitemattributes.h"
 #include "ui/pagelayout.h"
 #include "ui/pagepalette.h"
 #include "ui/pageselector.h"
-#include "pagesize.h"
 #include "ui/paintmanager.h"
-#include "pdflib.h"
-#include "pdfoptions.h"
 #include "ui/pdfopts.h"
 #include "ui/picstatus.h"
-#include "pluginmanager.h"
-#include "plugins/formatidlist.h"
 #include "ui/polygonwidget.h"
 #include "ui/preferencesdialog.h"
-#include "prefscontext.h"
-#include "prefsfile.h"
-#include "prefsmanager.h"
-#include "prefstable.h"
 #include "ui/preview.h"
 #include "ui/printdialog.h"
 #include "ui/propertiespalette.h"
-#include "pslib.h"
+#include "ui/propertiespalette_image.h"
+#include "ui/propertiespalette_line.h"
+#include "ui/propertiespalette_shape.h"
+#include "ui/propertiespalette_text.h"
+#include "ui/propertiespalette_xyz.h"
 #include "ui/query.h"
 #include "ui/replacecolors.h"
-#include "resourcecollection.h"
-#include "sccolorengine.h"
 #include "ui/sccombobox.h"
-#include "scgtplugin.h"
 #include "ui/scmessagebox.h"
-#include "scmimedata.h"
-#include "scpaths.h"
-#include "scprintengine_ps.h"
-#include "scraction.h"
 #include "ui/scrapbookpalette.h"
-#include "scribus.h"
-#include "scribusdoc.h"
-#include "scribusXml.h"
-#include "scribusapp.h"
-#include "scribuscore.h"
-#include "scribusview.h"
-#include "scribuswin.h"
 #include "ui/scmwmenumanager.h"
+#include "ui/selectobjects.h"
 #include "ui/search.h"
-#include "selection.h"
-#include "ui/selectobjects.h"
-#include "serializer.h"
 #include "ui/smlinestyle.h"
 #include "ui/smtextstyles.h"
 #include "ui/splash.h"
@@ -291,6 +305,7 @@
 	CurrStED = NULL;
 	setWindowTitle( tr("Scribus " VERSION));
 	setAttribute(Qt::WA_KeyCompression, false);
+	setAttribute(Qt::WA_InputMethodEnabled, true);
 	setWindowIcon(loadIcon("AppIcon.png"));
 	scrActionGroups.clear();
 	scrActions.clear();
@@ -376,18 +391,7 @@
 
 	connect(ScCore->fileWatcher, SIGNAL(fileDeleted(QString )), this, SLOT(removeRecentFromWatcher(QString)));
 	connect(this, SIGNAL(TextStyle(const ParagraphStyle&)), propertiesPalette, SLOT(updateStyle(const ParagraphStyle&)));
-	connect(this, SIGNAL(TextIFont(QString)), propertiesPalette, SLOT(setFontFace(QString)));
-	connect(this, SIGNAL(TextISize(double)), propertiesPalette, SLOT(setSize(double)));
-	connect(this, SIGNAL(TextUSval(double)), propertiesPalette, SLOT(setExtra(double)));
-	connect(this, SIGNAL(TextStil(int)), propertiesPalette, SLOT(setStil(int)));
-	connect(this, SIGNAL(TextScale(double)), propertiesPalette, SLOT(setTScale(double)));
-	connect(this, SIGNAL(TextScaleV(double)), propertiesPalette, SLOT(setTScaleV(double)));
-	connect(this, SIGNAL(TextBase(double)), propertiesPalette, SLOT(setTBase(double)));
-	connect(this, SIGNAL(TextShadow(double, double )), propertiesPalette, SLOT(setShadowOffs(double, double )));
-	connect(this, SIGNAL(TextOutline(double)), propertiesPalette, SLOT(setOutlineW(double)));
-	connect(this, SIGNAL(TextUnderline(double, double)), propertiesPalette, SLOT(setUnderline(double, double)));
-	connect(this, SIGNAL(TextStrike(double, double)), propertiesPalette, SLOT(setStrike(double, double)));
-	connect(this, SIGNAL(TextFarben(QString, QString, double, double)), propertiesPalette, SLOT(setActFarben(QString, QString, double, double)));
+	connect(this, SIGNAL(TextEffects(int)), propertiesPalette, SLOT(setStil(int)));
 	connect(ClipB, SIGNAL(dataChanged()), this, SLOT(ClipChange()));
 //	connect(ClipB, SIGNAL(selectionChanged()), this, SLOT(ClipChange()));
 	setAcceptDrops(true);
@@ -492,14 +496,14 @@
 	outlinePalette->setMainWindow(this);
 	connect( scrActions["toolsOutline"], SIGNAL(toggled(bool)) , outlinePalette, SLOT(setPaletteShown(bool)) );
 	connect( outlinePalette, SIGNAL(paletteShown(bool)), scrActions["toolsOutline"], SLOT(setChecked(bool)));
+
 	propertiesPalette = new PropertiesPalette(this);
 	propertiesPalette->setMainWindow(this);
 	connect( scrActions["toolsProperties"], SIGNAL(toggled(bool)) , propertiesPalette, SLOT(setPaletteShown(bool)) );
 	connect( propertiesPalette, SIGNAL(paletteShown(bool)), scrActions["toolsProperties"], SLOT(setChecked(bool)));
-
 	//CB dont need this until we have a doc...
-	//propertiesPalette->Cpal->SetColors(prefsManager->colorSet());
-	propertiesPalette->Fonts->RebuildList(0);
+	//propertiesPalette->Cpal->setColors(prefsManager->colorSet());
+	emit UpdateRequest(reqDefFontListUpdate);
 	propertiesPalette->installEventFilter(this);
 	nodePalette = new NodePalette(this);
 	nodePalette->installEventFilter(this);
@@ -578,11 +582,11 @@
 	connect(outlinePalette, SIGNAL(selectElementByItem(PageItem *, bool)), this, SLOT(selectItemsFromOutlines(PageItem *, bool)));
 	connect(outlinePalette, SIGNAL(selectPage(int)), this, SLOT(selectPagesFromOutlines(int)));
 	connect(outlinePalette, SIGNAL(selectMasterPage(QString)), this, SLOT(manageMasterPages(QString)));
-	connect(propertiesPalette->paraStyleCombo, SIGNAL(newStyle(const QString&)), this, SLOT(setNewParStyle(const QString&)));
-	connect(propertiesPalette->charStyleCombo, SIGNAL(newStyle(const QString&)), this, SLOT(setNewCharStyle(const QString&)));
+	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()));
 
@@ -1094,29 +1098,15 @@
 	{
 //		int ChPos = qMin(currItem->CPos, static_cast<int>(currItem->itemText.length()-1));
 		const ParagraphStyle& currPStyle( (doc->appMode == modeEdit) ? currItem->currentStyle() : currItem->itemText.defaultStyle());
-		setAbsValue(currPStyle.alignment());
-		propertiesPalette->setParStyle(currPStyle.parent());
-		propertiesPalette->setCharStyle(currItem->currentCharStyle().parent());
+		setAlignmentValue(currPStyle.alignment());
+		propertiesPalette->textPal->displayParStyle(currPStyle.parent());
+		propertiesPalette->textPal->displayCharStyle(currItem->currentCharStyle().parent());
 		doc->currentStyle = currItem->currentStyle();
 		// #8112 : do not use operator= here as it does not update style features
 		doc->currentStyle.charStyle().setStyle( currItem->currentCharStyle() );
 		emit TextStyle(doc->currentStyle);
 		// to go: (av)
-		emit TextUnderline(doc->currentStyle.charStyle().underlineOffset(), doc->currentStyle.charStyle().underlineWidth());
-		emit TextStrike(doc->currentStyle.charStyle().strikethruOffset(), doc->currentStyle.charStyle().strikethruWidth());
-		emit TextShadow(doc->currentStyle.charStyle().shadowXOffset(), doc->currentStyle.charStyle().shadowYOffset());
-		emit TextFarben(doc->currentStyle.charStyle().strokeColor(),
-						doc->currentStyle.charStyle().fillColor(),
-						doc->currentStyle.charStyle().strokeShade(),
-						doc->currentStyle.charStyle().fillShade());
-		emit TextIFont(doc->currentStyle.charStyle().font().scName());
-		emit TextISize(doc->currentStyle.charStyle().fontSize());
-		emit TextUSval(doc->currentStyle.charStyle().tracking());
-		emit TextStil(doc->currentStyle.charStyle().effects());
-		emit TextScale(doc->currentStyle.charStyle().scaleH());
-		emit TextScaleV(doc->currentStyle.charStyle().scaleV());
-		emit TextBase(doc->currentStyle.charStyle().baselineOffset());
-		emit TextOutline(doc->currentStyle.charStyle().outlineWidth());
+		propertiesPalette->textPal->updateCharStyle(doc->currentStyle.charStyle());
 	}
 }
 
@@ -1253,6 +1243,17 @@
 	return retVal;
 }
 
+
+void ScribusMainWindow::inputMethodEvent ( QInputMethodEvent * event )
+{
+	qDebug() << "IMEmw" << event->commitString() << event->preeditString() << "attributes:" << event->attributes().count();
+}
+
+QVariant ScribusMainWindow::inputMethodQuery ( Qt::InputMethodQuery query ) const
+{
+	qDebug() << "IMQmw" << query;
+	return QVariant();
+}
 
 //AV -> CanvasMode
 void ScribusMainWindow::keyPressEvent(QKeyEvent *k)
@@ -1660,6 +1661,11 @@
 	qApp->exit(0);
 }
 
+void ScribusMainWindow::requestUpdate(int val)
+{
+	emit UpdateRequest(val);
+}
+
 /////////////////////////////////////////////////////////////////////
 // SLOT IMPLEMENTATION
 /////////////////////////////////////////////////////////////////////
@@ -1927,6 +1933,7 @@
 		else
 			doc->PageColors = prefsManager->appPrefs.colorPrefs.DColors;
 	}
+	tempDoc->PageColors.ensureDefaultColors();
 	tempDoc->setup(unitIndex, pageArrangement, firstPageLocation, orientation, firstPageNumber, defaultPageSize, newDocName);
 	if (requiresGUI)
 	{
@@ -2145,6 +2152,8 @@
 		if (!scw->doc()->hasGUI())
 			return;
 	}
+	if(scw == ActWin)
+		return;
 	ActWin = scw;
 	if (ActWin->doc()==NULL)
 		return;
@@ -2191,7 +2200,7 @@
 	connect(view, SIGNAL(signalGuideInformation(int, qreal)), alignDistributePalette, SLOT(setGuide(int, qreal)));
 	if (ScCore->usingGUI())
 	{
-		connect(doc->m_Selection, SIGNAL(selectionIsMultiple(bool)), propertiesPalette, SLOT( setMultipleSelection(bool)));
+		//connect(doc->m_Selection, SIGNAL(selectionIsMultiple(bool)), propertiesPalette, SLOT( setMultipleSelection(bool)));
 		connect(doc->m_Selection, SIGNAL(selectionIsMultiple(bool)), actionManager, SLOT( handleMultipleSelections(bool)));
 		//connect(doc->m_Selection, SIGNAL(empty()), propertiesPalette, SLOT( unsetItem()));
 	}
@@ -2288,9 +2297,8 @@
 	updateActiveWindowCaption(doc->DocName);
 // 	scrActions["shade100"]->setChecked(true);
 	propertiesPalette->setDoc(doc);
-	propertiesPalette->Cpal->ChooseGrad(0);
+	//propertiesPalette->Cpal->displayGradient(0);
 	pagePalette->setView(view);
-	propertiesPalette->Fonts->RebuildList(doc);
 	layerPalette->setDoc(doc);
 	guidePalette->setDoc(doc);
 	charPalette->setDoc(doc);
@@ -2494,7 +2502,7 @@
 // 	scrActions["shade100"]->setChecked(true);
 	propertiesPalette->setDoc(doc);
 	symbolPalette->setDoc(doc);
-	propertiesPalette->Cpal->ChooseGrad(0);
+//	propertiesPalette->Cpal->displayGradient(0);
 //	propertiesPalette->updateColorList();
 	pagePalette->setView(view);
 	layerPalette->setDoc(doc);
@@ -2519,21 +2527,16 @@
 	connect(view, SIGNAL(ClipPo(double, double)), nodePalette, SLOT(SetXY(double, double)), Qt::UniqueConnection);
 	connect(view, SIGNAL(PolyOpen()), nodePalette, SLOT(IsOpen()), Qt::UniqueConnection);
 	connect(view, SIGNAL(PStatus(int, uint)), nodePalette, SLOT(PolyStatus(int, uint)), Qt::UniqueConnection);
-	connect(view, SIGNAL(ItemPos(double, double)), propertiesPalette, SLOT(setXY(double, double)), Qt::UniqueConnection);
-	connect(view, SIGNAL(ItemGeom(double, double)), propertiesPalette, SLOT(setBH(double, double)), Qt::UniqueConnection);
+	connect(view, SIGNAL(ItemGeom()), propertiesPalette->xyzPal, SLOT(handleSelectionChanged()), Qt::UniqueConnection);
 	connect(view, SIGNAL(ChBMText(PageItem *)), this, SLOT(BookMarkTxT(PageItem *)), Qt::UniqueConnection);
 	connect(view, SIGNAL(HaveSel(int)), this, SLOT(HaveNewSel(int)), Qt::UniqueConnection);
-	connect(view, SIGNAL(SetAngle(double)), propertiesPalette, SLOT(setR(double)), Qt::UniqueConnection);
-	connect(view, SIGNAL(SetSizeValue(double)), propertiesPalette, SLOT(setLineWidth(double)), Qt::UniqueConnection);
-	connect(view, SIGNAL(SetLocalValues(double, double, double, double)), propertiesPalette, SLOT(setScaleAndOffset(double, double, double, double)), Qt::UniqueConnection);
-	connect(view, SIGNAL(SetLineArt(Qt::PenStyle, Qt::PenCapStyle, Qt::PenJoinStyle)), propertiesPalette, SLOT( setLIvalue(Qt::PenStyle, Qt::PenCapStyle, Qt::PenJoinStyle)), Qt::UniqueConnection);
-	connect(view, SIGNAL(ItemTextAttr(double)), propertiesPalette, SLOT(setLsp(double)), Qt::UniqueConnection);
-	connect(view, SIGNAL(ItemTextUSval(double)), propertiesPalette, SLOT(setExtra(double)), Qt::UniqueConnection);
+//	connect(view, SIGNAL(SetAngle(double)), propertiesPalette, SLOT(setR(double)), Qt::UniqueConnection);
+//	connect(view, SIGNAL(SetSizeValue(double)), propertiesPalette, SLOT(setLineWidth(double)), Qt::UniqueConnection);
+//	connect(view, SIGNAL(SetLocalValues(double, double, double, double)), propertiesPalette, SLOT(setScaleAndOffset(double, double, double, double)), Qt::UniqueConnection);
+//	connect(view, SIGNAL(SetLineArt(Qt::PenStyle, Qt::PenCapStyle, Qt::PenJoinStyle)), propertiesPalette, SLOT( setLIvalue(Qt::PenStyle, Qt::PenCapStyle, Qt::PenJoinStyle)), Qt::UniqueConnection);
+//	connect(view, SIGNAL(ItemTextAttr(double)), propertiesPalette, SLOT(setLsp(double)), Qt::UniqueConnection);
 //	connect(view, SIGNAL(ItemTextCols(int, double)), propertiesPalette, SLOT(setCols(int, double)), Qt::UniqueConnection);
-	connect(view, SIGNAL(SetDistValues(double, double, double, double)), propertiesPalette, SLOT(setTextToFrameDistances(double, double, double, double)), Qt::UniqueConnection);
-	connect(view, SIGNAL(ItemTextAbs(int)), propertiesPalette, SLOT(setAli(int)), Qt::UniqueConnection);
-	connect(view, SIGNAL(ItemTextFont(const QString&)), propertiesPalette, SLOT(setFontFace(const QString&)), Qt::UniqueConnection);
-	connect(view, SIGNAL(ItemTextSize(double)), propertiesPalette, SLOT(setSize(double)), Qt::UniqueConnection);
+//	connect(view, SIGNAL(SetDistValues(double, double, double, double)), propertiesPalette, SLOT(setTextToFrameDistances(double, double, double, double)), Qt::UniqueConnection);
 	//connect(view, SIGNAL(ItemRadius(double)), propertiesPalette, SLOT(setRR(double)), Qt::UniqueConnection);
 //	connect(view, SIGNAL(Amode(int)), this, SLOT(setAppMode(int)), Qt::UniqueConnection);
 	connect(view, SIGNAL(PaintingDone()), this, SLOT(slotSelect()), Qt::UniqueConnection);
@@ -2541,17 +2544,10 @@
 	//connect(view, SIGNAL(HavePoint(bool, bool)), nodePalette, SLOT(HaveNode(bool, bool)), Qt::UniqueConnection);
 	connect(view, SIGNAL(MousePos(double, double)), this, SLOT(setStatusBarMousePosition(double, double)), Qt::UniqueConnection);
 	//connect(view, SIGNAL(ItemRadius(double)), propertiesPalette, SLOT(setRR(double)), Qt::UniqueConnection);
-	connect(view, SIGNAL(ItemTextStil(int)), propertiesPalette, SLOT(setStil(int)), Qt::UniqueConnection);
-	connect(view, SIGNAL(ItemTextSca(double)), propertiesPalette, SLOT(setTScale(double)), Qt::UniqueConnection);
-	connect(view, SIGNAL(ItemTextScaV(double)), propertiesPalette, SLOT(setTScaleV(double)), Qt::UniqueConnection);
-	connect(view, SIGNAL(ItemTextBase(double)), propertiesPalette, SLOT(setTBase(double)), Qt::UniqueConnection);
-	connect(view, SIGNAL(ItemTextShadow(double, double )), propertiesPalette, SLOT(setShadowOffs(double, double )), Qt::UniqueConnection);
-	connect(view, SIGNAL(ItemTextUnderline(double, double)), propertiesPalette, SLOT(setUnderline(double, double)), Qt::UniqueConnection);
-	connect(view, SIGNAL(ItemTextStrike(double, double)), propertiesPalette, SLOT(setStrike(double, double)), Qt::UniqueConnection);
-	connect(view, SIGNAL(ItemTextOutline(double)), propertiesPalette, SLOT(setOutlineW(double)), Qt::UniqueConnection);
-	connect(view, SIGNAL(ItemTextStil(int)), this, SLOT(setStilvalue(int)), Qt::UniqueConnection);
-	connect(view, SIGNAL(ItemTextAbs(int)), this, SLOT(setAbsValue(int)), Qt::UniqueConnection);
-	connect(view, SIGNAL(ItemTextFarben(QString, QString, double, double)), propertiesPalette, SLOT(setActFarben(QString, QString, double, double)), Qt::UniqueConnection);
+	connect(view, SIGNAL(ItemCharStyle(const CharStyle&)), propertiesPalette->textPal, SLOT(updateCharStyle(const CharStyle&)), Qt::UniqueConnection);
+//	connect(view, SIGNAL(ItemTextEffects(int)), propertiesPalette, SLOT(setStil(int)), Qt::UniqueConnection);
+	connect(view, SIGNAL(ItemTextEffects(int)), this, SLOT(setStyleEffects(int)), Qt::UniqueConnection);
+	connect(view, SIGNAL(ItemTextAlign(int))  , this, SLOT(setAlignmentValue(int)), Qt::UniqueConnection);
 	connect(view, SIGNAL(HasTextSel()), this, SLOT(EnableTxEdit()), Qt::UniqueConnection);
 	connect(view, SIGNAL(HasNoTextSel()), this, SLOT(DisableTxEdit()), Qt::UniqueConnection);
 	connect(view, SIGNAL(CopyItem()), this, SLOT(slotEditCopy()), Qt::UniqueConnection);
@@ -2565,7 +2561,7 @@
 	connect(view, SIGNAL(DelBM(PageItem *)), this, SLOT(DelBookMark(PageItem *)), Qt::UniqueConnection);
 	connect(view, SIGNAL(DoGroup()), this, SLOT(GroupObj()), Qt::UniqueConnection);
 //	connect(view, SIGNAL(EndNodeEdit()), this, SLOT(ToggleFrameEdit()), Qt::UniqueConnection);
-	connect(view, SIGNAL(LevelChanged(uint )), propertiesPalette, SLOT(setLevel(uint)), Qt::UniqueConnection);
+//	connect(view, SIGNAL(LevelChanged(uint )), propertiesPalette, SLOT(setLevel(uint)), Qt::UniqueConnection);
 	connect(view, SIGNAL(callGimp()), this, SLOT(callImageEditor()), Qt::UniqueConnection);
 }
 
@@ -2759,7 +2755,6 @@
 
 		break;
 	case PageItem::TextFrame: //Text Frame
-		propertiesPalette->Fonts->RebuildList(doc, currItem->isAnnotation());
 		scrActions["fileImportText"]->setEnabled(true);
 		scrActions["fileImportText2"]->setEnabled(true);
 		scrActions["fileImportImage"]->setEnabled(false);
@@ -2842,20 +2837,12 @@
 		else
 		{
 			doc->currentStyle = currItem->itemText.defaultStyle();
-			propertiesPalette->setParStyle(doc->currentStyle.parent());
-			propertiesPalette->setCharStyle(doc->currentStyle.charStyle().parent());
+			propertiesPalette->textPal->displayParStyle(doc->currentStyle.parent());
+			propertiesPalette->textPal->displayCharStyle(doc->currentStyle.charStyle().parent());
 			emit TextStyle(doc->currentStyle);
 			// to go: (av)
-			emit TextStrike(doc->currentStyle.charStyle().strikethruOffset(), doc->currentStyle.charStyle().strikethruWidth());
-			emit TextUnderline(doc->currentStyle.charStyle().underlineOffset(), doc->currentStyle.charStyle().underlineWidth());
-			emit TextShadow(doc->currentStyle.charStyle().shadowXOffset(), doc->currentStyle.charStyle().shadowYOffset());
-			emit TextFarben(doc->currentStyle.charStyle().strokeColor(), doc->currentStyle.charStyle().fillColor(), doc->currentStyle.charStyle().strokeShade(), doc->currentStyle.charStyle().fillShade());
-			emit TextScale(doc->currentStyle.charStyle().scaleH());
-			emit TextScaleV(doc->currentStyle.charStyle().scaleV());
-			emit TextBase(doc->currentStyle.charStyle().baselineOffset());
-			emit TextOutline(doc->currentStyle.charStyle().outlineWidth());
-//			emit TextStil(doc->currentStyle.charStyle().effects());
-			setStilvalue(doc->currentStyle.charStyle().effects());
+			propertiesPalette->textPal->updateCharStyle(doc->currentStyle.charStyle());
+			setStyleEffects(doc->currentStyle.charStyle().effects());
 		}
 
 //		doc->docParagraphStyles[0].setLineSpacingMode(static_cast<ParagraphStyle::LineSpacingMode>(currItem->lineSpacingMode()));
@@ -2864,7 +2851,6 @@
 
 		break;
 	case PageItem::PathText: //Path Text
-		propertiesPalette->Fonts->RebuildList(doc, currItem->isAnnotation());
 		scrActions["fileImportText"]->setEnabled(true);
 		scrActions["fileImportText2"]->setEnabled(true);
 		scrActions["fileImportImage"]->setEnabled(false);
@@ -2917,20 +2903,12 @@
 		else
 		{
 			doc->currentStyle = currItem->itemText.defaultStyle();
-			propertiesPalette->setParStyle(doc->currentStyle.parent());
-			propertiesPalette->setCharStyle(doc->currentStyle.charStyle().parent());
+			propertiesPalette->textPal->displayParStyle(doc->currentStyle.parent());
+			propertiesPalette->textPal->displayCharStyle(doc->currentStyle.charStyle().parent());
 			emit TextStyle(doc->currentStyle);
 			// to go: (av)
-			emit TextStrike(doc->currentStyle.charStyle().strikethruOffset(), doc->currentStyle.charStyle().strikethruWidth());
-			emit TextUnderline(doc->currentStyle.charStyle().underlineOffset(), doc->currentStyle.charStyle().underlineWidth());
-			emit TextShadow(doc->currentStyle.charStyle().shadowXOffset(), doc->currentStyle.charStyle().shadowYOffset());
-			emit TextFarben(doc->currentStyle.charStyle().strokeColor(), doc->currentStyle.charStyle().fillColor(), doc->currentStyle.charStyle().strokeShade(), doc->currentStyle.charStyle().fillShade());
-			emit TextScale(doc->currentStyle.charStyle().scaleH());
-			emit TextScaleV(doc->currentStyle.charStyle().scaleV());
-			emit TextBase(doc->currentStyle.charStyle().baselineOffset());
-			emit TextOutline(doc->currentStyle.charStyle().outlineWidth());
-//			emit TextStil(doc->currentStyle.charStyle().effects());
-			setStilvalue(doc->currentStyle.charStyle().effects());
+			propertiesPalette->textPal->updateCharStyle(doc->currentStyle.charStyle());
+			setStyleEffects(doc->currentStyle.charStyle().effects());
 		}
 		break;
 	default:
@@ -3021,7 +2999,7 @@
 		break;
 	}
 	doc->CurrentSel = SelectedType;
-	propertiesPalette->RotationGroup->setCheckedId(doc->RotMode());
+	propertiesPalette->xyzPal->basePointWidget->setCheckedId(doc->RotMode());
 	if (docSelectionCount > 1)
 	{
 		if (!doc->m_Selection->itemsAreSameType())
@@ -3143,16 +3121,15 @@
 		scrActions["itemPrintingEnabled"]->setChecked(currItem->printEnabled());
 	}
 
-	//propertiesPalette->NewSel(SelectedType);
 	if (SelectedType != -1)
 	{
-		//propertiesPalette->SetCurItem(currItem);
+		//propertiesPalette->setCurrentItem(currItem);
 		outlinePalette->slotShowSelect(currItem->OwnPage, currItem->ItemNr);
 		actionManager->connectNewSelectionActions(view, doc);
-// 		propertiesPalette->NewSel(SelectedType);
+// 		propertiesPalette->handleSelectionChanged();
 	}
 	else
-		propertiesPalette->NewSel(SelectedType);
+		propertiesPalette->handleSelectionChanged();
 
 	PluginManager& pluginManager(PluginManager::instance());
 	QStringList pluginNames(pluginManager.pluginNames(false));
@@ -3340,10 +3317,7 @@
 				double x2, y2, w, h;
 				doc->m_Selection->getGroupRect(&x2, &y2, &w, &h);
 				doc->moveGroup(doc->currentPage()->xOffset() - x2, doc->currentPage()->yOffset() - y2);
-				propertiesPalette->updateColorList();
-				propertiesPalette->paraStyleCombo->updateFormatList();
-				propertiesPalette->charStyleCombo->updateFormatList();
-				propertiesPalette->SetLineFormats(doc);
+				emit UpdateRequest(reqColorsUpdate|reqTextStylesUpdate|reqLineStylesUpdate);
 			}
 		}
 		else if (rasterFiles.contains(fi.suffix().toLower()))
@@ -3519,8 +3493,7 @@
 {
 	if (HaveDoc)
 	{
-		propertiesPalette->updateColorList();
-		propertiesPalette->SetLineFormats(doc);
+		requestUpdate(reqColorsUpdate | reqLineStylesUpdate);
 		styleManager->updateColorList();
 	}
 }
@@ -3677,11 +3650,7 @@
 //		if ((docItemsCount - oldItemsCount) > 1)
 //			doc->GroupCounter++;
 		propertiesPalette->updateColorList();
-		propertiesPalette->paraStyleCombo->setDoc(doc);
-		propertiesPalette->charStyleCombo->setDoc(doc);
-		propertiesPalette->SetLineFormats(doc);
-		propertiesPalette->startArrow->rebuildList(&doc->arrowStyles());
-		propertiesPalette->endArrow->rebuildList(&doc->arrowStyles());
+		emit UpdateRequest(reqArrowStylesUpdate | reqLineStylesUpdate | reqStyleComboDocUpdate);
 		symbolPalette->updateSymbolList();
 //		if (!Mpa)
 //		{
@@ -3963,7 +3932,7 @@
 			doc->cmsSettings().CMSinUse = false;
 		}
 //		propertiesPalette->updateColorList();
-//		propertiesPalette->Cpal->ChooseGrad(0);
+//		propertiesPalette->Cpal->displayGradient(0);
 		if (fileLoader->FileType > FORMATID_NATIVEIMPORTEND)
 		{
 			doc->setName(FName+ tr("(converted)"));
@@ -3975,7 +3944,7 @@
 		doc->setMasterPageMode(false);
 		doc->setHyphLanguage(GetLang(doc->hyphLanguage()));
 		HaveNewDoc();
-//		propertiesPalette->Cpal->ChooseGrad(0);
+//		propertiesPalette->Cpal->displayGradient(0);
 //		propertiesPalette->updateCList();
 		doc->hasName = true;
 		if (doc->MasterPages.count() == 0)
@@ -4133,11 +4102,10 @@
 				qApp->changeOverrideCursor( QCursor(Qt::WaitCursor) );
 				qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
 				doc->LoadPict(fileName, currItem->ItemNr, false, true);
-				propertiesPalette->setScaleAndOffset(currItem->imageXScale(), currItem->imageYScale(), currItem->imageXOffset(), currItem->imageYOffset());
+				propertiesPalette->imagePal->displayScaleAndOffset(currItem->imageXScale(), currItem->imageYScale(), currItem->imageXOffset(), currItem->imageYOffset());
 				qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
 				view->DrawNew();
-				propertiesPalette->updateColorList();
-				propertiesPalette->ShowCMS();
+				emit UpdateRequest(reqColorsUpdate | reqCmsOptionsUpdate);
 				currItem->emitAllToGUI();
 			}
 		}
@@ -4222,11 +4190,10 @@
 					currItem->Pfile = fileName;
 					img.save(fileName, "PNG");
 					doc->LoadPict(fileName, currItem->ItemNr, false, true);
-					propertiesPalette->setScaleAndOffset(currItem->imageXScale(), currItem->imageYScale(), currItem->imageXOffset(), currItem->imageYOffset());
+					propertiesPalette->imagePal->displayScaleAndOffset(currItem->imageXScale(), currItem->imageYScale(), currItem->imageXOffset(), currItem->imageYOffset());
 					qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
 					view->DrawNew();
-					propertiesPalette->updateColorList();
-					propertiesPalette->ShowCMS();
+					emit UpdateRequest(reqColorsUpdate | reqCmsOptionsUpdate);
 					currItem->emitAllToGUI();
 				}
 			}
@@ -4647,8 +4614,7 @@
 		scrActions["toolsPDFAnnot3D"]->setEnabled(false);
 #endif
 		//CB dont need this until we have a doc...
-		//propertiesPalette->Cpal->SetColors(prefsManager->colorSet());
-		propertiesPalette->Cpal->ChooseGrad(0);
+		//propertiesPalette->Cpal->setColors(prefsManager->colorSet());
 		mainWindowStatusLabel->setText( tr("Ready"));
 		PrinterUsed = false;
 	}
@@ -5148,11 +5114,10 @@
 				if (docSelectionCount > 1)
 				{
 					doc->m_Selection->setGroupRect();
-//					view->paintGroupRect();
-					double x, y, w, h;
-					doc->m_Selection->getGroupRect(&x, &y, &w, &h);
-					propertiesPalette->setXY(x, y);
-					propertiesPalette->setBH(w, h);
+					//double x, y, w, h; //CHECKME
+					//doc->m_Selection->getGroupRect(&x, &y, &w, &h);
+					//propertiesPalette->setXY(x, y);
+					//propertiesPalette->setBH(w, h);
 				}
 				if (docSelectionCount > 0)
 					HaveNewSel(doc->m_Selection->itemAt(0)->itemType());
@@ -5243,8 +5208,9 @@
 			double x, y, w, h;
 			doc->m_Selection->setGroupRect();
 			doc->m_Selection->getGroupRect(&x, &y, &w, &h);
-			propertiesPalette->setXY(x, y);
-			propertiesPalette->setBH(w, h);
+			//Now unuseful as PropertiesPalette_XYZ::setCurrentItem() handles multiple selection
+			//propertiesPalette->setXY(x, y);
+			//propertiesPalette->setBH(w, h);
 		}
 		if (docSelectionCount > 0)
 		{
@@ -5307,11 +5273,12 @@
 		}
 		if (docSelectionCount > 1)
 		{
-			double x, y, w, h;
+			//double x, y, w, h; //CHECKME
 			doc->m_Selection->setGroupRect();
-			doc->m_Selection->getGroupRect(&x, &y, &w, &h);
-			propertiesPalette->setXY(x, y);
-			propertiesPalette->setBH(w, h);
+			//doc->m_Selection->getGroupRect(&x, &y, &w, &h);
+			//Now unuseful as PropertiesPalette_XYZ::setCurrentItem() handles multiple selection
+			//propertiesPalette->setXY(x, y);
+			//propertiesPalette->setBH(w, h);
 		}
 		if (docSelectionCount > 0)
 		{
@@ -6535,7 +6502,7 @@
 			doc->SubMode = modeToolBar->SubMode;
 			doc->ShapeValues = modeToolBar->ShapeVals;
 			doc->ValCount = modeToolBar->ValCount;
-			propertiesPalette->SCustom->setIcon(propertiesPalette->SCustom->getIconPixmap(doc->SubMode));
+			emit UpdateRequest(reqCustomShapeUpdate);
 		}
 		else
 			doc->SubMode = -1;
@@ -6654,10 +6621,10 @@
 		if (scrActions["typeEffectOutline"]->isChecked())
 			b |= 4;
 	}
-	setItemHoch(b);
-}
-
-void ScribusMainWindow::setStilvalue(int s)
+	setItemEffects(b);
+}
+
+void ScribusMainWindow::setStyleEffects(int s)
 {
 	int c = s & 1919;
 //	doc->currentStyle.charStyle().setFeatures(static_cast<StyleFlag>(c).featureList());
@@ -6671,15 +6638,15 @@
 	scrActions["typeEffectSmallCaps"]->setChecked(c & 64);
 	scrActions["typeEffectShadow"]->setChecked(c & 256);
 	scrActions["typeEffectUnderlineWords"]->setChecked(c & 512);
-	emit TextStil(s);
-}
-
-void ScribusMainWindow::setItemHoch(int h)
+	emit TextEffects(s);
+}
+
+void ScribusMainWindow::setItemEffects(int h)
 {
 	if (doc->m_Selection->count() != 0)
 	{
 //		doc->currentStyle.charStyle().setFeatures(static_cast<StyleFlag>(h).featureList());
-		setStilvalue(h);
+		setStyleEffects(h);
 		doc->itemSelection_SetEffects(h);
 	}
 }
@@ -6915,7 +6882,7 @@
 		}
 		delete dia;
 	}
-	propertiesPalette->setSize(c*10);
+	propertiesPalette->textPal->displayFontSize(c*10);
 // 	slotDocCh();
 }
 
@@ -7282,9 +7249,7 @@
 		}
 	}
 
-	propertiesPalette->paraStyleCombo->updateFormatList();
-	propertiesPalette->charStyleCombo->updateFormatList();
-	propertiesPalette->updateColorList();
+	emit UpdateRequest(reqColorsUpdate | reqTextStylesUpdate);
 	view->DrawNew();
 	slotDocCh();
 }
@@ -7296,7 +7261,7 @@
 	{
 //		doc->currentStyle.setAlignment(static_cast<ParagraphStyle::AlignmentType>(a));
 		doc->itemSelection_SetAlignment(a);
-		propertiesPalette->setAli(a);
+		propertiesPalette->textPal->displayAlignment(a);
 		PageItem *currItem = doc->m_Selection->itemAt(0);
 		setTBvals(currItem);
 	}
@@ -7334,11 +7299,11 @@
 	}
 }
 
-void ScribusMainWindow::setAbsValue(int a)
+void ScribusMainWindow::setAlignmentValue(int a)
 {
 //	doc->currentStyle = doc->docParagraphStyles[a];
 //	doc->currentStyle.setAlignment(static_cast<ParagraphStyle::AlignmentType>(a<5 ? a : 0));
-	propertiesPalette->setAli(a);
+	propertiesPalette->textPal->displayAlignment(a);
 	QString alignment[] = {"Left", "Center", "Right", "Block", "Forced"};
 	for (int b=0; b<5; ++b)
 	{
@@ -7346,22 +7311,6 @@
 		if (scrActions[actionName])
 			scrActions[actionName]->setChecked(a==b);
 	}
-}
-
-void ScribusMainWindow::updtGradFill()
-{
-	if (!HaveDoc)
-		return;
-	VGradient vg(propertiesPalette->getFillGradient());
-	doc->itemSelection_SetFillGradient(vg);
-}
-
-void ScribusMainWindow::updtGradStroke()
-{
-	if (!HaveDoc)
-		return;
-	VGradient vg(propertiesPalette->getStrokeGradient());
-	doc->itemSelection_SetLineGradient(vg);
 }
 
 void ScribusMainWindow::updtGradMask()
@@ -7379,18 +7328,7 @@
 	VGradient vg(propertiesPalette->getMaskGradientGroup());
 	doc->itemSelection_SetMaskGradient(vg);
 }
-/*
-//CB-->Doc
-void ScribusMainWindow::GetBrushPen()
-{
-	//What? we come back here from mpalette and then go to the view.. someones kidding
-	if (!HaveDoc)
-		return;
-	view->QueryFarben();
-	//CB We dont need to set the doc changed just to find the colour values...
-	//slotDocCh();
-}
-*/
+
 //CB-->??
 void ScribusMainWindow::MakeFrame(int f, int c, double *vals)
 {
@@ -7411,7 +7349,7 @@
 		currItem->FrameType = f+2;
 		break;
 	}
-	//propertiesPalette->SetCurItem(currItem);
+	//propertiesPalette->setCurrentItem(currItem);
 	currItem->update();
 	slotDocCh();
 }
@@ -7585,7 +7523,7 @@
 		apf.setPointSize(prefsManager->appPrefs.uiPrefs.applicationFontSize);
 		qApp->setFont(apf);
 	}
-	propertiesPalette->Fonts->RebuildList(0);
+	propertiesPalette->textPal->Fonts->RebuildList(0);
 	ScCore->getCMSProfiles(false);
 	ScCore->recheckGS();
 	prefsManager->applyLoadedShortCuts();
@@ -7693,7 +7631,7 @@
 			apf.setPointSize(newUIFontSize);
 			qApp->setFont(apf);
 		}
-		propertiesPalette->Fonts->RebuildList(0);
+		emit UpdateRequest(reqDefFontListUpdate);
 		if (prefsManager->appPrefs.uiPrefs.useTabs)
 			mdiArea->setViewMode(QMdiArea::TabbedView);
 		else
@@ -7776,7 +7714,7 @@
 		view->previewQualitySwitcher->setCurrentIndex(doc->itemToolPrefs().imageLowResType);
 		view->previewQualitySwitcher->blockSignals(false);
 	}
-	propertiesPalette->Fonts->RebuildList(doc);
+	propertiesPalette->textPal->Fonts->RebuildList(doc);
 	scrActions["viewShowMargins"]->setChecked(doc->guidesPrefs().marginsShown);
 	scrActions["viewShowBleeds"]->setChecked(doc->guidesPrefs().showBleed);
 	scrActions["viewShowFrames"]->setChecked(doc->guidesPrefs().framesShown);
@@ -7804,7 +7742,7 @@
 	view->reformPages();
 	view->GotoPage(doc->currentPage()->pageNr());
 	view->DrawNew();
-	propertiesPalette->ShowCMS();
+	propertiesPalette->imagePal->showCMSOptions();
 	pagePalette->rebuildPages();
 }
 
@@ -7853,7 +7791,7 @@
 			view->previewQualitySwitcher->setCurrentIndex(doc->itemToolPrefs().imageLowResType);
 			view->previewQualitySwitcher->blockSignals(false);
 		}
-		propertiesPalette->Fonts->RebuildList(doc);
+		emit UpdateRequest(reqDocFontListUpdate);
 		scrActions["viewShowMargins"]->setChecked(doc->guidesPrefs().marginsShown);
 		scrActions["viewShowBleeds"]->setChecked(doc->guidesPrefs().showBleed);
 		scrActions["viewShowFrames"]->setChecked(doc->guidesPrefs().framesShown);
@@ -7876,8 +7814,8 @@
 		view->reformPages();
 		view->GotoPage(doc->currentPage()->pageNr());
 		view->DrawNew();
-		propertiesPalette->ShowCMS();
 		pagePalette->rebuildPages();
+		emit UpdateRequest(reqCmsOptionsUpdate);
 	}
 }
 int ScribusMainWindow::ShowSubs()
@@ -8467,10 +8405,7 @@
 		vie->DrawNew();
 		if (doc == docc)
 		{
-			propertiesPalette->updateColorList();
-			propertiesPalette->paraStyleCombo->updateFormatList();
-			propertiesPalette->charStyleCombo->updateFormatList();
-			propertiesPalette->SetLineFormats(docc);
+			emit UpdateRequest(reqColorsUpdate | reqTextStylesUpdate | reqLineStylesUpdate);
 			slotDocCh();
 		}
 	}
@@ -9466,10 +9401,10 @@
 	currItem->CPos = 0;
 	SearchReplace* dia = new SearchReplace(this, doc, currItem);
 	connect(dia, SIGNAL(NewFont(const QString&)), this, SLOT(SetNewFont(const QString&)));
-	connect(dia, SIGNAL(NewAbs(int)), this, SLOT(setAbsValue(int)));
+	connect(dia, SIGNAL(NewAbs(int)), this, SLOT(setAlignmentValue(int)));
 	dia->exec();
 	disconnect(dia, SIGNAL(NewFont(const QString&)), this, SLOT(SetNewFont(const QString&)));
-	disconnect(dia, SIGNAL(NewAbs(int)), this, SLOT(setAbsValue(int)));
+	disconnect(dia, SIGNAL(NewAbs(int)), this, SLOT(setAlignmentValue(int)));
 	delete dia;
 	slotSelect();
 }
@@ -9903,7 +9838,7 @@
 				qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
 				view->DrawNew();
 				propertiesPalette->updateColorList();
-				propertiesPalette->ShowCMS();
+				emit UpdateRequest(reqCmsOptionsUpdate);
 				currItem->emitAllToGUI();
 			}
 		}
@@ -10080,7 +10015,7 @@
 			// Update tools colors if needed
 			prefsManager->replaceToolColors(dia->replaceColorMap);
 			prefsManager->setColorSet(dia->m_colorList);
-			propertiesPalette->Cpal->SetColors(prefsManager->colorSet());
+			propertiesPalette->Cpal->setColors(prefsManager->colorSet());
 			prefsManager->appPrefs.defaultGradients = dia->dialogGradients;
 			prefsManager->appPrefs.defaultPatterns = dia->dialogPatterns;
 			QString Cpfad = QDir::convertSeparators(ScPaths::getApplicationDataDir())+"DefaultColors.xml";
@@ -10123,8 +10058,7 @@
 			doc->replaceLineStyleColors(dia2->replaceMap);
 			doc->recalculateColors();
 			doc->recalcPicturesRes();
-			propertiesPalette->updateColorList();
-			propertiesPalette->SetLineFormats(doc);
+			requestUpdate(reqColorsUpdate | reqLineStylesUpdate);
 			styleManager->updateColorList();
 			if (doc->m_Selection->count() != 0)
 				doc->m_Selection->itemAt(0)->emitAllToGUI();

Modified: trunk/Scribus/scribus/scribus.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/scribus.h
==============================================================================
--- trunk/Scribus/scribus/scribus.h (original)
+++ trunk/Scribus/scribus/scribus.h Sun Apr  3 15:06:46 2011
@@ -30,39 +30,28 @@
 #include <vector>
 
 // include files for QT
-#include <QAction>
+
 #include <QActionGroup>
-#include <QApplication>
 #include <QClipboard>
-#include <QCloseEvent>
-#include <QDragEnterEvent>
-#include <QDropEvent>
-#include <QEvent>
-#include <QFont>
 #include <QKeyEvent>
-#include <QLabel>
 #include <QMainWindow>
 #include <QMap>
-#include <QMenu>
-#include <QMenuBar>
-#include <QMessageBox>
-#include <QMouseEvent>
 #include <QMultiHash>
-#include <QPainter>
 #include <QPixmap>
 #include <QPointer>
 #include <QProcess>
-#include <QProgressBar>
-#include <QProgressDialog>
-#include <QStatusBar>
 #include <QString>
-#include <QTimer>
-#include <QToolButton>
-#include <QToolTip>
-#include <QWheelEvent>
-#include <QMdiArea>
-#include <QMdiSubWindow>
-
+
+class QCloseEvent;
+class QDragEnterEvent;
+class QDropEvent;
+class QEvent;
+class QKeyEvent;
+class QLabel;
+class QMdiArea;
+class QMdiSubWindow;
+class QProgressBar;
+class QToolButton;
 
 // application specific includes
 #include "scribusapi.h"
@@ -154,6 +143,9 @@
 	void closeEvent(QCloseEvent *ce);
 	void keyPressEvent(QKeyEvent *k);
 	void keyReleaseEvent(QKeyEvent *k);
+	void inputMethodEvent ( QInputMethodEvent * event );
+	QVariant inputMethodQuery ( Qt::InputMethodQuery query ) const ;
+	void requestUpdate(int);
 	void setTBvals(PageItem *currItem);
 	int ShowSubs();
 	void applyNewMaster(QString name);
@@ -466,8 +458,6 @@
 	void setBrushShade(int sh);
 	void setGradFill(int typ);
 	*/
-	void updtGradFill();
-	void updtGradStroke();
 	void updtGradMask();
 	void updtGradMaskGroup();
 	/*
@@ -477,8 +467,6 @@
 	void setBrushFarbe(QString farbe);
 	*/
 	//CB: void setCSMenu();
-	/** Fragt nach den Farben */
-//	void GetBrushPen();
 	/** Erzeugt einen Rahmen */
 	void MakeFrame(int f, int c, double *vals);
 	//** Loescht ein Element */
@@ -496,7 +484,7 @@
 	void setNewAlignment(int a);
 	void setNewParStyle(const QString& name);
 	void setNewCharStyle(const QString& name);
-	void setAbsValue(int a);
+	void setAlignmentValue(int a);
 	void selectItemsFromOutlines(PageItem *ite, bool single = false);
 	void selectItemsFromOutlines(int Page, int Item, bool single = false);
 	void selectPagesFromOutlines(int Page);
@@ -507,8 +495,8 @@
 	void SaveAsPDF();
 	void doSaveAsPDF();
 	void setMainWindowActive();
-	void setItemHoch(int h);
-	void setStilvalue(int s);
+	void setItemEffects(int h);
+	void setStyleEffects(int s);
 	void setItemTypeStyle(int id);
 	void slotElemRead(QString Name, double x, double y, bool art, bool loca, ScribusDoc* docc, ScribusView* vie);
 	void slotChangeUnit(int art, bool draw = true);
@@ -573,18 +561,8 @@
 signals:
 	void TextStyle(const ParagraphStyle&);
 //deprecated: (av)
-	void TextISize(double);
-	void TextIFont(const QString&);
-	void TextUSval(double);
-	void TextStil(int);
-	void TextFarben(QString, QString, double, double);
-	void TextScale(double);
-	void TextScaleV(double);
-	void TextBase(double);
-	void TextShadow(double, double);
-	void TextOutline(double);
-	void TextUnderline(double, double);
-	void TextStrike(double, double);
+	void TextEffects(int);
+	void UpdateRequest(int updateFlags);
 
 protected:
 	/*!

Modified: trunk/Scribus/scribus/scribuscore.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/scribuscore.cpp
==============================================================================
--- trunk/Scribus/scribus/scribuscore.cpp (original)
+++ trunk/Scribus/scribus/scribuscore.cpp Sun Apr  3 15:06:46 2011
@@ -24,6 +24,7 @@
 #include <QByteArray>
 #include <QDebug>
 #include <QGlobalStatic>
+#include <QMessageBox>
 
 #include "commonstrings.h"
 #include "filewatcher.h"

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Sun Apr  3 15:06:46 2011
@@ -1419,10 +1419,6 @@
 {
 	m_Selection->delaySignalsOff();
 	m_docUpdater->endUpdate();
-	// #9500 : Ensure PP is properly disabled when selection is empty
-	// after undoing or redoing an action
-	if (m_Selection->count() == 0)
-		emit firstSelectedItemType(-1);
 }
 
 void ScribusDoc::restore(UndoState* state, bool isUndo)
@@ -2105,15 +2101,14 @@
 		{
 			sourceSelection.addItem(itemToCopy);
 		}
-		if (sourceSelection.count() != 0)
-		{
-			ScriXmlDoc *ss = new ScriXmlDoc();
-			QString dataS = ss->WriteElem(this, &sourceSelection);
-			ss->ReadElemToLayer(dataS, appPrefsData.fontPrefs.AvailFonts, this, Pages->at(0)->xOffset(), Pages->at(0)->yOffset(), false, true, appPrefsData.fontPrefs.GFontSub, whereToInsert);
-			delete ss;
-		}
-		sourceSelection.clear();
-	}
+	}
+	if (sourceSelection.count() != 0)
+	{
+		ScriXmlDoc ss;
+		QString dataS = ss.WriteElem(this, &sourceSelection);
+		ss.ReadElemToLayer(dataS, appPrefsData.fontPrefs.AvailFonts, this, Pages->at(0)->xOffset(), Pages->at(0)->yOffset(), false, true, appPrefsData.fontPrefs.GFontSub, whereToInsert);
+	}
+	sourceSelection.clear();
 }
 
 
@@ -8674,6 +8669,23 @@
 	emit firstSelectedItemType(m_Selection->itemAt(0)->itemType());
 }
 
+void ScribusDoc::itemSelection_Rotate(double angle, Selection* customSelection)
+{
+	Selection* itemSelection = (customSelection!=0) ? customSelection : m_Selection;
+	assert(itemSelection!=0);
+
+	if (itemSelection->count() == 0) return;
+	
+	if (itemSelection->count() > 1)
+	{
+		rotateGroup(angle, itemSelection);
+	}
+	else if (itemSelection->count() == 1)
+	{
+		RotateItem(angle, itemSelection->itemAt(0));
+	}
+	changed();
+}
 
 void ScribusDoc::itemSelection_ChangePreviewResolution(int id)
 {
@@ -8782,6 +8794,57 @@
 	if (!found) //No image frames in the current selection!
 		return;
 	recalcPicturesRes();
+	changed();
+}
+
+void ScribusDoc::item_setFrameShape(PageItem* item, int frameType, int count, double* points)
+{
+	if ((item->itemType() == PageItem::PolyLine) || (item->itemType() == PageItem::PathText))
+			return;
+
+	if (UndoManager::undoEnabled())
+	{
+		// Store shape info in this form:
+		// CHANGE_SHAPE_TYPE - ID of the undo operation
+		// OLD_FRAME_TYPE - original frame type
+		// NEW_FRAME_TYPE - change of frame type
+		// binary QPair<FPointArray, FPointArray> - .first original shape, .second new shape
+		ItemState<QPair<FPointArray,FPointArray> > *is = new ItemState<QPair<FPointArray,FPointArray> >(Um::ChangeShapeType, "", Um::IBorder);
+		is->set("CHANGE_SHAPE_TYPE", "change_shape_type");
+		is->set("OLD_FRAME_TYPE", item->FrameType);
+		is->set("NEW_FRAME_TYPE", frameType);
+		// HACK: this is propably Evil Code (TM). I have to find better way...
+		FPointArray newShape;
+		int ix = 0;
+		for (int i = 0; i < count/2; ++i)
+		{
+			double x = item->width()  * points[ix] / 100.0;
+			double y = item->height() * points[ix+1] / 100.0;
+			newShape.addPoint(x, y);
+			ix += 2;
+		}
+		// HACK: end of hack
+		is->setItem(qMakePair(item->shape(), newShape));
+		UndoManager::instance()->action(item, is);
+	}
+
+	switch (frameType)
+	{
+	case 0:
+		item->SetRectFrame();
+		this->setRedrawBounding(item);
+		break;
+	case 1:
+		item->SetOvalFrame();
+		this->setRedrawBounding(item);
+		break;
+	default:
+		item->SetFrameShape(count, points);
+		this->setRedrawBounding(item);
+		item->FrameType = frameType + 2;
+		break;
+	}
+	item->update();
 	changed();
 }
 
@@ -11782,13 +11845,36 @@
 	regionsChanged()->update(OldRect.adjusted(-10, -10, 20, 20));
 }
 
-
-void ScribusDoc::rotateGroup(double angle, FPoint RCenter)
+void ScribusDoc::rotateGroup(double angle, Selection* customSelection)
+{
+	Selection* itemSelection = (customSelection!=0) ? customSelection : m_Selection;
+	Q_ASSERT(itemSelection!=0);
+
+	double gx, gy, gh, gw;
+	FPoint rotationPoint(0, 0);
+	itemSelection->getGroupRect(&gx, &gy, &gw, &gh);
+	if (this->rotMode == 0)
+		rotationPoint = FPoint(gx, gy);
+	if (this->rotMode == 1)
+		rotationPoint = FPoint(gx, gy);
+	if (this->rotMode == 2)
+		rotationPoint = FPoint(gx + gw / 2.0, gy + gh / 2.0);
+	if (this->rotMode == 3)
+		rotationPoint = FPoint(gx, gy+gh);
+	if (this->rotMode == 4)
+		rotationPoint = FPoint(gx+gw, gy+gh);
+	rotateGroup(angle, rotationPoint, itemSelection);
+}
+
+void ScribusDoc::rotateGroup(double angle, FPoint RCenter, Selection* customSelection)
 {
 	double gxS, gyS, ghS, gwS;
 	double sc = 1; // FIXME:av Scale;
 	PageItem* currItem;
-	m_Selection->getGroupRect(&gxS, &gyS, &gwS, &ghS);
+	Selection* itemSelection = (customSelection!=0) ? customSelection : m_Selection;
+	Q_ASSERT(itemSelection!=0);
+	
+	itemSelection->getGroupRect(&gxS, &gyS, &gwS, &ghS);
 	QTransform ma;
 	ma.translate(RCenter.x(), RCenter.y());
 	ma.scale(1, 1);
@@ -11797,18 +11883,18 @@
 //	gyS -= minCanvasCoordinate.y();
 	QRect oldR = QRect(static_cast<int>(gxS*sc-5), static_cast<int>(gyS*sc-5), static_cast<int>(gwS*sc+10), static_cast<int>(ghS*sc+10));
 	FPoint n;
-	for (int a = 0; a < m_Selection->count(); ++a)
-	{
-		currItem = m_Selection->itemAt(a);
+	for (int a = 0; a < itemSelection->count(); ++a)
+	{
+		currItem = itemSelection->itemAt(a);
 		n = FPoint(currItem->xPos() - RCenter.x(), currItem->yPos() - RCenter.y());
 		currItem->setXYPos(ma.m11() * n.x() + ma.m21() * n.y() + ma.dx(), ma.m22() * n.y() + ma.m12() * n.x() + ma.dy());
 		currItem->rotateBy(angle);
 		setRedrawBounding(currItem);
 	}
-	currItem = m_Selection->itemAt(0);
+	currItem = itemSelection->itemAt(0);
 	GroupOnPage(currItem);
-	m_Selection->setGroupRect();
-	m_Selection->getGroupRect(&gxS, &gyS, &gwS, &ghS);
+	itemSelection->setGroupRect();
+	itemSelection->getGroupRect(&gxS, &gyS, &gwS, &ghS);
 //	gxS -= minCanvasCoordinate.x();
 //	gyS -= minCanvasCoordinate.y();
 	regionsChanged()->update(QRectF(gxS-5, gyS-5, gwS+10, ghS+10).unite(oldR));

Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h (original)
+++ trunk/Scribus/scribus/scribusdoc.h Sun Apr  3 15:06:46 2011
@@ -1013,7 +1013,8 @@
 	bool MoveSizeItem(FPoint newX, FPoint newY, PageItem* currItem, bool fromMP = false, bool constrainRotation = false);
 	void AdjustItemSize(PageItem *currItem, bool includeGroup = false, bool moveInGroup = true);
 	void moveGroup(double x, double y, bool fromMP = false, Selection* customSelection = 0);
-	void rotateGroup(double angle, FPoint RCenter);
+	void rotateGroup(double angle, Selection* customSelection = 0);
+	void rotateGroup(double angle, FPoint RCenter, Selection* customSelection = 0);
 	void scaleGroup(double scx, double scy, bool scaleText=true, Selection* customSelection = 0, bool scaleLine = false);
 	//! \brief Get a list of frames of certain type
 	QMap<PageItem*, QString> getDocItemNames(PageItem::ItemType itemType);
@@ -1248,6 +1249,9 @@
 	*/
 	void allItems_ChangePreviewResolution(int id);
 
+	//FIXME : change to process a selection
+	void item_setFrameShape(PageItem* item, int frameType, int count, double* points); 
+
 	void itemSelection_ClearItem(Selection* customSelection=0);
 	//! Delete the items in the current selection. When force is true, we do not warn the user and make SE happy too. Force is used from @sa Page::restorePageItemCreation
 	void itemSelection_DeleteItem(Selection* customSelection=0, bool forceDeletion=false);
@@ -1262,6 +1266,7 @@
 	void itemSelection_ApplyImageEffects(ScImageEffectList& newEffectList, Selection* customSelection=0);
 	void itemSelection_FlipH();
 	void itemSelection_FlipV();
+	void itemSelection_Rotate(double angle, Selection* customSelection = 0);
 	void itemSelection_DoHyphenate();
 	void itemSelection_DoDeHyphenate();
 	void itemSelection_SendToLayer(int layerID);

Modified: trunk/Scribus/scribus/scribusstructs.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/scribusstructs.h
==============================================================================
--- trunk/Scribus/scribus/scribusstructs.h (original)
+++ trunk/Scribus/scribus/scribusstructs.h Sun Apr  3 15:06:46 2011
@@ -340,6 +340,23 @@
 	customPage = 30
 };
 
+enum UpdateRequests
+{
+	reqColorsUpdate = 1,
+	reqCharStylesUpdate = 2,
+	reqParaStylesUpdate = 4,
+	reqTextStylesUpdate = 6,
+	reqArrowStylesUpdate = 8,
+	reqLineStylesUpdate  = 16,
+	reqSymbolsUpdate     = 32,
+	reqDefFontListUpdate = 64,
+	reqDocFontListUpdate = 128,
+	reqStyleComboDocUpdate = 256,
+	reqCmsOptionsUpdate  = 512,
+	reqCustomShapeUpdate = 1024,
+	reqUpdateAll = 65535
+};
+
 //! \brief Common type for guides list
 typedef QList<double> Guides;
 

Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Sun Apr  3 15:06:46 2011
@@ -75,15 +75,9 @@
 #include "canvasmode.h"
 #include "canvasmode_objimport.h"
 #include "actionmanager.h"
-#include "ui/adjustcmsdialog.h"
 #include "commonstrings.h"
-#include "ui/extimageprops.h"
 #include "filewatcher.h"
-#include "ui/guidemanager.h"
-#include "ui/hruler.h"
 #include "hyphenator.h"
-#include "ui/insertTable.h"
-#include "ui/oneclick.h"
 #include "page.h"
 #include "pageitem_imageframe.h"
 #include "pageitem_line.h"
@@ -92,27 +86,37 @@
 #include "pageitem_polyline.h"
 #include "pageitem_textframe.h"
 #include "pageitem_latexframe.h"
-#include "ui/pageitemattributes.h"
-#include "ui/pageselector.h"
 #include "prefscontext.h"
 #include "prefsfile.h"
 #include "prefsmanager.h"
-#include "ui/propertiespalette.h"
-#include "ui/rulermover.h"
 #include "scclocale.h"
-#include "ui/scmessagebox.h"
 #include "scmimedata.h"
 #include "scpainter.h"
 #include "scpaths.h"
-#include "ui/scrapbookpalette.h"
 #include "scribuscore.h"
 #include "scribuswin.h"
 #include "scribusXml.h"
 #include "selection.h"
 #include "serializer.h"
+#include "text/nlsconfig.h"
+#include "ui/adjustcmsdialog.h"
+#include "ui/extimageprops.h"
+#include "ui/guidemanager.h"
+#include "ui/hruler.h"
+#include "ui/insertTable.h"
+#include "ui/oneclick.h"
+#include "ui/pageitemattributes.h"
+#include "ui/pageselector.h"
+#include "ui/propertiespalette.h"
+#include "ui/propertiespalette_image.h"
+#include "ui/propertiespalette_line.h"
+#include "ui/propertiespalette_text.h"
+#include "ui/rulermover.h"
+#include "ui/scmessagebox.h"
+#include "ui/scrapbookpalette.h"
 #include "ui/storyeditor.h"
 #include "ui/symbolpalette.h"
-#include "text/nlsconfig.h"
+#include "ui/vruler.h"
 #include "undomanager.h"
 #include "units.h"
 #include "util.h"
@@ -120,7 +124,6 @@
 #include "util_formats.h"
 #include "util_icon.h"
 #include "util_math.h"
-#include "ui/vruler.h"
 #include "loadsaveplugin.h"
 #include "fileloader.h"
 #include "plugins/formatidlist.h"
@@ -163,6 +166,7 @@
 	p.setBrush(QPalette::Window, PrefsManager::instance()->appPrefs.displayPrefs.scratchColor);
 	setPalette(p);
 	setAttribute(Qt::WA_StaticContents);
+	setAttribute(Qt::WA_InputMethodEnabled, true);
 	setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
 	setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
 	setViewportMargins(m_vhRulerHW, m_vhRulerHW, 0, 0);
@@ -379,7 +383,7 @@
 void ScribusView::toggleCMS()
 {
 	Doc->enableCMS(!Doc->HasCMS);
-	m_ScMW->propertiesPalette->ShowCMS();
+	m_ScMW->requestUpdate(reqCmsOptionsUpdate);
 	DrawNew();
 }
 
@@ -393,7 +397,7 @@
 		{
 			Doc->enableCMS(Doc->cmsSettings().CMSinUse);
 			cmsToolbarButton->setChecked(Doc->HasCMS);
-			m_ScMW->propertiesPalette->ShowCMS();
+			m_ScMW->requestUpdate(reqCmsOptionsUpdate);;
 			DrawNew();
 		}
 	}
@@ -707,7 +711,7 @@
 //			redrawMarker->setGeometry(QRect(evP.x() + 1, evP.y() + 1, qRound(gw), qRound(gh)).normalized());
 //			if (!redrawMarker->isVisible())
 //				redrawMarker->show();
-			emit ItemGeom(gw, gh);
+			emit ItemGeom();
 		}
 		delete ss;
 		ss=NULL;
@@ -1036,11 +1040,7 @@
 									undoManager->setUndoEnabled(false);
 									Doc->m_Selection->getGroupRect(&x2, &y2, &w, &h);
 									Doc->moveGroup(dropPosDoc.x() - x2, dropPosDoc.y() - y2);
-									m_ScMW->propertiesPalette->updateColorList();
-									m_ScMW->symbolPalette->updateSymbolList();
-									m_ScMW->propertiesPalette->paraStyleCombo->updateFormatList();
-									m_ScMW->propertiesPalette->charStyleCombo->updateFormatList();
-									m_ScMW->propertiesPalette->SetLineFormats(Doc);
+									m_ScMW->requestUpdate(reqColorsUpdate | reqSymbolsUpdate | reqTextStylesUpdate | reqLineStylesUpdate);
 									undoManager->setUndoEnabled(true);
 								}
 							}
@@ -1196,8 +1196,7 @@
 				activeTransaction->commit();
 				delete activeTransaction;
 				activeTransaction = NULL;
-				emit ItemPos(gx, gy);
-				emit ItemGeom(gw, gh);
+				emit ItemGeom();
 			}
 			else if (Doc->m_Selection->count() == 1)
 			{
@@ -1598,37 +1597,17 @@
 				if (b<0)
 					b=0;
 				Doc->currentStyle.charStyle() = currItem->itemText.charStyle(b);
-				emit ItemTextStrike(Doc->currentStyle.charStyle().strikethruOffset(), Doc->currentStyle.charStyle().strikethruWidth());
-				emit ItemTextUnderline(Doc->currentStyle.charStyle().underlineOffset(), Doc->currentStyle.charStyle().underlineWidth());
-				emit ItemTextOutline(Doc->currentStyle.charStyle().outlineWidth());
-				emit ItemTextShadow(Doc->currentStyle.charStyle().shadowXOffset(), Doc->currentStyle.charStyle().shadowYOffset());
-				emit ItemTextSca(Doc->currentStyle.charStyle().scaleH());
-				emit ItemTextScaV(Doc->currentStyle.charStyle().scaleV());
-				emit ItemTextFarben(Doc->currentStyle.charStyle().strokeColor(), Doc->currentStyle.charStyle().fillColor(), Doc->currentStyle.charStyle().strokeShade(), Doc->currentStyle.charStyle().fillShade());
-				emit ItemTextFont(Doc->currentStyle.charStyle().font().scName());
-				emit ItemTextSize(Doc->currentStyle.charStyle().fontSize());
-				emit ItemTextUSval(Doc->currentStyle.charStyle().tracking());
-				emit ItemTextStil(Doc->currentStyle.charStyle().effects());
-				emit ItemTextAbs(currItem->itemText.paragraphStyle(b).alignment());
-				emit ItemTextBase(Doc->currentStyle.charStyle().baselineOffset());
+				emit ItemCharStyle(Doc->currentStyle.charStyle());
+				emit ItemTextEffects(Doc->currentStyle.charStyle().effects());
+				emit ItemTextAlign(currItem->itemText.paragraphStyle(b).alignment());
 				return true;
 			}
 			else
 			{
 				Doc->currentStyle.charStyle() = currItem->itemText.defaultStyle().charStyle();
-				emit ItemTextStrike(currItem->itemText.defaultStyle().charStyle().strikethruOffset(), currItem->itemText.defaultStyle().charStyle().strikethruWidth());
-				emit ItemTextUnderline(currItem->itemText.defaultStyle().charStyle().underlineOffset(), currItem->itemText.defaultStyle().charStyle().underlineWidth());
-				emit ItemTextOutline(currItem->itemText.defaultStyle().charStyle().outlineWidth());
-				emit ItemTextShadow(currItem->itemText.defaultStyle().charStyle().shadowXOffset(), currItem->itemText.defaultStyle().charStyle().shadowYOffset());
-				emit ItemTextSca(currItem->itemText.defaultStyle().charStyle().scaleH());
-				emit ItemTextScaV(currItem->itemText.defaultStyle().charStyle().scaleV());
-				emit ItemTextFarben(currItem->itemText.defaultStyle().charStyle().strokeColor(), currItem->itemText.defaultStyle().charStyle().fillColor(), currItem->itemText.defaultStyle().charStyle().strokeShade(), currItem->itemText.defaultStyle().charStyle().fillShade());
-				emit ItemTextFont(currItem->itemText.defaultStyle().charStyle().font().scName());
-				emit ItemTextSize(currItem->itemText.defaultStyle().charStyle().fontSize());
-				emit ItemTextUSval(currItem->itemText.defaultStyle().charStyle().tracking());
-				emit ItemTextStil(currItem->itemText.defaultStyle().charStyle().effects());
-				emit ItemTextAbs( 0 );
-				emit ItemTextBase(currItem->itemText.defaultStyle().charStyle().baselineOffset());
+				emit ItemCharStyle(currItem->itemText.defaultStyle().charStyle());
+				emit ItemTextEffects(currItem->itemText.defaultStyle().charStyle().effects());
+				emit ItemTextAlign( 0 );
 				return true;
 			}
 		}
@@ -1741,11 +1720,10 @@
 			Doc->m_Selection->setGroupRect();
 			double x, y, w, h;
 			Doc->m_Selection->getGroupRect(&x, &y, &w, &h);
-			emit ItemPos(x, y);
-			emit ItemGeom(w, h);
 			getGroupRectScreen(&x, &y, &w, &h);
 			updateContents(QRect(static_cast<int>(x-5), static_cast<int>(y-5), static_cast<int>(w+10), static_cast<int>(h+10)));
 			//CB move in here as the emitAllToGUI will do it otherwise
+			emit ItemGeom();
 			emit HaveSel(currItem->itemType());
 		}
 		//CB done by addItem for single selection or the frame data is already there
@@ -2092,8 +2070,7 @@
 		Doc->moveGroup(nx-(gx+gw), ny-(gy+gh), false, &newObjects);
 		newObjects.setGroupRect();
 		newObjects.getGroupRect(&gx, &gy, &gw, &gh);
-		emit ItemPos(gx, gy);
-		emit ItemGeom(gw, gh);
+		emit ItemGeom();
 		emit HaveSel(newObjects.itemAt(0)->itemType());
 	}
 	else if (newObjects.count() == 1)
@@ -3019,8 +2996,7 @@
 		{
 			double x, y, w, h;
 			Doc->m_Selection->getGroupRect(&x, &y, &w, &h);
-			emit ItemPos(x, y);
-			emit ItemGeom(w, h);
+			emit ItemGeom();
 		}
 		else
 			Doc->m_Selection->itemAt(0)->emitAllToGUI();
@@ -4055,6 +4031,22 @@
 	m_ScMW->keyReleaseEvent(k);
 }
 
+void ScribusView::inputMethodEvent ( QInputMethodEvent * event )
+{
+	qDebug() << "IME" << event->commitString() << event->preeditString() << "attributes:" << event->attributes().count();
+	for(int i = 0; i < event->commitString().length(); ++i)
+	{
+		QKeyEvent ev( QEvent::KeyPress, 0, Qt::NoModifier, event->commitString().mid(i,1));
+		keyPressEvent(&ev);
+	}
+}
+
+QVariant ScribusView::inputMethodQuery ( Qt::InputMethodQuery query ) const
+{
+//	qDebug() << "IMQ" << query;
+	return QVariant();
+}
+
 void ScribusView::wheelEvent(QWheelEvent *w)
 {
 	//QScrollArea::contentsWheelEvent(w);

Modified: trunk/Scribus/scribus/scribusview.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/scribusview.h
==============================================================================
--- trunk/Scribus/scribus/scribusview.h (original)
+++ trunk/Scribus/scribus/scribusview.h Sun Apr  3 15:06:46 2011
@@ -334,7 +334,9 @@
 
 	void keyPressEvent(QKeyEvent *k);
 	void keyReleaseEvent(QKeyEvent *k);
-
+	void inputMethodEvent ( QInputMethodEvent * event );
+	QVariant inputMethodQuery ( Qt::InputMethodQuery query ) const ;
+	
 	inline void registerMousePress(QPoint p);
 	bool mousePressed();
 	void resetMousePressed();
@@ -370,10 +372,9 @@
 signals:
 	void changeUN(int);
 	void changeLA(int);
-	void ItemPos(double, double);
 	void HaveSel(int);
-	void ItemGeom(double, double);
 	void DocChanged();
+	void ItemGeom();
 	void PolyOpen();
 	void PStatus(int, uint);
 	void SetAngle(double);
@@ -381,21 +382,11 @@
 	void SetLineArt(Qt::PenStyle, Qt::PenCapStyle, Qt::PenJoinStyle);
 	void SetLocalValues(double, double, double, double);
 	void ItemTextAttr(double);
-	void ItemTextUSval(double);
 	void ItemTextCols(int, double);
 	void SetDistValues(double, double, double, double);
-	void ItemTextAbs(int);
-	void ItemTextFont(const QString&);
-	void ItemTextSize(double);
-	void ItemTextSca(double);
-	void ItemTextScaV(double);
-	void ItemTextBase(double);
-	void ItemTextOutline(double);
-	void ItemTextShadow(double, double);
-	void ItemTextUnderline(double, double);
-	void ItemTextStrike(double, double);
-	void ItemTextFarben(QString, QString, double, double);
-	void ItemTextStil(int);
+	void ItemCharStyle(const CharStyle&);
+	void ItemTextAlign(int);
+	void ItemTextEffects(int);
 	void HasTextSel();
 	void HasNoTextSel();
 	void MVals(double, double, double, double, double, double, int);

Modified: trunk/Scribus/scribus/scribuswin.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/scribuswin.cpp
==============================================================================
--- trunk/Scribus/scribus/scribuswin.cpp (original)
+++ trunk/Scribus/scribus/scribuswin.cpp Sun Apr  3 15:06:46 2011
@@ -33,6 +33,7 @@
 #include "util_file.h"
 #include "util_icon.h"
 
+#include <QApplication>
 #include <QCloseEvent>
 #include <QDir>
 #include <QFileInfo>

Modified: trunk/Scribus/scribus/selection.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/selection.cpp
==============================================================================
--- trunk/Scribus/scribus/selection.cpp (original)
+++ trunk/Scribus/scribus/selection.cpp Sun Apr  3 15:06:46 2011
@@ -25,7 +25,6 @@
 
 Selection::Selection(QObject* parent)
 	: QObject(parent),
-	m_hasGroupSelection(false),
 	m_isGUISelection(false),
 	m_delaySignals(0),
 	m_sigSelectionChanged(false),
@@ -37,7 +36,6 @@
 
 Selection::Selection(QObject* parent, bool guiSelection) 
 	: QObject(parent),
-	m_hasGroupSelection(false),
 	m_isGUISelection(guiSelection),
 	m_delaySignals(0),
 	m_sigSelectionChanged(false),
@@ -50,7 +48,6 @@
 Selection::Selection(const Selection& other) :
 	QObject(other.parent()),
 	m_SelList(other.m_SelList),
-	m_hasGroupSelection(other.m_hasGroupSelection),
 	// We do not copy m_isGUISelection as :
 	// 1) copy ctor is used for temporary selections
 	// 2) having two GUI selections for same doc should really be avoided
@@ -66,7 +63,7 @@
 		m_SelList[0]->connectToGUI();
 		m_SelList[0]->emitAllToGUI();
 		m_SelList[0]->setSelected(true);
-		emit selectionIsMultiple(m_hasGroupSelection);
+		emit selectionIsMultiple(m_SelList.count() > 1);
 	}
 	groupX = other.groupX;
 	groupY = other.groupY;
@@ -89,7 +86,6 @@
 			(*it)->setSelected(false);
 	}
 	m_SelList=other.m_SelList;
-	m_hasGroupSelection=other.m_hasGroupSelection;
 	// Do not copy m_isGUISelection for consistency with cpy ctor
 	/* m_isGUISelection = other.m_isGUISelection; */
 	// We do not copy m_delaySignals as that can potentially
@@ -101,7 +97,7 @@
 		m_SelList[0]->connectToGUI();
 		m_SelList[0]->emitAllToGUI();
 		m_SelList[0]->setSelected(true);
-		emit selectionIsMultiple(m_hasGroupSelection);
+		emit selectionIsMultiple(m_SelList.count() > 1);
 	}
 	return *this;
 }
@@ -117,7 +113,6 @@
 			(*it)->setSelected(false);
 	}
 	m_SelList=other.m_SelList;
-	m_hasGroupSelection=other.m_hasGroupSelection;
 	if (m_isGUISelection && !m_SelList.isEmpty())
 		m_sigSelectionIsMultiple = true;
 	if (emptyOther)
@@ -147,7 +142,6 @@
 		}
 	}
 	m_SelList.clear();
-	m_hasGroupSelection   = false;
 	m_sigSelectionChanged = true;
 	sendSignals();
 	return true;
@@ -158,7 +152,7 @@
 	bool ret = false;
 	if (!m_isGUISelection || m_SelList.isEmpty())
 		return ret;
-	if (m_hasGroupSelection==false)
+	if (m_SelList.count() == 1)
 	{
 		QPointer<PageItem> pi=m_SelList.first();
 		//Quick check to see if the pointer is NULL, if its NULL, we should remove it from the list now
@@ -210,7 +204,6 @@
 			m_sigSelectionChanged = true;
 			m_sigSelectionIsMultiple = true;
 		}
-		m_hasGroupSelection = (m_SelList.count()>1);	
 		sendSignals();
 		return true;
 	}
@@ -231,8 +224,7 @@
 			item->setSelected(true);
 			m_sigSelectionChanged = true;
 			m_sigSelectionIsMultiple = true;
-		}
-		m_hasGroupSelection = (m_SelList.count()>1);	
+		}	
 		sendSignals();
 		return true;
 	}
@@ -285,9 +277,6 @@
 			item->isSingleSel = false;
 		}
 
-
-		if (m_SelList.isEmpty())
-			m_hasGroupSelection=false;
 		if (m_isGUISelection)
 		{
 			m_sigSelectionChanged = true;
@@ -314,8 +303,6 @@
 				if (itemIndex == 0)
 					item->disconnectFromGUI();
 			}
-			if (m_SelList.isEmpty())
-				m_hasGroupSelection=false;
 			sendSignals();
 			return item;
 		}
@@ -546,7 +533,7 @@
 		if (m_sigSelectionChanged)
 			emit selectionChanged();
 		if (m_sigSelectionIsMultiple)
-			emit selectionIsMultiple(m_hasGroupSelection);
+			emit selectionIsMultiple(m_SelList.count() > 1);
 		m_sigSelectionChanged = false;
 		m_sigSelectionIsMultiple = false;
 	}

Modified: trunk/Scribus/scribus/selection.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/selection.h
==============================================================================
--- trunk/Scribus/scribus/selection.h (original)
+++ trunk/Scribus/scribus/selection.h Sun Apr  3 15:06:46 2011
@@ -139,7 +139,7 @@
 		PageItem *itemAt(int index=0) { return itemAt_(index); }
 		const PageItem *itemAt(int index=0) const { return const_cast<Selection*>(this)->itemAt_(index); }
 		QStringList getSelectedItemsByName() const;
-		bool isMultipleSelection() const { return m_hasGroupSelection; }
+		bool isMultipleSelection() const { return (m_SelList.count() > 1); }
 		bool isGUISelection() const { return m_isGUISelection; }
 		double width() const;
 		double height() const;
@@ -165,7 +165,6 @@
 	protected:
 		PageItem *itemAt_(int index=0);
 		SelectionList m_SelList;
-		bool m_hasGroupSelection;
 		bool m_isGUISelection;
 		double groupX;
 		double groupY;

Modified: trunk/Scribus/scribus/ui/annot.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/ui/annot.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/annot.cpp (original)
+++ trunk/Scribus/scribus/ui/annot.cpp Sun Apr  3 15:06:46 2011
@@ -35,9 +35,7 @@
 #include "colorcombo.h"
 #include "colorlistbox.h"
 #include "commonstrings.h"
-#include "ui/customfdialog.h"
 #include "editor.h"
-#include "ui/propertiespalette.h"
 #include "navigator.h"
 #include "pageitem.h"
 #include "prefscontext.h"
@@ -49,6 +47,8 @@
 #include "scribusstructs.h"
 #include "scribusview.h"
 #include "selfield.h"
+#include "ui/customfdialog.h"
+#include "ui/propertiespalette_utils.h"
 #include "util_formats.h"
 #include "util_icon.h"
 #include "util.h"

Modified: trunk/Scribus/scribus/ui/collectforoutput_ui.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/ui/collectforoutput_ui.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/collectforoutput_ui.cpp (original)
+++ trunk/Scribus/scribus/ui/collectforoutput_ui.cpp Sun Apr  3 15:06:46 2011
@@ -14,6 +14,8 @@
 #include "scribuscore.h"
 #include "scraction.h"
 #include "scribusapp.h"
+
+#include <QMessageBox>
 
 CollectForOutput_UI::CollectForOutput_UI(QWidget* parent, ScribusDoc* doc, QString outputDirectory, bool withFonts, bool withProfiles, bool compressDoc) :
 	CollectForOutput(doc, outputDirectory, withFonts, withProfiles, compressDoc)

Modified: trunk/Scribus/scribus/ui/colorpalette.ui
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/ui/colorpalette.ui
==============================================================================
--- trunk/Scribus/scribus/ui/colorpalette.ui (original)
+++ trunk/Scribus/scribus/ui/colorpalette.ui Sun Apr  3 15:06:46 2011
@@ -1,900 +1,858 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>colorPalette</class>
- <widget class="QWidget" name="colorPalette">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>252</width>
-    <height>361</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Form</string>
-  </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <property name="margin">
-    <number>2</number>
-   </property>
-   <property name="spacing">
-    <number>2</number>
-   </property>
-   <item row="0" column="0" colspan="2">
-    <layout class="QHBoxLayout" name="horizontalLayout">
-     <item>
-      <widget class="QToolButton" name="editLineColorSelector">
-       <property name="toolTip">
-        <string>Edit Line Color Properties</string>
-       </property>
-       <property name="text">
-        <string/>
-       </property>
-       <property name="checkable">
-        <bool>true</bool>
-       </property>
-       <property name="autoExclusive">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QToolButton" name="editFillColorSelector">
-       <property name="toolTip">
-        <string>Edit Fill Color Properties</string>
-       </property>
-       <property name="text">
-        <string/>
-       </property>
-       <property name="checkable">
-        <bool>true</bool>
-       </property>
-       <property name="autoExclusive">
-        <bool>true</bool>
-       </property>
-      </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>
-    </layout>
-   </item>
-   <item row="1" column="0" colspan="2">
-    <widget class="QStackedWidget" name="stackedWidget">
-     <property name="currentIndex">
-      <number>0</number>
-     </property>
-     <widget class="QWidget" name="pageStroke">
-      <layout class="QGridLayout" name="gridLayout_3">
-       <property name="margin">
-        <number>5</number>
-       </property>
-       <property name="spacing">
-        <number>2</number>
-       </property>
-       <item row="0" column="0" colspan="2">
-        <widget class="QTabWidget" name="tabWidgetStroke">
-         <property name="currentIndex">
-          <number>0</number>
-         </property>
-         <widget class="QWidget" name="tabSolid_2">
-          <attribute name="title">
-           <string>Solid</string>
-          </attribute>
-          <layout class="QVBoxLayout" name="verticalLayout_3">
-           <property name="spacing">
-            <number>2</number>
-           </property>
-           <property name="margin">
-            <number>5</number>
-           </property>
-           <item>
-            <widget class="ColorListBox" name="colorListStroke"/>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_5">
-             <item>
-              <widget class="QLabel" name="label_8">
-               <property name="text">
-                <string>Shade:</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QSpinBox" name="strokeShade">
-               <property name="toolTip">
-                <string>Saturation of color</string>
-               </property>
-               <property name="suffix">
-                <string> %</string>
-               </property>
-               <property name="maximum">
-                <number>100</number>
-               </property>
-               <property name="value">
-                <number>100</number>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-          </layout>
-         </widget>
-         <widget class="QWidget" name="tabGradient_2">
-          <attribute name="title">
-           <string>Gradient</string>
-          </attribute>
-          <layout class="QVBoxLayout" name="verticalLayout_5">
-           <property name="spacing">
-            <number>2</number>
-           </property>
-           <property name="margin">
-            <number>5</number>
-           </property>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_6">
-             <item>
-              <widget class="QComboBox" name="gradientTypeStroke">
-               <item>
-                <property name="text">
-                 <string>Linear</string>
-                </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>Radial</string>
-                </property>
-               </item>
-              </widget>
-             </item>
-             <item>
-              <widget class="QToolButton" name="gradEditButtonStroke">
-               <property name="toolTip">
-                <string>Move the start of the gradient vector with the left mouse button pressed and move the end of the gradient vector with the right mouse button pressed</string>
-               </property>
-               <property name="text">
-                <string>Move Vector</string>
-               </property>
-               <property name="checkable">
-                <bool>true</bool>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <widget class="GradientEditor" name="gradEditStroke">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="minimumSize">
-              <size>
-               <width>200</width>
-               <height>173</height>
-              </size>
-             </property>
-             <property name="frameShape">
-              <enum>QFrame::NoFrame</enum>
-             </property>
-             <property name="frameShadow">
-              <enum>QFrame::Raised</enum>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="ScComboBox" name="namedGradientStroke"/>
-           </item>
-          </layout>
-         </widget>
-         <widget class="QWidget" name="tabPattern_2">
-          <attribute name="title">
-           <string>Pattern</string>
-          </attribute>
-          <layout class="QVBoxLayout" name="verticalLayout_6">
-           <property name="spacing">
-            <number>2</number>
-           </property>
-           <property name="margin">
-            <number>5</number>
-           </property>
-           <item>
-            <widget class="QListWidget" name="patternBoxStroke">
-             <property name="movement">
-              <enum>QListView::Snap</enum>
-             </property>
-             <property name="flow">
-              <enum>QListView::LeftToRight</enum>
-             </property>
-             <property name="isWrapping" stdset="0">
-              <bool>true</bool>
-             </property>
-             <property name="resizeMode">
-              <enum>QListView::Adjust</enum>
-             </property>
-             <property name="viewMode">
-              <enum>QListView::IconMode</enum>
-             </property>
-             <property name="wordWrap">
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QCheckBox" name="followsPath">
-             <property name="text">
-              <string>Pattern follows Path</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_7">
-             <property name="spacing">
-              <number>5</number>
-             </property>
-             <item>
-              <widget class="QToolButton" name="editPatternPropsStroke">
-               <property name="text">
-                <string>Properties...</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_4">
-               <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>
-          </layout>
-         </widget>
-        </widget>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="pageFill">
-      <layout class="QGridLayout" name="gridLayout_2">
-       <property name="margin">
-        <number>5</number>
-       </property>
-       <property name="spacing">
-        <number>2</number>
-       </property>
-       <item row="0" column="0" colspan="2">
-        <widget class="QTabWidget" name="tabWidget">
-         <property name="currentIndex">
-          <number>0</number>
-         </property>
-         <widget class="QWidget" name="tabSolid">
-          <attribute name="title">
-           <string>Solid</string>
-          </attribute>
-          <layout class="QVBoxLayout" name="verticalLayout_2">
-           <property name="spacing">
-            <number>2</number>
-           </property>
-           <property name="margin">
-            <number>5</number>
-           </property>
-           <item>
-            <widget class="ColorListBox" name="colorListFill"/>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_4">
-             <item>
-              <widget class="QLabel" name="label_6">
-               <property name="text">
-                <string>Shade:</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QSpinBox" name="fillShade">
-               <property name="toolTip">
-                <string>Saturation of color</string>
-               </property>
-               <property name="suffix">
-                <string> %</string>
-               </property>
-               <property name="maximum">
-                <number>100</number>
-               </property>
-               <property name="value">
-                <number>100</number>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-          </layout>
-         </widget>
-         <widget class="QWidget" name="tabGradient">
-          <attribute name="title">
-           <string>Gradient</string>
-          </attribute>
-          <layout class="QVBoxLayout" name="verticalLayout_7">
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_3">
-             <item>
-              <widget class="QComboBox" name="gradientType">
-               <item>
-                <property name="text">
-                 <string>Linear</string>
-                </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>Radial</string>
-                </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>4 Colors</string>
-                </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>Diamond</string>
-                </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>Mesh</string>
-                </property>
-               </item>
-              </widget>
-             </item>
-             <item>
-              <widget class="QToolButton" name="gradEditButton">
-               <property name="toolTip">
-                <string>Move the start of the gradient vector with the left mouse button pressed and move the end of the gradient vector with the right mouse button pressed</string>
-               </property>
-               <property name="text">
-                <string>Move Vector</string>
-               </property>
-               <property name="checkable">
-                <bool>true</bool>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <widget class="QStackedWidget" name="stackedWidget_2">
-             <property name="currentIndex">
-              <number>0</number>
-             </property>
-             <widget class="QWidget" name="page">
-              <layout class="QVBoxLayout" name="verticalLayout_4">
-               <property name="margin">
-                <number>0</number>
-               </property>
-               <item>
-                <widget class="GradientEditor" name="gradEdit">
-                 <property name="sizePolicy">
-                  <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
-                   <horstretch>0</horstretch>
-                   <verstretch>0</verstretch>
-                  </sizepolicy>
-                 </property>
-                 <property name="minimumSize">
-                  <size>
-                   <width>200</width>
-                   <height>173</height>
-                  </size>
-                 </property>
-                 <property name="frameShape">
-                  <enum>QFrame::NoFrame</enum>
-                 </property>
-                 <property name="frameShadow">
-                  <enum>QFrame::Raised</enum>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <widget class="ScComboBox" name="namedGradient"/>
-               </item>
-              </layout>
-             </widget>
-             <widget class="QWidget" name="page_2">
-              <layout class="QVBoxLayout" name="verticalLayout_8">
-               <property name="margin">
-                <number>0</number>
-               </property>
-               <item>
-                <layout class="QGridLayout" name="gridLayout_4">
-                 <item row="0" column="0">
-                  <widget class="QLabel" name="label_5">
-                   <property name="text">
-                    <string>Color</string>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="0" column="1">
-                  <widget class="QLabel" name="label">
-                   <property name="text">
-                    <string>Shade</string>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="0" column="2">
-                  <widget class="QLabel" name="label_9">
-                   <property name="text">
-                    <string>Transparency</string>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="1" column="0">
-                  <widget class="ColorCombo" name="colorPoint1">
-                   <property name="sizePolicy">
-                    <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-                     <horstretch>0</horstretch>
-                     <verstretch>0</verstretch>
-                    </sizepolicy>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="1" column="1">
-                  <widget class="QSpinBox" name="color1Shade">
-                   <property name="suffix">
-                    <string> %</string>
-                   </property>
-                   <property name="minimum">
-                    <number>0</number>
-                   </property>
-                   <property name="maximum">
-                    <number>100</number>
-                   </property>
-                   <property name="singleStep">
-                    <number>10</number>
-                   </property>
-                   <property name="value">
-                    <number>100</number>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="1" column="2">
-                  <widget class="QSpinBox" name="color1Alpha">
-                   <property name="suffix">
-                    <string> %</string>
-                   </property>
-                   <property name="maximum">
-                    <number>100</number>
-                   </property>
-                   <property name="singleStep">
-                    <number>10</number>
-                   </property>
-                   <property name="value">
-                    <number>100</number>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="2" column="0">
-                  <widget class="ColorCombo" name="colorPoint2">
-                   <property name="sizePolicy">
-                    <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-                     <horstretch>0</horstretch>
-                     <verstretch>0</verstretch>
-                    </sizepolicy>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="2" column="1">
-                  <widget class="QSpinBox" name="color2Shade">
-                   <property name="suffix">
-                    <string> %</string>
-                   </property>
-                   <property name="minimum">
-                    <number>0</number>
-                   </property>
-                   <property name="maximum">
-                    <number>100</number>
-                   </property>
-                   <property name="singleStep">
-                    <number>10</number>
-                   </property>
-                   <property name="value">
-                    <number>100</number>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="2" column="2">
-                  <widget class="QSpinBox" name="color2Alpha">
-                   <property name="suffix">
-                    <string> %</string>
-                   </property>
-                   <property name="maximum">
-                    <number>100</number>
-                   </property>
-                   <property name="singleStep">
-                    <number>10</number>
-                   </property>
-                   <property name="value">
-                    <number>100</number>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="3" column="0">
-                  <widget class="ColorCombo" name="colorPoint3">
-                   <property name="sizePolicy">
-                    <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-                     <horstretch>0</horstretch>
-                     <verstretch>0</verstretch>
-                    </sizepolicy>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="3" column="1">
-                  <widget class="QSpinBox" name="color3Shade">
-                   <property name="suffix">
-                    <string> %</string>
-                   </property>
-                   <property name="minimum">
-                    <number>0</number>
-                   </property>
-                   <property name="maximum">
-                    <number>100</number>
-                   </property>
-                   <property name="singleStep">
-                    <number>10</number>
-                   </property>
-                   <property name="value">
-                    <number>100</number>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="3" column="2">
-                  <widget class="QSpinBox" name="color3Alpha">
-                   <property name="suffix">
-                    <string> %</string>
-                   </property>
-                   <property name="maximum">
-                    <number>100</number>
-                   </property>
-                   <property name="singleStep">
-                    <number>10</number>
-                   </property>
-                   <property name="value">
-                    <number>100</number>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="4" column="0">
-                  <widget class="ColorCombo" name="colorPoint4">
-                   <property name="sizePolicy">
-                    <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-                     <horstretch>0</horstretch>
-                     <verstretch>0</verstretch>
-                    </sizepolicy>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="4" column="1">
-                  <widget class="QSpinBox" name="color4Shade">
-                   <property name="suffix">
-                    <string> %</string>
-                   </property>
-                   <property name="minimum">
-                    <number>0</number>
-                   </property>
-                   <property name="maximum">
-                    <number>100</number>
-                   </property>
-                   <property name="singleStep">
-                    <number>10</number>
-                   </property>
-                   <property name="value">
-                    <number>100</number>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="4" column="2">
-                  <widget class="QSpinBox" name="color4Alpha">
-                   <property name="suffix">
-                    <string> %</string>
-                   </property>
-                   <property name="maximum">
-                    <number>100</number>
-                   </property>
-                   <property name="singleStep">
-                    <number>10</number>
-                   </property>
-                   <property name="value">
-                    <number>100</number>
-                   </property>
-                  </widget>
-                 </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>70</height>
-                  </size>
-                 </property>
-                </spacer>
-               </item>
-              </layout>
-             </widget>
-             <widget class="QWidget" name="page_3">
-              <layout class="QVBoxLayout" name="verticalLayout_9">
-               <item>
-                <layout class="QGridLayout" name="gridLayout_5">
-                 <item row="0" column="0">
-                  <widget class="QLabel" name="label_2">
-                   <property name="text">
-                    <string>Color:</string>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="0" column="1">
-                  <widget class="ColorCombo" name="colorMeshPoint">
-                   <property name="enabled">
-                    <bool>false</bool>
-                   </property>
-                   <property name="sizePolicy">
-                    <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-                     <horstretch>0</horstretch>
-                     <verstretch>0</verstretch>
-                    </sizepolicy>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="1" column="0">
-                  <widget class="QLabel" name="label_3">
-                   <property name="text">
-                    <string>Shade:</string>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="1" column="1">
-                  <widget class="QSpinBox" name="shadeMeshPoint">
-                   <property name="enabled">
-                    <bool>false</bool>
-                   </property>
-                   <property name="suffix">
-                    <string> %</string>
-                   </property>
-                   <property name="minimum">
-                    <number>0</number>
-                   </property>
-                   <property name="maximum">
-                    <number>100</number>
-                   </property>
-                   <property name="singleStep">
-                    <number>10</number>
-                   </property>
-                   <property name="value">
-                    <number>100</number>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="2" column="0">
-                  <widget class="QLabel" name="label_4">
-                   <property name="text">
-                    <string>Transparency:</string>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="2" column="1">
-                  <widget class="QSpinBox" name="transparencyMeshPoint">
-                   <property name="enabled">
-                    <bool>false</bool>
-                   </property>
-                   <property name="suffix">
-                    <string> %</string>
-                   </property>
-                   <property name="maximum">
-                    <number>100</number>
-                   </property>
-                   <property name="singleStep">
-                    <number>10</number>
-                   </property>
-                   <property name="value">
-                    <number>100</number>
-                   </property>
-                  </widget>
-                 </item>
-                </layout>
-               </item>
-               <item>
-                <layout class="QHBoxLayout" name="horizontalLayout_8">
-                 <item>
-                  <widget class="QToolButton" name="editMeshColors">
-                   <property name="text">
-                    <string>Edit Colors</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_2">
-                 <property name="orientation">
-                  <enum>Qt::Vertical</enum>
-                 </property>
-                 <property name="sizeHint" stdset="0">
-                  <size>
-                   <width>20</width>
-                   <height>101</height>
-                  </size>
-                 </property>
-                </spacer>
-               </item>
-              </layout>
-             </widget>
-            </widget>
-           </item>
-          </layout>
-         </widget>
-         <widget class="QWidget" name="tabPattern">
-          <attribute name="title">
-           <string>Pattern</string>
-          </attribute>
-          <layout class="QVBoxLayout" name="verticalLayout">
-           <property name="spacing">
-            <number>2</number>
-           </property>
-           <property name="margin">
-            <number>5</number>
-           </property>
-           <item>
-            <widget class="QListWidget" name="patternBox">
-             <property name="movement">
-              <enum>QListView::Snap</enum>
-             </property>
-             <property name="flow">
-              <enum>QListView::LeftToRight</enum>
-             </property>
-             <property name="isWrapping" stdset="0">
-              <bool>true</bool>
-             </property>
-             <property name="resizeMode">
-              <enum>QListView::Adjust</enum>
-             </property>
-             <property name="viewMode">
-              <enum>QListView::IconMode</enum>
-             </property>
-             <property name="wordWrap">
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_2">
-             <property name="spacing">
-              <number>5</number>
-             </property>
-             <item>
-              <widget class="QToolButton" name="editPatternProps">
-               <property name="text">
-                <string>Properties...</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_3">
-               <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>
-          </layout>
-         </widget>
-        </widget>
-       </item>
-      </layout>
-     </widget>
-    </widget>
-   </item>
-   <item row="2" column="0" colspan="2">
-    <widget class="QCheckBox" name="displayAllColors">
-     <property name="toolTip">
-      <string>Display all colors from the document color list, or only the already used colors</string>
-     </property>
-     <property name="text">
-      <string>Display only used colors</string>
-     </property>
-    </widget>
-   </item>
-   <item row="3" column="0">
-    <widget class="QLabel" name="label_7">
-     <property name="text">
-      <string>Overprinting</string>
-     </property>
-     <property name="wordWrap">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="3" column="1">
-    <widget class="QComboBox" name="overPrintCombo">
-     <item>
-      <property name="text">
-       <string>Knockout</string>
-      </property>
-     </item>
-     <item>
-      <property name="text">
-       <string>Overprint</string>
-      </property>
-     </item>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>ScComboBox</class>
-   <extends>QComboBox</extends>
-   <header>ui/sccombobox.h</header>
-  </customwidget>
-  <customwidget>
-   <class>GradientEditor</class>
-   <extends>QFrame</extends>
-   <header>ui/gradienteditor.h</header>
-   <container>1</container>
-  </customwidget>
-  <customwidget>
-   <class>ColorListBox</class>
-   <extends>QListWidget</extends>
-   <header>ui/colorlistbox.h</header>
-  </customwidget>
-  <customwidget>
-   <class>ColorCombo</class>
-   <extends>QComboBox</extends>
-   <header>ui/colorcombo.h</header>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>colorPalette</class>
+ <widget class="QWidget" name="colorPalette">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>258</width>
+    <height>360</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <property name="margin">
+    <number>5</number>
+   </property>
+   <item>
+    <widget class="QTabWidget" name="tabFillStroke">
+     <property name="currentIndex">
+      <number>0</number>
+     </property>
+     <widget class="QWidget" name="tabFill">
+      <attribute name="title">
+       <string>Fill</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout_2">
+       <property name="spacing">
+        <number>2</number>
+       </property>
+       <property name="margin">
+        <number>2</number>
+       </property>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_2">
+         <item>
+          <widget class="QLabel" name="fillModeLabel">
+           <property name="text">
+            <string>Fill Mode</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QComboBox" name="fillModeCombo"/>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <widget class="Line" name="line">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QStackedWidget" name="fillModeStack">
+         <property name="currentIndex">
+          <number>0</number>
+         </property>
+         <widget class="QWidget" name="solidFillPage">
+          <layout class="QVBoxLayout" name="verticalLayout_3">
+           <property name="spacing">
+            <number>2</number>
+           </property>
+           <property name="margin">
+            <number>0</number>
+           </property>
+           <item>
+            <widget class="ColorListBox" name="colorListFill"/>
+           </item>
+           <item>
+            <layout class="QHBoxLayout" name="horizontalLayout_3">
+             <item>
+              <widget class="QLabel" name="label">
+               <property name="text">
+                <string>Shade:</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QSpinBox" name="fillShade">
+               <property name="suffix">
+                <string>%</string>
+               </property>
+               <property name="maximum">
+                <number>100</number>
+               </property>
+               <property name="value">
+                <number>100</number>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+          </layout>
+         </widget>
+         <widget class="QWidget" name="gradientFillPage">
+          <layout class="QVBoxLayout" name="verticalLayout_5">
+           <property name="spacing">
+            <number>2</number>
+           </property>
+           <property name="margin">
+            <number>0</number>
+           </property>
+           <item>
+            <layout class="QHBoxLayout" name="horizontalLayout_4">
+             <item>
+              <widget class="QComboBox" name="gradientType">
+               <item>
+                <property name="text">
+                 <string>Linear</string>
+                </property>
+               </item>
+               <item>
+                <property name="text">
+                 <string>Radial</string>
+                </property>
+               </item>
+               <item>
+                <property name="text">
+                 <string>4 Colors</string>
+                </property>
+               </item>
+               <item>
+                <property name="text">
+                 <string>Diamond</string>
+                </property>
+               </item>
+               <item>
+                <property name="text">
+                 <string>Mesh</string>
+                </property>
+               </item>
+              </widget>
+             </item>
+             <item>
+              <widget class="QToolButton" name="gradEditButton">
+               <property name="text">
+                <string>Move Vector</string>
+               </property>
+               <property name="checkable">
+                <bool>true</bool>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+           <item>
+            <widget class="QStackedWidget" name="stackedWidget_2">
+             <property name="currentIndex">
+              <number>0</number>
+             </property>
+             <widget class="QWidget" name="page_3">
+              <layout class="QVBoxLayout" name="verticalLayout_4">
+               <property name="margin">
+                <number>0</number>
+               </property>
+               <item>
+                <widget class="ScComboBox" name="namedGradient"/>
+               </item>
+               <item>
+                <widget class="GradientEditor" name="gradEdit">
+                 <property name="frameShape">
+                  <enum>QFrame::NoFrame</enum>
+                 </property>
+                 <property name="frameShadow">
+                  <enum>QFrame::Raised</enum>
+                 </property>
+                </widget>
+               </item>
+              </layout>
+             </widget>
+             <widget class="QWidget" name="page_4">
+              <layout class="QVBoxLayout" name="verticalLayout_8">
+               <property name="margin">
+                <number>0</number>
+               </property>
+               <item>
+                <layout class="QGridLayout" name="gridLayout_4">
+                 <item row="0" column="0">
+                  <widget class="QLabel" name="label_5">
+                   <property name="text">
+                    <string>Color</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="0" column="1">
+                  <widget class="QLabel" name="label_2">
+                   <property name="text">
+                    <string>Shade</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="0" column="2">
+                  <widget class="QLabel" name="label_9">
+                   <property name="text">
+                    <string>Transparency</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="1" column="0">
+                  <widget class="ColorCombo" name="colorPoint1">
+                   <property name="sizePolicy">
+                    <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+                     <horstretch>0</horstretch>
+                     <verstretch>0</verstretch>
+                    </sizepolicy>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="1" column="1">
+                  <widget class="QSpinBox" name="color1Shade">
+                   <property name="suffix">
+                    <string> %</string>
+                   </property>
+                   <property name="minimum">
+                    <number>0</number>
+                   </property>
+                   <property name="maximum">
+                    <number>100</number>
+                   </property>
+                   <property name="singleStep">
+                    <number>10</number>
+                   </property>
+                   <property name="value">
+                    <number>100</number>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="1" column="2">
+                  <widget class="QSpinBox" name="color1Alpha">
+                   <property name="suffix">
+                    <string> %</string>
+                   </property>
+                   <property name="maximum">
+                    <number>100</number>
+                   </property>
+                   <property name="singleStep">
+                    <number>10</number>
+                   </property>
+                   <property name="value">
+                    <number>100</number>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="2" column="0">
+                  <widget class="ColorCombo" name="colorPoint2">
+                   <property name="sizePolicy">
+                    <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+                     <horstretch>0</horstretch>
+                     <verstretch>0</verstretch>
+                    </sizepolicy>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="2" column="1">
+                  <widget class="QSpinBox" name="color2Shade">
+                   <property name="suffix">
+                    <string> %</string>
+                   </property>
+                   <property name="minimum">
+                    <number>0</number>
+                   </property>
+                   <property name="maximum">
+                    <number>100</number>
+                   </property>
+                   <property name="singleStep">
+                    <number>10</number>
+                   </property>
+                   <property name="value">
+                    <number>100</number>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="2" column="2">
+                  <widget class="QSpinBox" name="color2Alpha">
+                   <property name="suffix">
+                    <string> %</string>
+                   </property>
+                   <property name="maximum">
+                    <number>100</number>
+                   </property>
+                   <property name="singleStep">
+                    <number>10</number>
+                   </property>
+                   <property name="value">
+                    <number>100</number>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="3" column="0">
+                  <widget class="ColorCombo" name="colorPoint3">
+                   <property name="sizePolicy">
+                    <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+                     <horstretch>0</horstretch>
+                     <verstretch>0</verstretch>
+                    </sizepolicy>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="3" column="1">
+                  <widget class="QSpinBox" name="color3Shade">
+                   <property name="suffix">
+                    <string> %</string>
+                   </property>
+                   <property name="minimum">
+                    <number>0</number>
+                   </property>
+                   <property name="maximum">
+                    <number>100</number>
+                   </property>
+                   <property name="singleStep">
+                    <number>10</number>
+                   </property>
+                   <property name="value">
+                    <number>100</number>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="3" column="2">
+                  <widget class="QSpinBox" name="color3Alpha">
+                   <property name="suffix">
+                    <string> %</string>
+                   </property>
+                   <property name="maximum">
+                    <number>100</number>
+                   </property>
+                   <property name="singleStep">
+                    <number>10</number>
+                   </property>
+                   <property name="value">
+                    <number>100</number>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="4" column="0">
+                  <widget class="ColorCombo" name="colorPoint4">
+                   <property name="sizePolicy">
+                    <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+                     <horstretch>0</horstretch>
+                     <verstretch>0</verstretch>
+                    </sizepolicy>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="4" column="1">
+                  <widget class="QSpinBox" name="color4Shade">
+                   <property name="suffix">
+                    <string> %</string>
+                   </property>
+                   <property name="minimum">
+                    <number>0</number>
+                   </property>
+                   <property name="maximum">
+                    <number>100</number>
+                   </property>
+                   <property name="singleStep">
+                    <number>10</number>
+                   </property>
+                   <property name="value">
+                    <number>100</number>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="4" column="2">
+                  <widget class="QSpinBox" name="color4Alpha">
+                   <property name="suffix">
+                    <string> %</string>
+                   </property>
+                   <property name="maximum">
+                    <number>100</number>
+                   </property>
+                   <property name="singleStep">
+                    <number>10</number>
+                   </property>
+                   <property name="value">
+                    <number>100</number>
+                   </property>
+                  </widget>
+                 </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>70</height>
+                  </size>
+                 </property>
+                </spacer>
+               </item>
+              </layout>
+             </widget>
+             <widget class="QWidget" name="page_5">
+              <layout class="QVBoxLayout" name="verticalLayout_9">
+               <item>
+                <layout class="QGridLayout" name="gridLayout_5">
+                 <item row="0" column="0">
+                  <widget class="QLabel" name="label_3">
+                   <property name="text">
+                    <string>Color:</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="0" column="1">
+                  <widget class="ColorCombo" name="colorMeshPoint">
+                   <property name="enabled">
+                    <bool>false</bool>
+                   </property>
+                   <property name="sizePolicy">
+                    <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+                     <horstretch>0</horstretch>
+                     <verstretch>0</verstretch>
+                    </sizepolicy>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="1" column="0">
+                  <widget class="QLabel" name="label_4">
+                   <property name="text">
+                    <string>Shade:</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="1" column="1">
+                  <widget class="QSpinBox" name="shadeMeshPoint">
+                   <property name="enabled">
+                    <bool>false</bool>
+                   </property>
+                   <property name="suffix">
+                    <string> %</string>
+                   </property>
+                   <property name="minimum">
+                    <number>0</number>
+                   </property>
+                   <property name="maximum">
+                    <number>100</number>
+                   </property>
+                   <property name="singleStep">
+                    <number>10</number>
+                   </property>
+                   <property name="value">
+                    <number>100</number>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="2" column="0">
+                  <widget class="QLabel" name="label_6">
+                   <property name="text">
+                    <string>Transparency:</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="2" column="1">
+                  <widget class="QSpinBox" name="transparencyMeshPoint">
+                   <property name="enabled">
+                    <bool>false</bool>
+                   </property>
+                   <property name="suffix">
+                    <string> %</string>
+                   </property>
+                   <property name="maximum">
+                    <number>100</number>
+                   </property>
+                   <property name="singleStep">
+                    <number>10</number>
+                   </property>
+                   <property name="value">
+                    <number>100</number>
+                   </property>
+                  </widget>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_8">
+                 <item>
+                  <widget class="QToolButton" name="editMeshColors">
+                   <property name="text">
+                    <string>Edit Colors</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_2">
+                 <property name="orientation">
+                  <enum>Qt::Vertical</enum>
+                 </property>
+                 <property name="sizeHint" stdset="0">
+                  <size>
+                   <width>20</width>
+                   <height>101</height>
+                  </size>
+                 </property>
+                </spacer>
+               </item>
+              </layout>
+             </widget>
+            </widget>
+           </item>
+          </layout>
+         </widget>
+         <widget class="QWidget" name="patternFillPage">
+          <layout class="QVBoxLayout" name="verticalLayout_6">
+           <property name="spacing">
+            <number>2</number>
+           </property>
+           <property name="margin">
+            <number>0</number>
+           </property>
+           <item>
+            <widget class="QListWidget" name="patternBox">
+             <property name="movement">
+              <enum>QListView::Snap</enum>
+             </property>
+             <property name="flow">
+              <enum>QListView::LeftToRight</enum>
+             </property>
+             <property name="isWrapping" stdset="0">
+              <bool>true</bool>
+             </property>
+             <property name="resizeMode">
+              <enum>QListView::Adjust</enum>
+             </property>
+             <property name="viewMode">
+              <enum>QListView::IconMode</enum>
+             </property>
+             <property name="wordWrap">
+              <bool>true</bool>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <layout class="QHBoxLayout" name="horizontalLayout_5">
+             <property name="spacing">
+              <number>5</number>
+             </property>
+             <item>
+              <widget class="QToolButton" name="editPatternProps">
+               <property name="text">
+                <string>Properties...</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <spacer name="horizontalSpacer_3">
+               <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>
+          </layout>
+         </widget>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="tabStroke">
+      <attribute name="title">
+       <string>Stroke</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout_11">
+       <property name="spacing">
+        <number>2</number>
+       </property>
+       <property name="margin">
+        <number>2</number>
+       </property>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_6">
+         <item>
+          <widget class="QLabel" name="strokeModeLabel">
+           <property name="text">
+            <string>Stroke Mode</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QComboBox" name="strokeModeCombo"/>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <widget class="Line" name="line_2">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QStackedWidget" name="strokeModeStack">
+         <property name="currentIndex">
+          <number>0</number>
+         </property>
+         <widget class="QWidget" name="solidStrokePage">
+          <layout class="QVBoxLayout" name="verticalLayout_7">
+           <property name="spacing">
+            <number>2</number>
+           </property>
+           <property name="margin">
+            <number>0</number>
+           </property>
+           <item>
+            <widget class="ColorListBox" name="colorListStroke"/>
+           </item>
+           <item>
+            <layout class="QHBoxLayout" name="horizontalLayout_7">
+             <item>
+              <widget class="QLabel" name="label_7">
+               <property name="text">
+                <string>Shade:</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QSpinBox" name="strokeShade">
+               <property name="suffix">
+                <string>%</string>
+               </property>
+               <property name="maximum">
+                <number>100</number>
+               </property>
+               <property name="value">
+                <number>100</number>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+          </layout>
+         </widget>
+         <widget class="QWidget" name="gradientStrokePage">
+          <layout class="QVBoxLayout" name="verticalLayout_10">
+           <property name="spacing">
+            <number>2</number>
+           </property>
+           <property name="margin">
+            <number>0</number>
+           </property>
+           <item>
+            <layout class="QHBoxLayout" name="horizontalLayout_9">
+             <item>
+              <widget class="QComboBox" name="gradientTypeStroke">
+               <item>
+                <property name="text">
+                 <string>Linear</string>
+                </property>
+               </item>
+               <item>
+                <property name="text">
+                 <string>Radial</string>
+                </property>
+               </item>
+              </widget>
+             </item>
+             <item>
+              <widget class="QToolButton" name="gradEditButtonStroke">
+               <property name="text">
+                <string>Move Vector</string>
+               </property>
+               <property name="checkable">
+                <bool>true</bool>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+           <item>
+            <widget class="ScComboBox" name="namedGradientStroke"/>
+           </item>
+           <item>
+            <widget class="GradientEditor" name="gradEditStroke">
+             <property name="sizePolicy">
+              <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
+               <horstretch>0</horstretch>
+               <verstretch>0</verstretch>
+              </sizepolicy>
+             </property>
+             <property name="frameShape">
+              <enum>QFrame::NoFrame</enum>
+             </property>
+             <property name="frameShadow">
+              <enum>QFrame::Raised</enum>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </widget>
+         <widget class="QWidget" name="patternStrokePage">
+          <layout class="QVBoxLayout" name="verticalLayout_14">
+           <property name="spacing">
+            <number>2</number>
+           </property>
+           <property name="margin">
+            <number>0</number>
+           </property>
+           <item>
+            <widget class="QListWidget" name="patternBoxStroke">
+             <property name="movement">
+              <enum>QListView::Snap</enum>
+             </property>
+             <property name="flow">
+              <enum>QListView::LeftToRight</enum>
+             </property>
+             <property name="isWrapping" stdset="0">
+              <bool>true</bool>
+             </property>
+             <property name="resizeMode">
+              <enum>QListView::Adjust</enum>
+             </property>
+             <property name="viewMode">
+              <enum>QListView::IconMode</enum>
+             </property>
+             <property name="wordWrap">
+              <bool>true</bool>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <layout class="QHBoxLayout" name="horizontalLayout_11">
+             <property name="spacing">
+              <number>5</number>
+             </property>
+             <item>
+              <widget class="QToolButton" name="editPatternPropsStroke">
+               <property name="text">
+                <string>Properties...</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <spacer name="horizontalSpacer_5">
+               <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>
+              <widget class="QCheckBox" name="followsPath">
+               <property name="layoutDirection">
+                <enum>Qt::RightToLeft</enum>
+               </property>
+               <property name="text">
+                <string>Pattern follows Path</string>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+          </layout>
+         </widget>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <widget class="QLabel" name="overprintLabel">
+       <property name="text">
+        <string>Overprinting</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QComboBox" name="overPrintCombo">
+       <item>
+        <property name="text">
+         <string>Knockout</string>
+        </property>
+       </item>
+       <item>
+        <property name="text">
+         <string>Overprint</string>
+        </property>
+       </item>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <widget class="QCheckBox" name="displayAllColors">
+     <property name="layoutDirection">
+      <enum>Qt::RightToLeft</enum>
+     </property>
+     <property name="text">
+      <string>Display only used colors</string>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>ScComboBox</class>
+   <extends>QComboBox</extends>
+   <header>ui/sccombobox.h</header>
+  </customwidget>
+  <customwidget>
+   <class>GradientEditor</class>
+   <extends>QFrame</extends>
+   <header>ui/gradienteditor.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>ColorListBox</class>
+   <extends>QListWidget</extends>
+   <header>ui/colorlistbox.h</header>
+  </customwidget>
+  <customwidget>
+   <class>ColorCombo</class>
+   <extends>QComboBox</extends>
+   <header>ui/colorcombo.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>

Modified: trunk/Scribus/scribus/ui/contextmenu.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/ui/contextmenu.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/contextmenu.cpp (original)
+++ trunk/Scribus/scribus/ui/contextmenu.cpp Sun Apr  3 15:06:46 2011
@@ -14,6 +14,7 @@
 ***************************************************************************/
 
 // #include <QDebug>
+#include <QApplication>
 #include <QFrame>
 #include <QGridLayout>
 #include <QLabel>

Modified: trunk/Scribus/scribus/ui/cpalette.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/ui/cpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/cpalette.cpp (original)
+++ trunk/Scribus/scribus/ui/cpalette.cpp Sun Apr  3 15:06:46 2011
@@ -58,22 +58,34 @@
 #include "sccolorengine.h"
 #include "scpainter.h"
 #include "scpattern.h"
+#include "scribus.h"
+#include "selection.h"
 #include "util.h"
 #include "util_math.h"
 
 Cpalette::Cpalette(QWidget* parent) : QWidget(parent)
 {
+	m_blockUpdates = 0;
 	currentItem = NULL;
 	patternList = NULL;
 	CGradDia = NULL;
 	CGradDia = new GradientVectorDialog(this->parentWidget());
 	CGradDia->hide();
+
 	setupUi(this);
+	fillModeCombo->addItem( tr("Solid") );
+	fillModeCombo->addItem( tr("Gradient") );
+	strokeModeCombo->addItem( tr("Solid") );
+	strokeModeCombo->addItem( tr("Gradient") );
+
+	gradEdit->layout()->setAlignment(Qt::AlignTop);
+	gradEditStroke->layout()->setAlignment(Qt::AlignTop);
 	gradientTypeStroke->setCurrentIndex(0);
-	editLineColorSelector->setIcon(QIcon(loadIcon("16/color-stroke.png")));
+	/*editLineColorSelector->setIcon(QIcon(loadIcon("16/color-stroke.png")));
 	editFillColorSelector->setIcon(QIcon(loadIcon("16/color-fill.png")));
 	connect(editLineColorSelector, SIGNAL(clicked()), this, SLOT(editLineColorSelectorButton()));
-	connect(editFillColorSelector, SIGNAL(clicked()), this, SLOT(editFillColorSelectorButton()));
+	connect(editFillColorSelector, SIGNAL(clicked()), this, SLOT(editFillColorSelectorButton()));*/
+	connect(tabFillStroke, SIGNAL(currentChanged(int)), this, SLOT(fillStrokeSelector(int)));
 	connect(patternBox, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(selectPattern(QListWidgetItem*)));
 	connect(fillShade, SIGNAL(valueChanged(int)), this, SIGNAL(NewBrushShade(int)));
 	connect(strokeShade, SIGNAL(valueChanged(int)), this, SIGNAL(NewPenShade(int)));
@@ -81,8 +93,8 @@
 	connect(colorListFill, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(selectColorF(QListWidgetItem*)));
 	connect(gradEditButton, SIGNAL(clicked()), this, SLOT(editGradientVector()));
 	connect(editMeshColors, SIGNAL(clicked()), this, SLOT(editMeshPointColor()));
-	connect(displayAllColors, SIGNAL(clicked()), this, SLOT(ToggleColorDisplay()));
-	connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(slotGrad(int)));
+	connect(displayAllColors, SIGNAL(clicked()), this, SLOT(toggleColorDisplay()));
+	connect(fillModeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(slotGrad(int)));
 	connect(CGradDia, SIGNAL(NewSpecial(double, double, double, double, double, double, double, double, double, double)), this, SIGNAL(NewSpecial(double, double, double, double, double, double, double, double, double, double)));
 	connect(CGradDia, SIGNAL(paletteShown(bool)), this, SLOT(setActiveGradDia(bool)));
 	connect(CGradDia, SIGNAL(editGradient(int)), this, SIGNAL(editGradient(int)));
@@ -92,16 +104,16 @@
 	connect(CGradDia, SIGNAL(reset1Control()), this, SLOT(resetOneControlPoint()));
 	connect(CGradDia, SIGNAL(resetAllControl()), this, SLOT(resetAllControlPoints()));
 	connect(gradientType, SIGNAL(activated(int)), this, SLOT(slotGradType(int)));
-	connect(gradEdit, SIGNAL(gradientChanged()), this, SIGNAL(gradientChanged()));
-	connect(editPatternProps, SIGNAL(clicked()), this, SLOT(changePatternProps()));
+	connect(gradEdit, SIGNAL(gradientChanged()) , this, SLOT(handleFillGradient()));
+	connect(editPatternProps, SIGNAL(clicked()) , this, SLOT(changePatternProps()));
 	connect(namedGradient, SIGNAL(activated(const QString &)), this, SLOT(setNamedGradient(const QString &)));
 	connect(overPrintCombo, SIGNAL(activated(int)), this, SIGNAL(NewOverprint(int)));
 	connect(patternBoxStroke, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(selectPatternS(QListWidgetItem*)));
-	connect(tabWidgetStroke, SIGNAL(currentChanged(int)), this, SLOT(slotGradStroke(int)));
+	connect(strokeModeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(slotGradStroke(int)));
 	connect(editPatternPropsStroke, SIGNAL(clicked()), this, SLOT(changePatternPropsStroke()));
 	connect(namedGradientStroke, SIGNAL(activated(const QString &)), this, SLOT(setNamedGradientStroke(const QString &)));
 	connect(gradientTypeStroke, SIGNAL(activated(int)), this, SLOT(slotGradTypeStroke(int)));
-	connect(gradEditStroke, SIGNAL(gradientChanged()), this, SIGNAL(strokeGradientChanged()));
+	connect(gradEditStroke, SIGNAL(gradientChanged()) , this, SLOT(handleStrokeGradient()));
 	connect(gradEditButtonStroke, SIGNAL(clicked()), this, SLOT(editGradientVectorStroke()));
 	connect(followsPath, SIGNAL(clicked()), this, SLOT(toggleStrokePattern()));
 	connect(colorPoint1, SIGNAL(activated(int)), this, SLOT(setGradientColors()));
@@ -119,8 +131,10 @@
 	connect(colorMeshPoint, SIGNAL(activated(int)), this, SLOT(updateMeshPoint()));
 	connect(shadeMeshPoint, SIGNAL(valueChanged(int)), this, SLOT(updateMeshPoint()));
 	connect(transparencyMeshPoint, SIGNAL(valueChanged(int)), this, SLOT(updateMeshPoint()));
-	editFillColorSelector->setChecked(true);
-	editFillColorSelectorButton();
+	tabFillStroke->setCurrentIndex(0);
+	updateFromItem();
+	/*editFillColorSelector->setChecked(true);
+	editFillColorSelectorButton();*/
 }
 
 void Cpalette::setCurrentItem(PageItem* item)
@@ -137,7 +151,29 @@
 
 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);
+
+	if (currentDoc)
+	{
+		disconnect(currentDoc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+		disconnect(currentDoc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
+		disconnect(currentDoc->scMW()     , SIGNAL(UpdateRequest(int)), this, SLOT(handleUpdateRequest(int)));
+	}
+
+	ScribusDoc* oldDoc = currentDoc;
 	currentDoc = doc;
+
 	if (doc == NULL)
 	{
 		colorListStroke->cList = NULL;
@@ -149,6 +185,30 @@
 		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))     , this, SLOT(handleStrokeShade(int)));
+		connect(this, SIGNAL(NewBrushShade(int))   , this, SLOT(handleFillShade(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)));
+
+		connect(currentDoc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+		connect(currentDoc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
+		connect(currentDoc->scMW()     , SIGNAL(UpdateRequest(int)), this, SLOT(handleUpdateRequest(int)));
+	}
+
+	if (oldDoc != currentDoc)
+	{
+		displayGradient(0);
 	}
 }
 
@@ -160,10 +220,10 @@
 		return;
 	disconnect(namedGradient, SIGNAL(activated(const QString &)), this, SLOT(setNamedGradient(const QString &)));
 	disconnect(namedGradientStroke, SIGNAL(activated(const QString &)), this, SLOT(setNamedGradientStroke(const QString &)));
-	disconnect(tabWidgetStroke, SIGNAL(currentChanged(int)), this, SLOT(slotGradStroke(int)));
+	disconnect(strokeModeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(slotGradStroke(int)));
 	disconnect(gradientTypeStroke, SIGNAL(activated(int)), this, SLOT(slotGradTypeStroke(int)));
-	disconnect(gradEdit, SIGNAL(gradientChanged()), this, SIGNAL(gradientChanged()));
-	disconnect(gradEditStroke, SIGNAL(gradientChanged()), this, SIGNAL(strokeGradientChanged()));
+	disconnect(gradEdit      , SIGNAL(gradientChanged()), this, SLOT(handleFillGradient()));
+	disconnect(gradEditStroke, SIGNAL(gradientChanged()), this, SLOT(handleStrokeGradient()));
 	disconnect(gradientType, SIGNAL(activated(int)), this, SLOT(slotGradType(int)));
 	disconnect(colorPoint1, SIGNAL(activated(int)), this, SLOT(setGradientColors()));
 	disconnect(colorPoint2, SIGNAL(activated(int)), this, SLOT(setGradientColors()));
@@ -181,12 +241,9 @@
 	disconnect(shadeMeshPoint, SIGNAL(valueChanged(int)), this, SLOT(updateMeshPoint()));
 	disconnect(transparencyMeshPoint, SIGNAL(valueChanged(int)), this, SLOT(updateMeshPoint()));
 	updateCList();
-	if (currentItem->doOverprint)
-		setActOverprint(1);
-	else
-		setActOverprint(0);
-	setActFarben(currentItem->lineColor(), currentItem->fillColor(), currentItem->lineShade(), currentItem->fillShade());
-	ChooseGrad(currentItem->GrType);
+	displayOverprint(currentItem->doOverprint ? 1 : 0);
+	displayColorValues(currentItem->lineColor(), currentItem->fillColor(), currentItem->lineShade(), currentItem->fillShade());
+	displayGradient(currentItem->GrType);
 	gradEdit->setGradient(currentItem->fill_gradient);
 	gradEditStroke->setGradient(currentItem->stroke_gradient);
 	if (!currentItem->gradient().isEmpty())
@@ -216,7 +273,7 @@
 		else
 			gradientTypeStroke->setCurrentIndex(1);
 	}
-	if (patternList->count() == 0)
+	/*if (patternList->count() == 0)
 	{
 		tabWidgetStroke->setTabEnabled(2, false);
 		tabWidget->setTabEnabled(2, false);
@@ -225,22 +282,33 @@
 	{
 		tabWidgetStroke->setTabEnabled(2, true);
 		tabWidget->setTabEnabled(2, true);
-	}
+	}*/
+	enablePatterns(patternList->count() != 0);
 	if (!currentItem->strokePattern().isEmpty())
-		tabWidgetStroke->setCurrentIndex(2);
+		strokeModeCombo->setCurrentIndex(2);
 	else if (currentItem->GrTypeStroke > 0)
-		tabWidgetStroke->setCurrentIndex(1);
-	else
-		tabWidgetStroke->setCurrentIndex(0);
+		strokeModeCombo->setCurrentIndex(1);
+	else
+		strokeModeCombo->setCurrentIndex(0);
 	setMeshPoint();
 	editMeshColors->setEnabled(!CGradDia->isVisible());
 	gradEditButton->setEnabled(true);
+
+	double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY, patternSpace;
+	bool mirrorX, mirrorY;
+	currentItem->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
+	currentItem->patternFlip(mirrorX, mirrorY);
+	setActPattern(currentItem->pattern(), patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY, mirrorX, mirrorY);
+	currentItem->strokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY, patternSpace);
+	currentItem->strokePatternFlip(mirrorX, mirrorY);
+	setActPatternStroke(currentItem->strokePattern(), patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY, mirrorX, mirrorY, patternSpace, currentItem->isStrokePatternToPath());
+
 	connect(namedGradient, SIGNAL(activated(const QString &)), this, SLOT(setNamedGradient(const QString &)));
 	connect(namedGradientStroke, SIGNAL(activated(const QString &)), this, SLOT(setNamedGradientStroke(const QString &)));
-	connect(tabWidgetStroke, SIGNAL(currentChanged(int)), this, SLOT(slotGradStroke(int)));
+	connect(strokeModeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(slotGradStroke(int)));
 	connect(gradientTypeStroke, SIGNAL(activated(int)), this, SLOT(slotGradTypeStroke(int)));
-	connect(gradEdit, SIGNAL(gradientChanged()), this, SIGNAL(gradientChanged()));
-	connect(gradEditStroke, SIGNAL(gradientChanged()), this, SIGNAL(strokeGradientChanged()));
+	connect(gradEdit      , SIGNAL(gradientChanged()), this, SLOT(handleFillGradient()));
+	connect(gradEditStroke, SIGNAL(gradientChanged()), this, SLOT(handleStrokeGradient()));
 	connect(gradientType, SIGNAL(activated(int)), this, SLOT(slotGradType(int)));
 	connect(colorPoint1, SIGNAL(activated(int)), this, SLOT(setGradientColors()));
 	connect(colorPoint2, SIGNAL(activated(int)), this, SLOT(setGradientColors()));
@@ -259,6 +327,75 @@
 	connect(transparencyMeshPoint, SIGNAL(valueChanged(int)), this, SLOT(updateMeshPoint()));
 }
 
+PageItem* Cpalette::currentItemFromSelection()
+{
+	PageItem *currentItem = NULL;
+
+	if (currentDoc)
+	{
+		if (currentDoc->m_Selection->count() > 1)
+		{
+			uint lowestItem = 999999;
+			for (int a=0; a < currentDoc->m_Selection->count(); ++a)
+			{
+				currentItem = currentDoc->m_Selection->itemAt(a);
+				lowestItem = qMin(lowestItem, currentItem->ItemNr);
+			}
+			currentItem = currentDoc->Items->at(lowestItem);
+		}
+		else if (currentDoc->m_Selection->count() == 1)
+		{
+			currentItem = currentDoc->m_Selection->itemAt(0);
+		}
+	}
+
+	return currentItem;
+}
+
+void Cpalette::enablePatterns(bool enable)
+{
+	if (enable)
+	{
+		if (fillModeCombo->count() < 3)
+			fillModeCombo->addItem( tr("Pattern") );
+		if (strokeModeCombo->count() < 3)
+			strokeModeCombo->addItem( tr("Pattern") );
+	}
+	else
+	{
+		if (fillModeCombo->count() == 3)
+			fillModeCombo->removeItem(2);
+		if (strokeModeCombo->count() == 3)
+			strokeModeCombo->removeItem(2);
+	}
+}
+
+void Cpalette::handleSelectionChanged()
+{
+	if (currentDoc && !updatesBlocked())
+	{
+		PageItem* currentItem = currentItemFromSelection();
+		setCurrentItem(currentItem);
+		updateFromItem();
+	}
+}
+
+void Cpalette::handleUpdateRequest(int updateFlags)
+{
+	if (updateFlags & reqColorsUpdate)
+		updateColorList();
+}
+
+void Cpalette::updateColorList()
+{
+	if (currentDoc)
+	{
+		this->setColors(currentDoc->PageColors);
+		this->setGradients(&currentDoc->docGradients);
+		this->setPatterns(&currentDoc->docPatterns);
+	}
+}
+
 void Cpalette::updateCList()
 {
 	disconnect(colorListStroke, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(selectColorS(QListWidgetItem*)));
@@ -289,7 +426,7 @@
 	connect(colorListFill, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(selectColorF(QListWidgetItem*)));
 }
 
-void Cpalette::ToggleColorDisplay()
+void Cpalette::toggleColorDisplay()
 {
 	if (currentDoc != NULL)
 	{
@@ -300,32 +437,89 @@
 	}
 }
 
-void Cpalette::setActOverprint(int val)
+void Cpalette::displayOverprint(int val)
 {
 	disconnect(overPrintCombo, SIGNAL(activated(int)), this, SIGNAL(NewOverprint(int)));
 	overPrintCombo->setCurrentIndex(val);
 	connect(overPrintCombo, SIGNAL(activated(int)), this, SIGNAL(NewOverprint(int)));
 }
 
-void Cpalette::setActFarben(QString p, QString b, int shp, int shb)
+void Cpalette::handleFillShade(int val)
+{
+	if (currentDoc)
+	{
+		blockUpdates(true);
+		currentDoc->itemSelection_SetItemBrushShade(val);
+		blockUpdates(false);
+	}
+}
+
+void Cpalette::handleStrokeShade(int val)
+{
+	if (currentDoc)
+	{
+		blockUpdates(true);
+		currentDoc->itemSelection_SetItemPenShade(val);
+		blockUpdates(false);
+	}
+}
+
+void Cpalette::handleOverprint(int val)
+{
+	if (currentDoc)
+	{
+		bool setter = true;
+		if (val == 0)
+			setter = false;
+		currentDoc->itemSelection_SetOverprint(setter);
+	}
+}
+
+void Cpalette::handleFillGradient()
+{
+	if (currentDoc)
+	{
+		VGradient gradient(gradEdit->gradient());
+		blockUpdates(true);
+		currentDoc->updateManager()->setUpdatesDisabled();
+		currentDoc->itemSelection_SetFillGradient(gradient);
+		currentDoc->updateManager()->setUpdatesEnabled();
+		blockUpdates(false);
+	}
+}
+
+void Cpalette::handleStrokeGradient()
+{
+	if (currentDoc)
+	{
+		VGradient gradient(gradEditStroke->gradient());
+		blockUpdates(true);
+		currentDoc->updateManager()->setUpdatesDisabled();
+		currentDoc->itemSelection_SetLineGradient(gradient);
+		currentDoc->updateManager()->setUpdatesEnabled();
+		blockUpdates(false);
+	}
+}
+
+void Cpalette::displayColorValues(QString stroke, QString fill, int sShade, int fShade)
 {
 	disconnect(fillShade, SIGNAL(valueChanged(int)), this, SIGNAL(NewBrushShade(int)));
 	disconnect(strokeShade, SIGNAL(valueChanged(int)), this, SIGNAL(NewPenShade(int)));
 	disconnect(colorListStroke, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(selectColorS(QListWidgetItem*)));
 	disconnect(colorListFill, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(selectColorF(QListWidgetItem*)));
-	strokeShade->setValue(shp);
-	fillShade->setValue(shp);
-	if ((p != CommonStrings::None) && (!p.isEmpty()))
-	{
-		QList<QListWidgetItem *> cCol = colorListStroke->findItems(p, Qt::MatchExactly);
+	strokeShade->setValue(sShade);
+	fillShade->setValue(fShade);
+	if ((stroke != CommonStrings::None) && (!stroke.isEmpty()))
+	{
+		QList<QListWidgetItem *> cCol = colorListStroke->findItems(stroke, Qt::MatchExactly);
 		if (cCol.count() != 0)
 			colorListStroke->setCurrentItem(cCol[0]);
 	}
 	else
 		colorListStroke->setCurrentRow(0);
-	if ((b != CommonStrings::None) && (!b.isEmpty()))
-	{
-		QList<QListWidgetItem *> cCol = colorListFill->findItems(b, Qt::MatchExactly);
+	if ((fill != CommonStrings::None) && (!fill.isEmpty()))
+	{
+		QList<QListWidgetItem *> cCol = colorListFill->findItems(fill, Qt::MatchExactly);
 		if (cCol.count() != 0)
 			colorListFill->setCurrentItem(cCol[0]);
 	}
@@ -361,14 +555,19 @@
 	emit NewBrush(sFarbe);
 }
 
-void Cpalette::SetColors(ColorList newColorList)
+void Cpalette::setColors(ColorList newColorList)
 {
 	colorList.clear();
 	colorList = newColorList;
 	updateCList();
 }
 
-void Cpalette::editLineColorSelectorButton()
+void Cpalette::fillStrokeSelector(int /*index*/)
+{
+	updateFromItem();
+}
+
+/*void Cpalette::editLineColorSelectorButton()
 {
 	if (editLineColorSelector->isChecked())
 	{
@@ -386,7 +585,7 @@
 		editLineColorSelector->setChecked(false);
 	}
 	updateFromItem();
-}
+}*/
 
 void Cpalette::updateGradientList()
 {
@@ -424,7 +623,7 @@
 	connect(namedGradientStroke, SIGNAL(activated(const QString &)), this, SLOT(setNamedGradientStroke(const QString &)));
 }
 
-void Cpalette::SetGradients(QMap<QString, VGradient> *docGradients)
+void Cpalette::setGradients(QMap<QString, VGradient> *docGradients)
 {
 	gradientList = docGradients;
 	updateGradientList();
@@ -546,7 +745,7 @@
 	}
 }
 
-void Cpalette::SetPatterns(QMap<QString, ScPattern> *docPatterns)
+void Cpalette::setPatterns(QMap<QString, ScPattern> *docPatterns)
 {
 	patternList = docPatterns;
 	updatePatternList();
@@ -649,17 +848,18 @@
 		emit NewGradientS(0);
 		emit NewPatternS("");
 	}
-}
-
-void Cpalette::ChooseGrad(int number)
-{
-	disconnect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(slotGrad(int)));
+	strokeModeStack->setCurrentIndex(number);
+}
+
+void Cpalette::displayGradient(int number)
+{
+	disconnect(fillModeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(slotGrad(int)));
 	if (number==-1)
 	{
-		tabWidget->setCurrentIndex(0);
+		fillModeCombo->setCurrentIndex(0);
 	}
 	if (number == 0)
-		tabWidget->setCurrentIndex(0);
+		fillModeCombo->setCurrentIndex(0);
 	else if (((number > 0) && (number < 8)) || (number == 9) || (number == 10) || (number == 11))
 	{
 		if ((number == 5) || (number == 7))
@@ -718,19 +918,20 @@
 			stackedWidget_2->setCurrentIndex(0);
 			gradientType->setCurrentIndex(0);
 		}
-		tabWidget->setCurrentIndex(1);
+		fillModeCombo->setCurrentIndex(1);
 	}
 	else
 	{
 		if (patternList->count() == 0)
 		{
-			tabWidget->setCurrentIndex(0);
+			fillModeCombo->setCurrentIndex(0);
 			emit NewGradient(0);
 		}
 		else
-			tabWidget->setCurrentIndex(2);
-	}
-	connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(slotGrad(int)));
+			fillModeCombo->setCurrentIndex(2);
+	}
+	fillModeStack->setCurrentIndex( fillModeCombo->currentIndex() );
+	connect(fillModeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(slotGrad(int)));
 }
 
 void Cpalette::slotGrad(int number)
@@ -739,7 +940,7 @@
 	{
 		disconnect(namedGradient, SIGNAL(activated(const QString &)), this, SLOT(setNamedGradient(const QString &)));
 		disconnect(gradientType, SIGNAL(activated(int)), this, SLOT(slotGradType(int)));
-		disconnect(gradEdit, SIGNAL(gradientChanged()), this, SIGNAL(gradientChanged()));
+		disconnect(gradEdit, SIGNAL(gradientChanged()) , this, SLOT(handleFillGradient()));
 		if (!currentItem->gradient().isEmpty())
 		{
 			setCurrentComboItem(namedGradient, currentItem->gradient());
@@ -810,12 +1011,13 @@
 		}
 		connect(namedGradient, SIGNAL(activated(const QString &)), this, SLOT(setNamedGradient(const QString &)));
 		connect(gradientType, SIGNAL(activated(int)), this, SLOT(slotGradType(int)));
-		connect(gradEdit, SIGNAL(gradientChanged()), this, SIGNAL(gradientChanged()));
+		connect(gradEdit, SIGNAL(gradientChanged()) , this, SLOT(handleFillGradient()));
 	}
 	else if (number == 2)
 		emit NewGradient(8);
 	else
 		emit NewGradient(0);
+	fillModeStack->setCurrentIndex(number);
 }
 
 void Cpalette::slotGradType(int type)
@@ -884,11 +1086,6 @@
 		emit NewGradientS(6);
 	else
 		emit NewGradientS(7);
-}
-
-void Cpalette::setActGradient(int typ)
-{
-	ChooseGrad(typ);
 }
 
 void Cpalette::editMeshPointColor()
@@ -1134,7 +1331,7 @@
 	m_Pattern_mirrorX = dia->FlipH->isChecked();
 	m_Pattern_mirrorY = dia->FlipV->isChecked();
 	delete dia;
-	tabWidget->setCurrentIndex(2);
+	fillModeCombo->setCurrentIndex(2);
 	emit NewGradient(8);
 }
 

Modified: trunk/Scribus/scribus/ui/cpalette.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/ui/cpalette.h
==============================================================================
--- trunk/Scribus/scribus/ui/cpalette.h (original)
+++ trunk/Scribus/scribus/ui/cpalette.h Sun Apr  3 15:06:46 2011
@@ -63,15 +63,34 @@
 	void setCurrentItem(PageItem* item);
 	void updateFromItem();
 
+	void updateColorList();
+
+	void setColors(ColorList newColorList);
+	void setGradients(QMap<QString, VGradient> *docGradients);
+	void setPatterns(QMap<QString, ScPattern> *docPatterns);
+
+private:
+
+	PageItem* currentItemFromSelection();
+
 public slots:
-	void editLineColorSelectorButton();
-	void editFillColorSelectorButton();
-	void SetColors(ColorList newColorList);
-	void setActOverprint(int);
+
+	void handleSelectionChanged();
+	void handleUpdateRequest(int);
+
+	/*void editLineColorSelectorButton();
+	void editFillColorSelectorButton();*/
+	void fillStrokeSelector(int /*index*/);
+	void displayColorValues(QString stroke, QString fille, int sShade, int fShade);
+	void displayGradient(int nr);
+	void displayOverprint(int);
+	void handleFillShade(int);
+	void handleStrokeShade(int);
+	void handleOverprint(int);
+	void handleFillGradient();
+	void handleStrokeGradient();
 	void updateCList();
-	void ToggleColorDisplay();
-	void SetPatterns(QMap<QString, ScPattern> *docPatterns);
-	void SetGradients(QMap<QString, VGradient> *docGradients);
+	void toggleColorDisplay();
 	void setNamedGradient(const QString &name);
 	void setNamedGradientStroke(const QString &name);
 	void selectPattern(QListWidgetItem *c);
@@ -81,15 +100,12 @@
 	void updateGradientList();
 	void setActPattern(QString pattern, double scaleX, double scaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY, bool mirrorX, bool mirrorY);
 	void setActPatternStroke(QString pattern, double scaleX, double scaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY, bool mirrorX, bool mirrorY, double space, bool pathF);
-	void setActFarben(QString p, QString b, int shp, int shb);
 	void selectColorS(QListWidgetItem *c);
 	void selectColorF(QListWidgetItem *c);
 	void slotGradStroke(int number);
-	void ChooseGrad(int nr);
 	void slotGrad(int nr);
 	void slotGradType(int type);
 	void slotGradTypeStroke(int type);
-	void setActGradient(int typ);
 	void setGradientColors();
 	void editMeshPointColor();
 	void createNewMeshGradient();
@@ -122,8 +138,6 @@
 	void NewPatternPropsS(double, double, double, double, double, double, double, double, bool, bool);
 	void NewSpecial(double, double, double, double, double, double, double, double, double, double);
 	void NewOverprint(int);
-	void gradientChanged();
-	void strokeGradientChanged();
 	void editGradient(int);
 
 protected:
@@ -141,8 +155,8 @@
 	double m_Pattern_rotation;
 	double m_Pattern_skewX;
 	double m_Pattern_skewY;
-	bool m_Pattern_mirrorX;
-	bool m_Pattern_mirrorY;
+	bool   m_Pattern_mirrorX;
+	bool   m_Pattern_mirrorY;
 	double m_Pattern_scaleXS;
 	double m_Pattern_scaleYS;
 	double m_Pattern_offsetXS;
@@ -151,10 +165,16 @@
 	double m_Pattern_skewXS;
 	double m_Pattern_skewYS;
 	double m_Pattern_spaceS;
-	bool m_Pattern_mirrorXS;
-	bool m_Pattern_mirrorYS;
-	int currentUnit;
-	int editStrokeGradient;
+	bool   m_Pattern_mirrorXS;
+	bool   m_Pattern_mirrorYS;
+	int    currentUnit;
+	int    editStrokeGradient;
+
+	int    m_blockUpdates;
+	void   blockUpdates(bool block) { if (block) ++m_blockUpdates; else --m_blockUpdates; }
+	bool   updatesBlocked() { return (m_blockUpdates > 0); }
+
+	void   enablePatterns(bool enable);
 };
 
 #endif

Modified: trunk/Scribus/scribus/ui/gradienteditor.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/ui/gradienteditor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/gradienteditor.cpp (original)
+++ trunk/Scribus/scribus/ui/gradienteditor.cpp Sun Apr  3 15:06:46 2011
@@ -27,29 +27,31 @@
 #include <QToolTip>
 #include "util.h"
 
+// Note : use temporarily editingFinished() signal to track value changes in stopPos, stopOpacity and
+// stopShade spinboxes. valueChanged() cause focus problems in these widgets due to signals emitted
+// by ScribusDoc::itemSelection_SetFillGradient() and itemSelection_SetStrokeGradient()
 
 GradientEditor::GradientEditor(QWidget *pa) : QFrame(pa)
 {
 	setupUi(this);
-	connect(Position, SIGNAL(valueChanged(int)), this, SLOT(changePos(int)));
+	connect(stopPos    , SIGNAL(valueChanged(int)), this, SLOT(changePos(int)));
+	connect(stopColor  , SIGNAL(activated(const QString &)), this, SLOT(setStopColor(const QString &)));
+	connect(stopOpacity, SIGNAL(valueChanged(int)), this, SLOT(setStopTrans(int)));
+	connect(stopShade  , SIGNAL(valueChanged(int)), this, SLOT(setStopShade(int)));
+	connect(Preview, SIGNAL(selectedStop(VColorStop*)), this, SLOT(slotDisplayStop(VColorStop*)));
 	connect(Preview, SIGNAL(currStep(double)), this, SLOT(setPos(double)));
 	connect(Preview, SIGNAL(currStep(double)), this, SIGNAL(gradientChanged()));
-	connect(stopColor, SIGNAL(activated(const QString &)), this, SLOT(setStopColor(const QString &)));
-	connect(stopOpacity, SIGNAL(valueChanged(int)), this, SLOT(setStopTrans(int)));
-	connect(stopShade, SIGNAL(valueChanged(int)), this, SLOT(setStopShade(int)));
-	connect(Preview, SIGNAL(currTrans(double )), this, SLOT(setGradTrans(double )));
-	connect(Preview, SIGNAL(selectedColor(QString, int )), this, SLOT(slotColor(QString, int )));
 }
 
 void GradientEditor::setGradient(VGradient grad)
 {
-	Preview->fill_gradient = grad;
+	Preview->setGradient(grad);
 	Preview->updateDisplay();
 }
 
 const VGradient GradientEditor::gradient()
 {
-	return Preview->fill_gradient;
+	return Preview->gradient();
 }
 
 void GradientEditor::setColors(ColorList &colorList)
@@ -60,22 +62,29 @@
 
 void GradientEditor::setPos(double p)
 {
-	disconnect(Position, SIGNAL(valueChanged(int)), this, SLOT(changePos(int)));
-	Position->setValue(qRound(p * 100));
-	connect(Position, SIGNAL(valueChanged(int)), this, SLOT(changePos(int)));
+	stopPos->blockSignals(true);
+	stopPos->setValue(qRound(p * 100));
+	stopPos->blockSignals(false);
 }
 
 void GradientEditor::setGradTrans(double val)
 {
-	disconnect(stopOpacity, SIGNAL(valueChanged(int)), this, SLOT(setStopTrans(int)));
+	stopOpacity->blockSignals(true);
 	stopOpacity->setValue(qRound(val * 100));
-	connect(stopOpacity, SIGNAL(valueChanged(int)), this, SLOT(setStopTrans(int)));
+	stopOpacity->blockSignals(false);
+}
+
+void GradientEditor::slotDisplayStop(VColorStop* stop)
+{
+	setPos(stop->rampPoint);
+	slotColor(stop->name, stop->shade);
+	setGradTrans(stop->opacity);
 }
 
 void GradientEditor::slotColor(QString name, int shade)
 {
-	disconnect(stopColor, SIGNAL(activated(const QString &)), this, SLOT(setStopColor(const QString &)));
-	disconnect(stopShade, SIGNAL(valueChanged(int)), this, SLOT(setStopShade(int)));
+	stopColor->blockSignals(true);
+	stopShade->blockSignals(true);
 	stopShade->setValue(shade);
 	QString nam = name;
 	if (name == CommonStrings::None)
@@ -90,8 +99,8 @@
 		stopOpacity->setEnabled(true);
 	}
 	setCurrentComboItem(stopColor, nam);
-	connect(stopColor, SIGNAL(activated(const QString &)), this, SLOT(setStopColor(const QString &)));
-	connect(stopShade, SIGNAL(valueChanged(int)), this, SLOT(setStopShade(int)));
+	stopColor->blockSignals(false);
+	stopShade->blockSignals(false);
 }
 
 void GradientEditor::setGradientEditable(bool val)
@@ -99,7 +108,7 @@
 	stopShade->setEnabled(val);
 	stopOpacity->setEnabled(val);
 	stopColor->setEnabled(val);
-	Position->setEnabled(val);
+	stopPos->setEnabled(val);
 	Preview->setGradientEditable(val);
 }
 
@@ -159,7 +168,7 @@
 void GradientEditor::languageChange()
 {
 	Desc->setText( tr( "Position:" ) );
-	Position->setSuffix( tr(" %") );
+	stopPos->setSuffix( tr(" %") );
 }
 
 bool GradientEditor::event(QEvent * event)

Modified: trunk/Scribus/scribus/ui/gradienteditor.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/ui/gradienteditor.h
==============================================================================
--- trunk/Scribus/scribus/ui/gradienteditor.h (original)
+++ trunk/Scribus/scribus/ui/gradienteditor.h Sun Apr  3 15:06:46 2011
@@ -56,6 +56,7 @@
 	void setPos(double);
 	void changePos(int);
 	void slotColor(QString name, int shade);
+	void slotDisplayStop(VColorStop* stop);
 	void setGradTrans(double val);
 	void setStopColor(const QString &);
 	void setStopTrans(int val);

Modified: trunk/Scribus/scribus/ui/gradienteditor.ui
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/ui/gradienteditor.ui
==============================================================================
--- trunk/Scribus/scribus/ui/gradienteditor.ui (original)
+++ trunk/Scribus/scribus/ui/gradienteditor.ui Sun Apr  3 15:06:46 2011
@@ -65,7 +65,7 @@
     </widget>
    </item>
    <item row="1" column="1">
-    <widget class="QSpinBox" name="Position">
+    <widget class="QSpinBox" name="stopPos">
      <property name="suffix">
       <string> %</string>
      </property>

Modified: trunk/Scribus/scribus/ui/gradientpreview.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/ui/gradientpreview.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/gradientpreview.cpp (original)
+++ trunk/Scribus/scribus/ui/gradientpreview.cpp Sun Apr  3 15:06:46 2011
@@ -132,9 +132,7 @@
 				ActStop = 0;
 				repaint();
 				QList<VColorStop*> cstops = fill_gradient.colorStops();
-				emit selectedColor(cstops.at(ActStop)->name, cstops.at(ActStop)->shade);
-				emit currTrans(cstops.at(ActStop)->opacity);
-				emit currStep(cstops.at(ActStop)->rampPoint);
+				emit selectedStop(cstops.at(ActStop));
 			}
 		}
 	}
@@ -154,9 +152,7 @@
 			if (fpo.contains(m->pos()))
 			{
 				ActStop = yg;
-				emit selectedColor(cstops.at(ActStop)->name, cstops.at(ActStop)->shade);
-				emit currTrans(cstops.at(ActStop)->opacity);
-				emit currStep(cstops.at(ActStop)->rampPoint);
+				emit selectedStop(cstops.at(ActStop));
 				repaint();
 				onlyselect = true;
 				return;
@@ -179,9 +175,7 @@
 				ActStop = 0;
 				repaint();
 				QList<VColorStop*> cstops = fill_gradient.colorStops();
-				emit selectedColor(cstops.at(ActStop)->name, cstops.at(ActStop)->shade);
-				emit currTrans(cstops.at(ActStop)->opacity);
-				emit currStep(cstops.at(ActStop)->rampPoint);
+				emit selectedStop(cstops.at(ActStop));
 			}
 			if ((m->y() < height()) && (m->y() > 43) && (m->x() > 0) && (m->x() < width()) && (ActStop == -1))
 			{
@@ -200,9 +194,7 @@
 					if (fpo.contains(m->pos()))
 					{
 						ActStop = yg;
-						emit selectedColor(cstops.at(ActStop)->name, cstops.at(ActStop)->shade);
-						emit currTrans(cstops.at(ActStop)->opacity);
-						emit currStep(cstops.at(ActStop)->rampPoint);
+						emit selectedStop(cstops.at(ActStop));
 						repaint();
 						break;
 					}
@@ -322,9 +314,7 @@
 		if (fpo.contains(mPos))
 		{
 			ActStop = yg;
-			emit selectedColor(cstops.at(ActStop)->name, cstops.at(ActStop)->shade);
-			emit currTrans(cstops.at(ActStop)->opacity);
-			emit currStep(cstops.at(ActStop)->rampPoint);
+			emit selectedStop(cstops.at(ActStop));
 			repaint();
 			break;
 		}
@@ -340,22 +330,17 @@
 		ActStop = 0;
 		repaint();
 		QList<VColorStop*> cstops = fill_gradient.colorStops();
-		emit selectedColor(cstops.at(ActStop)->name, cstops.at(ActStop)->shade);
-		emit currTrans(cstops.at(ActStop)->opacity);
-		emit currStep(cstops.at(ActStop)->rampPoint);
+		emit selectedStop(cstops.at(ActStop));
 	}
 }
 
 void GradientPreview::updateDisplay()
 {
-	ActStop = 0;
 	repaint();
 	if (!fill_gradient.colorStops().isEmpty())
 	{
 		QList<VColorStop*> cstops = fill_gradient.colorStops();
-		emit selectedColor(cstops.at(ActStop)->name, cstops.at(ActStop)->shade);
-		emit currTrans(cstops.at(ActStop)->opacity);
-		emit currStep(cstops.at(ActStop)->rampPoint);
+		emit selectedStop(cstops.at(ActStop));
 	}
 }
 
@@ -388,6 +373,32 @@
 	repaint();
 }
 
+void GradientPreview::setGradient(const VGradient& gradient)
+{
+	if ((gradient.colorStops().count() == fill_gradient.colorStops().count()) && (ActStop >= 0))
+	{
+		int diffStops = 0;
+		for (int i = 0; i < fill_gradient.colorStops().count(); ++i)
+		{
+			VColorStop* stop1 = gradient.colorStops().at(i);
+			VColorStop* stop2 = fill_gradient.colorStops().at(i);
+			if ((stop1->color != stop2->color) || (stop1->midPoint != stop2->midPoint) ||
+				(stop1->name  != stop2->name)  || (stop1->opacity != stop2->opacity)   ||
+				(stop1->rampPoint != stop2->rampPoint) || (stop1->shade != stop2->shade))
+			{
+				++diffStops;
+			}
+		}
+		if (diffStops > 1)
+			ActStop = 0;
+	}
+	if ((ActStop < 0) && (gradient.colorStops().count() > 0))
+		ActStop = 0;
+	if (ActStop >= gradient.colorStops().count())
+		ActStop = 0;
+	fill_gradient = gradient;
+}
+
 void GradientPreview::setGradientEditable(bool val)
 {
 	isEditable = val;

Modified: trunk/Scribus/scribus/ui/gradientpreview.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/ui/gradientpreview.h
==============================================================================
--- trunk/Scribus/scribus/ui/gradientpreview.h (original)
+++ trunk/Scribus/scribus/ui/gradientpreview.h Sun Apr  3 15:06:46 2011
@@ -55,8 +55,11 @@
 	void setActColor(QColor c, QString n, int s);
 	void setActTrans(double t);
 	void setActStep(double t);
+	void setGradient(const VGradient& gradient);
 	void setGradientEditable(bool val);
-	VGradient fill_gradient;
+
+	const VGradient& gradient() { return fill_gradient; }
+	
 	QList<int> StopM;
 	bool Mpressed;
 	bool outside;
@@ -66,12 +69,17 @@
 	int contextStop;
 	QPoint mPos;
 
+private:
+
+	VGradient fill_gradient;
+
 private slots:
 	void addStop();
 	void removeStop();
 
 signals:
 	void selectedColor(QString, int);
+	void selectedStop(VColorStop*);
 	void currTrans(double);
 	void currStep(double);
 	void gradientChanged();

Modified: trunk/Scribus/scribus/ui/masterpagepalette.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/ui/masterpagepalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/masterpagepalette.cpp (original)
+++ trunk/Scribus/scribus/ui/masterpagepalette.cpp Sun Apr  3 15:06:46 2011
@@ -6,6 +6,7 @@
 */
 #include "masterpagepalette.h"
 
+#include <QApplication>
 #include <QHBoxLayout>
 #include <QVBoxLayout>
 #include <QSpacerItem>

Modified: trunk/Scribus/scribus/ui/nodeeditpalette.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/ui/nodeeditpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/nodeeditpalette.cpp (original)
+++ trunk/Scribus/scribus/ui/nodeeditpalette.cpp Sun Apr  3 15:06:46 2011
@@ -863,7 +863,7 @@
 	}
 	PolySplit->setEnabled( false );
 	BezierClose->setEnabled( false );
-	emit Schliessen();
+	emit paletteClosed();
 	ScrPaletteBase::closeEvent(ce);
 }
 
@@ -883,7 +883,7 @@
 	PolySplit->setEnabled( false );
 	BezierClose->setEnabled( false );
 	EditCont->setChecked(false);
-	emit Schliessen();
+	emit paletteClosed();
 }
 
 void NodePalette::changeEvent(QEvent *e)

Modified: trunk/Scribus/scribus/ui/nodeeditpalette.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/ui/nodeeditpalette.h
==============================================================================
--- trunk/Scribus/scribus/ui/nodeeditpalette.h (original)
+++ trunk/Scribus/scribus/ui/nodeeditpalette.h Sun Apr  3 15:06:46 2011
@@ -132,8 +132,8 @@
 	double unitRatio;
 	
 signals:
-	void Schliessen();
 	void DocChanged();
+	void paletteClosed();
 };
 
 #endif // NODEPALETTE_H

Modified: trunk/Scribus/scribus/ui/outlinepalette.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/ui/outlinepalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/outlinepalette.cpp (original)
+++ trunk/Scribus/scribus/ui/outlinepalette.cpp Sun Apr  3 15:06:46 2011
@@ -326,7 +326,7 @@
 					else
 					{
 						item->PageItemObject->setItemName(NameNew);
-						m_MainWindow->propertiesPalette->SetCurItem(item->PageItemObject);
+						m_MainWindow->propertiesPalette->setCurrentItem(item->PageItemObject);
 						currDoc->setModified(true);
 					}
 				}

Modified: trunk/Scribus/scribus/ui/pagepalette.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/ui/pagepalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/pagepalette.cpp (original)
+++ trunk/Scribus/scribus/ui/pagepalette.cpp Sun Apr  3 15:06:46 2011
@@ -17,7 +17,7 @@
 #include <QMenu>
 #include <QMimeData>
 #include <QMessageBox>
-
+#include <QPainter>
 
 #include "commonstrings.h"
 #include "page.h"

Modified: trunk/Scribus/scribus/ui/propertiespalette.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/ui/propertiespalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette.cpp Sun Apr  3 15:06:46 2011
@@ -8,31 +8,15 @@
 
 #include "propertiespalette.h"
 
-#include <QButtonGroup>
-#include <QCheckBox>
 #include <QCloseEvent>
 #include <QComboBox>
 #include <QEvent>
 #include <QFocusEvent>
-#include <QFrame>
-#include <QGridLayout>
-#include <QGroupBox>
-#include <QHBoxLayout>
-#include <QImage>
 #include <QKeyEvent>
-#include <QLabel>
-#include <QListView>
 #include <QTransform>
-#include <QMenu>
-#include <QMessageBox>
 #include <QObject>
-#include <QPixmap>
 #include <QPoint>
-#include <QPushButton>
-#include <QRadioButton>
-#include <QRegExp>
 #include <QSpacerItem>
-#include <QSpinBox>
 #include <QStackedWidget>
 #include <QTimer>
 #include <QToolBox>
@@ -52,12 +36,14 @@
 #include "colorlistbox.h"
 #include "sccolorengine.h"
 #include "cpalette.h"
-#include "transparencypalette.h"
 #include "pageitem_textframe.h"
-#include "pageitem_regularpolygon.h"
-#include "pageitem_arc.h"
-#include "pageitem_spiral.h"
-#include "polyprops.h"
+#include "propertiespalette_group.h"
+#include "propertiespalette_image.h"
+#include "propertiespalette_line.h"
+#include "propertiespalette_shape.h"
+#include "propertiespalette_text.h"
+#include "propertiespalette_utils.h"
+#include "propertiespalette_xyz.h"
 #include "sccombobox.h"
 #include "scfonts.h"
 #include "scribus.h"
@@ -68,6 +54,7 @@
 #include "spalette.h"
 #include "styleselect.h"
 #include "tabmanager.h"
+#include "transparencypalette.h"
 #include "units.h"
 #include "undomanager.h"
 #include "util.h"
@@ -80,97 +67,22 @@
 
 //using namespace std;
 
-
-LineFormatValue::LineFormatValue() : m_Line(), m_doc(NULL), m_name() {};
-
-LineFormatValue::LineFormatValue( const multiLine& line, ScribusDoc* doc, const QString name ) : m_Line(line), m_doc(doc), m_name(name) {};
-
-LineFormatValue::LineFormatValue(const LineFormatValue& other)
-{
-	m_name = other.m_name;
-	m_Line = other.m_Line;
-	m_doc = other.m_doc;
-}
-
-LineFormatValue& LineFormatValue::operator= (const LineFormatValue& other)
-{
-	m_name = other.m_name;
-	m_Line = other.m_Line;
-	m_doc = other.m_doc;
-	return *this;
-}
-
-
-void LineFormatItemDelegate::redraw(const QVariant& data) const  
-{
-	const LineFormatValue& item(data.value<LineFormatValue>());
-	QColor tmpf;
-	pmap->fill(Qt::white);
-	QPainter p;
-	p.begin(pmap.get());
-	for (int its = item.m_Line.size()-1; its > -1; its--)
-	{
-		const ScColor& col = item.m_doc->PageColors[item.m_Line[its].Color];
-		tmpf = ScColorEngine::getDisplayColor(col, item.m_doc, item.m_Line[its].Shade);
-		QPen pen;
-		QVector<double> m_array;
-		if (item.m_Line[its].Dash == 1)
-			pen.setStyle(Qt::SolidLine);
-		else
-		{
-			getDashArray(item.m_Line[its].Dash, 1, m_array);
-			pen.setDashPattern(m_array);
-		}
-		pen.setColor(tmpf);
-		pen.setWidth(qMax(static_cast<int>(item.m_Line[its].Width), 1));
-		pen.setCapStyle(static_cast<Qt::PenCapStyle>(item.m_Line[its].LineEnd));
-		pen.setJoinStyle(static_cast<Qt::PenJoinStyle>(item.m_Line[its].LineJoin));
-		p.setPen(pen);
-		p.drawLine(0, 18, 37, 18);
-	}
-	p.end();
-}
-
-QString LineFormatItemDelegate::text(const QVariant& data) const
-{
-	return data.toString();
-}
-
-NameWidget::NameWidget(QWidget* parent) : QLineEdit(parent)
-{
-	setObjectName("namewidget");
-	QRegExp rx( "\\w+" );
-	QValidator* validator = new QRegExpValidator( rx, this );
-	setValidator( validator );
-}
-
-void NameWidget::focusOutEvent(QFocusEvent *e)
-{
-	emit Leaved();
-	QLineEdit::focusOutEvent(e);
-}
-
-PropertiesPalette::PropertiesPalette( QWidget* parent) : ScrPaletteBase( parent, "PropertiesPalette", false, 0)
+PropertiesPalette::PropertiesPalette( QWidget* parent) : ScDockPalette( parent, "PropertiesPalette", 0)
 {
 	m_ScMW=0;
-	doc=0;
-	HaveDoc = false;
-	HaveItem = false;
-	RoVal = 0;
+	m_doc=0;
+	m_haveDoc = false;
+	m_haveItem = false;
 	m_unitRatio = 1.0;
-	tmpSelection = new Selection(this, false);
-	tmpSelection->clear();
+
+	//setObjectName(QString::fromLocal8Bit("PropertiesPalette"));
 	setSizePolicy( QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
 
-	_userActionOn = false;
-	userActionSniffer = new UserActionSniffer(this);
-	connect(userActionSniffer, SIGNAL(actionStart()), this, SLOT(spinboxStartUserAction()));
-	connect(userActionSniffer, SIGNAL(actionEnd()), this, SLOT(spinboxFinishUserAction()));
-
-	MpalLayout = new QVBoxLayout( this );
+	MpalLayout = new QVBoxLayout();
 	MpalLayout->setMargin(5);
 	MpalLayout->setSpacing(1);
-	setOrientation(Qt::Vertical);
+	setLayout(MpalLayout);
+
 	QFont f(font());
 	f.setPointSize(f.pointSize()-1);
 	setFont(f);
@@ -178,147 +90,13 @@
 	TabStack = new QToolBox( this );
 
 	page = new QWidget( TabStack );
+	
 	pageLayout = new QVBoxLayout( page );
 	pageLayout->setMargin(0);
 	pageLayout->setSpacing(5);
 
-	NameGroup = new QGroupBox( page );
-	NameGroupLayout = new QHBoxLayout( NameGroup );
-	NameGroupLayout->setMargin(5);
-	NameGroupLayout->setSpacing(4);
-	NameGroupLayout->setAlignment( Qt::AlignTop );
-	NameEdit = new NameWidget(NameGroup);
-	NameEdit->setFocusPolicy(Qt::ClickFocus);
-	NameGroupLayout->addWidget( NameEdit );
-	pageLayout->addWidget( NameGroup );
-
-	GeoGroup = new QGroupBox(page);
-	GeoGroupLayout = new QGridLayout( GeoGroup );
-	GeoGroupLayout->setMargin(5);
-	GeoGroupLayout->setSpacing(4);
-	GeoGroupLayout->setAlignment( Qt::AlignTop );
-
-	Xpos = new ScrSpinBox( -3000, 3000, GeoGroup, 0 );
-	installSniffer(Xpos);
-	GeoGroupLayout->addWidget( Xpos, 0, 1 );
-	Ypos = new ScrSpinBox( -3000, 3000, GeoGroup, 0 );
-	installSniffer(Ypos);
-	GeoGroupLayout->addWidget( Ypos, 1, 1 );
-	Width = new ScrSpinBox( GeoGroup, 0 );
-	installSniffer(Width);
-	GeoGroupLayout->addWidget( Width, 2, 1 );
-	Height = new ScrSpinBox( GeoGroup, 0 );
-	installSniffer(Height);
-	GeoGroupLayout->addWidget( Height, 3, 1 );
-
-	xposLabel = new QLabel( "&X-Pos:", GeoGroup );
-	xposLabel->setBuddy(Xpos);
-	GeoGroupLayout->addWidget( xposLabel, 0, 0 );
-	yposLabel = new QLabel( "&Y-Pos:", GeoGroup );
-	yposLabel->setBuddy(Ypos);
-	GeoGroupLayout->addWidget( yposLabel, 1, 0 );
-	widthLabel = new QLabel( "&Width:", GeoGroup );
-	widthLabel->setBuddy(Width);
-	GeoGroupLayout->addWidget( widthLabel, 2, 0 );
-	heightLabel = new QLabel( "&Height:", GeoGroup );
-	heightLabel->setBuddy(Height);
-	GeoGroupLayout->addWidget( heightLabel, 3, 0 );
-
-	keepFrameWHRatioButton = new LinkButton( GeoGroup );
-	keepFrameWHRatioButton->setCheckable( true );
-	keepFrameWHRatioButton->setAutoRaise( true );
-	keepFrameWHRatioButton->setMaximumSize( QSize( 15, 32767 ) );
-	keepFrameWHRatioButton->setChecked(false);
-	GeoGroupLayout->addWidget( keepFrameWHRatioButton, 2, 2, 2, 1 );
-	Rotation = new ScrSpinBox( GeoGroup, 6);
-	Rotation->setWrapping( true );
-	installSniffer(Rotation);
-	rotationLabel = new QLabel( "&Rotation:", GeoGroup );
-	rotationLabel->setBuddy(Rotation);
-	GeoGroupLayout->addWidget( rotationLabel, 4, 0 );
-	GeoGroupLayout->addWidget( Rotation, 4, 1 );
-	basepointLabel = new QLabel( "Basepoint:", GeoGroup );
-	GeoGroupLayout->addWidget( basepointLabel, 5, 0 );
-	RotationGroup = new BasePointWidget(GeoGroup, 0);
-	GeoGroupLayout->addWidget( RotationGroup, 5, 1, 1, 1, Qt::AlignLeft);
-	pageLayout->addWidget( GeoGroup );
-
-	layout60 = new QHBoxLayout;
-	layout60->setMargin(0);
-	layout60->setSpacing(5);
-
-	LayerGroup = new QGroupBox( "Level", page );
-	LayerGroupLayout = new QGridLayout( LayerGroup );
-	LayerGroupLayout->setSpacing( 4 );
-	LayerGroupLayout->setMargin( 5 );
-	LayerGroupLayout->setAlignment( Qt::AlignTop );
-	Zup = new QToolButton( LayerGroup );
-	Zup->setMaximumSize( QSize( 22, 22 ) );
-	Zup->setIcon(QIcon(loadIcon("16/go-up.png")));
-	LayerGroupLayout->addWidget( Zup, 0, 0 );
-	ZDown = new QToolButton( LayerGroup );
-	ZDown->setMaximumSize( QSize( 22, 22 ) );
-	ZDown->setIcon(QIcon(loadIcon("16/go-down.png")));
-	LayerGroupLayout->addWidget( ZDown, 1, 0 );
-	ZTop = new QToolButton( LayerGroup );
-	ZTop->setMaximumSize( QSize( 22, 22 ) );
-	ZTop->setIcon(QIcon(loadIcon("16/go-top.png")));
-	LayerGroupLayout->addWidget( ZTop, 0, 1 );
-	ZBottom = new QToolButton( LayerGroup );
-	ZBottom->setMaximumSize( QSize( 22, 22 ) );
-	ZBottom->setIcon(QIcon(loadIcon("16/go-bottom.png")));
-	LayerGroupLayout->addWidget( ZBottom, 1, 1 );
-	LevelTxt = new QLabel( "  ", LayerGroup );
-	LevelTxt->setAlignment( Qt::AlignCenter );
-	LayerGroupLayout->addWidget( LevelTxt, 0, 2, 2, 1 );
-
-	layout60->addWidget( LayerGroup );
-	QSpacerItem* spacer2 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
-	layout60->addItem( spacer2 );
-
-	Layout44 = new QGridLayout;
-	Layout44->setSpacing( 4 );
-	Layout44->setMargin( 5 );
-
-	DoGroup = new QToolButton( page );
-	DoGroup->setIcon(QIcon(loadIcon("group.png")));
-	Layout44->addWidget( DoGroup, 0, 0 );
-	DoUnGroup = new QToolButton( page );
-	DoUnGroup->setIcon(QIcon(loadIcon("ungroup.png")));
-	Layout44->addWidget( DoUnGroup, 1, 0 );
-
-	FlipH = new QToolButton( page );
-	FlipH->setIcon(QIcon(loadIcon("16/flip-object-horizontal.png")));
-	FlipH->setCheckable( true );
-	Layout44->addWidget( FlipH, 0, 1 );
-	FlipV = new QToolButton( page );
-	FlipV->setIcon(QIcon(loadIcon("16/flip-object-vertical.png")));
-	FlipV->setCheckable( true );
-	Layout44->addWidget( FlipV, 1, 1 );
-	Locked = new QToolButton( page );
-	Locked->setCheckable( true );
-	QIcon a = QIcon();
-	a.addPixmap(loadIcon("16/lock.png"), QIcon::Normal, QIcon::On);
-	a.addPixmap(loadIcon("16/lock-unlocked.png"), QIcon::Normal, QIcon::Off);
-	Locked->setIcon(a);
-	Layout44->addWidget( Locked, 0, 2 );
-	NoPrint = new QToolButton( page );
-	NoPrint->setCheckable( true );
-	QIcon a2 = QIcon();
-	a2.addPixmap(loadIcon("NoPrint.png"), QIcon::Normal, QIcon::On);
-	a2.addPixmap(loadIcon("16/document-print.png"), QIcon::Normal, QIcon::Off);
-	NoPrint->setIcon(a2);
-	Layout44->addWidget( NoPrint, 1, 2 );
-	NoResize = new QToolButton( page );
-	NoResize->setCheckable( true );
-	QIcon a3 = QIcon();
-	a3.addPixmap(loadIcon("framenoresize.png"), QIcon::Normal, QIcon::On);
-	a3.addPixmap(loadIcon("frameresize.png"), QIcon::Normal, QIcon::Off);
-	NoResize->setIcon(a3);
-	Layout44->addWidget( NoResize, 0, 3 );
-	layout60->addLayout( Layout44 );
-
-	pageLayout->addLayout( layout60 );
+	xyzPal = new PropertiesPalette_XYZ( page );
+	pageLayout->addWidget( xyzPal );
 
 	QSpacerItem* spacer13 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
 	pageLayout->addItem( spacer13 );
@@ -329,108 +107,8 @@
 	pageLayout_2->setSpacing( 5 );
 	pageLayout_2->setMargin( 0 );
 
-	ShapeGroup = new QGroupBox( page_2 );
-	ShapeGroupLayout = new QHBoxLayout( ShapeGroup );
-	ShapeGroupLayout->setSpacing( 2 );
-	ShapeGroupLayout->setMargin( 0 );
-	ShapeGroupLayout->setAlignment( Qt::AlignTop );
-	SRect = new QLabel( "Shape:", ShapeGroup );
-	ShapeGroupLayout->addWidget( SRect );
-	SCustom = new Autoforms( ShapeGroup );
-	ShapeGroupLayout->addWidget( SCustom );
-
-	EditShape = new QToolButton( ShapeGroup );
-	ShapeGroupLayout->addWidget( EditShape );
-	pageLayout_2->addWidget( ShapeGroup );
-
-	Layout13 = new QHBoxLayout;
-	Layout13->setSpacing( 2 );
-	Layout13->setMargin( 0 );
-
-	RoundRect = new ScrSpinBox( page_2, 0 );
-	rndcornersLabel = new QLabel( "R&ound\nCorners:", page_2 );
-	rndcornersLabel->setBuddy(RoundRect);
-	Layout13->addWidget( rndcornersLabel );
-	Layout13->addWidget( RoundRect );
-	pageLayout_2->addLayout( Layout13 );
-
-	textFlowOptions = new QGroupBox( page_2 );
-	textFlowOptionsLayout = new QVBoxLayout( textFlowOptions );
-	textFlowOptionsLayout->setSpacing( 5 );
-	textFlowOptionsLayout->setMargin( 5 );
-	textFlowOptionsLayout->setAlignment( Qt::AlignTop );
-	textFlowDisabled = new QToolButton( textFlowOptions );
-	textFlowDisabled->setCheckable( true );
-	textFlowDisabled->setAutoExclusive(true);
-	textFlowDisabled->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
-	textFlowDisabled->setText( "Disabled" );
-	textFlowDisabled->setIcon(QIcon(loadIcon("flow-none.png")));
-	textFlowOptionsLayout->addWidget( textFlowDisabled );
-	textFlowUsesFrameShape  = new QToolButton( textFlowOptions );
-	textFlowUsesFrameShape->setCheckable( true );
-	textFlowUsesFrameShape->setAutoExclusive(true);
-	textFlowUsesFrameShape->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
-	textFlowUsesFrameShape->setText( "Use &Frame Shape" );
-	textFlowUsesFrameShape->setIcon(QIcon(loadIcon("flow-frame.png")));
-	textFlowOptionsLayout->addWidget( textFlowUsesFrameShape );
-	textFlowUsesBoundingBox = new QToolButton( textFlowOptions );
-	textFlowUsesBoundingBox->setCheckable( true );
-	textFlowUsesBoundingBox->setAutoExclusive(true);
-	textFlowUsesBoundingBox->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
-	textFlowUsesBoundingBox->setText( "Use &Bounding Box" );
-	textFlowUsesBoundingBox->setIcon(QIcon(loadIcon("flow-bounding.png")));
-	textFlowOptionsLayout->addWidget( textFlowUsesBoundingBox );
-	textFlowUsesContourLine = new QToolButton( textFlowOptions );
-	textFlowUsesContourLine->setCheckable( true );
-	textFlowUsesContourLine->setAutoExclusive(true);
-	textFlowUsesContourLine->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
-	textFlowUsesContourLine->setText( "&Use Contour Line" );
-	textFlowUsesContourLine->setIcon(QIcon(loadIcon("flow-contour.png")));
-	textFlowOptionsLayout->addWidget( textFlowUsesContourLine );
-	textFlowUsesImageClipping = new QToolButton( textFlowOptions );
-	textFlowUsesImageClipping->setCheckable( true );
-	textFlowUsesImageClipping->setAutoExclusive(true);
-	textFlowUsesImageClipping->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
-	textFlowUsesImageClipping->setText( "Use Image Clip Path" );
-	textFlowUsesImageClipping->setIcon(QIcon(loadIcon("flow-contour.png")));
-	textFlowOptionsLayout->addWidget( textFlowUsesImageClipping );
-	pageLayout_2->addWidget( textFlowOptions  );
-	textFlowDisabled->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
-	textFlowUsesFrameShape->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
-	textFlowUsesBoundingBox->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
-	textFlowUsesContourLine->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
-	textFlowUsesImageClipping->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
-	textFlowOptionsB = new QButtonGroup( page_2 );
-	textFlowOptionsB->addButton(textFlowDisabled, 0);
-	textFlowOptionsB->addButton(textFlowUsesFrameShape, 1);
-	textFlowOptionsB->addButton(textFlowUsesBoundingBox, 2);
-	textFlowOptionsB->addButton(textFlowUsesContourLine, 3);
-	textFlowOptionsB->addButton(textFlowUsesImageClipping, 4);
-
-	TabStack2 = new QStackedWidget( page_2 );
-
-	page_2a = new QWidget( TabStack2 );
-	TabStack2->addWidget( page_2a );
-
-	page_2c = new QWidget( TabStack2 );
-	pageLayout_2c = new QVBoxLayout( page_2c );
-	pageLayout_2c->setSpacing( 5 );
-	pageLayout_2c->setMargin( 0 );
-	Distance3 = new QGroupBox( page_2c );
-	DistanceLayout3 = new QVBoxLayout( Distance3 );
-	DistanceLayout3->setSpacing( 2 );
-	DistanceLayout3->setMargin( 5 );
-	DistanceLayout3->setAlignment( Qt::AlignTop );
-	EvenOdd = new QRadioButton( "Even-Odd", Distance3 );
-	DistanceLayout3->addWidget( EvenOdd );
-	NonZero = new QRadioButton( "Non Zero", Distance3 );
-	DistanceLayout3->addWidget( NonZero );
-	EvenOdd->setChecked( true );
-	Distance3->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);
-	pageLayout_2c->addWidget(Distance3);
-	TabStack2->addWidget( page_2c );
-
-	pageLayout_2->addWidget( TabStack2 );
+	shapePal = new PropertiesPalette_Shape( page_2 );
+	pageLayout_2->addWidget( shapePal );
 
 	QSpacerItem* spacer6 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
 	pageLayout_2->addItem( spacer6 );
@@ -441,75 +119,8 @@
 	page_group_layout->setSpacing( 5 );
 	page_group_layout->setMargin( 0 );
 
-	ShapeGroup2 = new QGroupBox( page_group );
-	ShapeGroupLayout2 = new QHBoxLayout( ShapeGroup2 );
-	ShapeGroupLayout2->setSpacing( 2 );
-	ShapeGroupLayout2->setMargin( 0 );
-	ShapeGroupLayout2->setAlignment( Qt::AlignTop );
-	SRect2 = new QLabel( "Shape:", ShapeGroup2 );
-	ShapeGroupLayout2->addWidget( SRect2 );
-	SCustom2 = new Autoforms( ShapeGroup2 );
-	ShapeGroupLayout2->addWidget( SCustom2 );
-	EditShape2 = new QToolButton( ShapeGroup2 );
-	ShapeGroupLayout2->addWidget( EditShape2 );
-	page_group_layout->addWidget( ShapeGroup2 );
-
-	textFlowOptions2 = new QGroupBox( page_group );
-	textFlowOptionsLayout2 = new QVBoxLayout( textFlowOptions2 );
-	textFlowOptionsLayout2->setSpacing( 5 );
-	textFlowOptionsLayout2->setMargin( 5 );
-	textFlowOptionsLayout2->setAlignment( Qt::AlignTop );
-	textFlowDisabled2 = new QToolButton( textFlowOptions2 );
-	textFlowDisabled2->setCheckable( true );
-	textFlowDisabled2->setAutoExclusive(true);
-	textFlowDisabled2->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
-	textFlowDisabled2->setText( "Disabled" );
-	textFlowDisabled2->setIcon(QIcon(loadIcon("flow-none.png")));
-	textFlowOptionsLayout2->addWidget( textFlowDisabled2 );
-	textFlowUsesFrameShape2  = new QToolButton( textFlowOptions2 );
-	textFlowUsesFrameShape2->setCheckable( true );
-	textFlowUsesFrameShape2->setAutoExclusive(true);
-	textFlowUsesFrameShape2->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
-	textFlowUsesFrameShape2->setText( "Use &Frame Shape" );
-	textFlowUsesFrameShape2->setIcon(QIcon(loadIcon("flow-frame.png")));
-	textFlowOptionsLayout2->addWidget( textFlowUsesFrameShape2 );
-	textFlowUsesBoundingBox2 = new QToolButton( textFlowOptions2 );
-	textFlowUsesBoundingBox2->setCheckable( true );
-	textFlowUsesBoundingBox2->setAutoExclusive(true);
-	textFlowUsesBoundingBox2->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
-	textFlowUsesBoundingBox2->setText( "Use &Bounding Box" );
-	textFlowUsesBoundingBox2->setIcon(QIcon(loadIcon("flow-bounding.png")));
-	textFlowOptionsLayout2->addWidget( textFlowUsesBoundingBox2 );
-	textFlowUsesContourLine2 = new QToolButton( textFlowOptions2 );
-	textFlowUsesContourLine2->setCheckable( true );
-	textFlowUsesContourLine2->setAutoExclusive(true);
-	textFlowUsesContourLine2->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
-	textFlowUsesContourLine2->setText( "&Use Contour Line" );
-	textFlowUsesContourLine2->setIcon(QIcon(loadIcon("flow-contour.png")));
-	textFlowOptionsLayout2->addWidget( textFlowUsesContourLine2 );
-	textFlowUsesImageClipping2 = new QToolButton( textFlowOptions2 );
-	textFlowUsesImageClipping2->setCheckable( true );
-	textFlowUsesImageClipping2->setAutoExclusive(true);
-	textFlowUsesImageClipping2->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
-	textFlowUsesImageClipping2->setText( "Use Image Clip Path" );
-	textFlowUsesImageClipping2->setIcon(QIcon(loadIcon("flow-contour.png")));
-	textFlowOptionsLayout2->addWidget( textFlowUsesImageClipping2 );
-	page_group_layout->addWidget( textFlowOptions2  );
-	textFlowDisabled2->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
-	textFlowUsesFrameShape2->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
-	textFlowUsesBoundingBox2->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
-	textFlowUsesContourLine2->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
-	textFlowUsesImageClipping2->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
-	textFlowOptionsB2 = new QButtonGroup( page_group );
-	textFlowOptionsB2->addButton(textFlowDisabled2, 0);
-	textFlowOptionsB2->addButton(textFlowUsesFrameShape2, 1);
-	textFlowOptionsB2->addButton(textFlowUsesBoundingBox2, 2);
-	textFlowOptionsB2->addButton(textFlowUsesContourLine2, 3);
-	textFlowOptionsB2->addButton(textFlowUsesImageClipping2, 4);
-
-	TpalGroup = new Tpalette(page_group);
-	TpalGroup->hideSelectionButtons();
-	page_group_layout->addWidget( TpalGroup );
+	groupPal = new PropertiesPalette_Group( page_group );
+	page_group_layout->addWidget( groupPal );
 
 	QSpacerItem* spacerTr2 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
 	page_group_layout->addItem( spacerTr2 );
@@ -521,498 +132,18 @@
 	pageLayout_3->setMargin( 0 );
 	pageLayout_3->setAlignment( Qt::AlignLeft );
 
-	TextTree = new ScTreeWidget(page_3);
-
-	layout41 = new QGridLayout();
-	layout41->setSpacing( 3 );
-	layout41->setMargin( 3 );
-	layout41->setAlignment( Qt::AlignLeft );
-	Fonts = new FontComboH(page_3);
-	layout41->addWidget( Fonts, 0, 0, 1, 4 );
-	Size = new ScrSpinBox( 0.5, 2048, page_3, 0 );
-	Size->setPrefix( "" );
-	fontsizeLabel = new QLabel( "", page_3 );
-	fontsizeLabel->setPixmap(loadIcon("Zeichen.xpm"));
-	layout41->addWidget( fontsizeLabel, 1, 0 );
-	layout41->addWidget( Size, 1, 1 );
-	lineSpacingLabel = new QLabel( "", page_3 );
-	lineSpacingLabel->setPixmap(loadIcon("linespacing2.png"));
-	lineSpacingModeCombo = new QComboBox( page_3 );
-	LineSp = new ScrSpinBox( page_3, 0 );
-	layout41->addWidget( LineSp, 2, 2 );
-	layout41->addWidget( lineSpacingLabel, 2, 0 );
-	layout41->addWidget( lineSpacingModeCombo, 2, 1 );
-	Layout1AL = new QHBoxLayout;
-	Layout1AL->setSpacing( 0 );
-	Layout1AL->setMargin( 0 );
-	Layout1AL->setAlignment( Qt::AlignLeft );
-	GroupAlign = new AlignSelect(page_3);
-	Layout1AL->addWidget(GroupAlign);
-	QSpacerItem* spacer7AL = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
-	Layout1AL->addItem( spacer7AL );
-	layout41->addLayout( Layout1AL, 3, 0, 1, 4 );
-	pageLayout_3->addLayout( layout41 );
-
-	colorWidgets = new QFrame();
-	colorWidgets->setFrameStyle(QFrame::Box | QFrame::Plain);
-	colorWidgets->setLineWidth(1);
-	layout41c = new QGridLayout(colorWidgets);
-	layout41c->setSpacing( 3 );
-	layout41c->setMargin( 3 );
-	layout41c->setAlignment( Qt::AlignLeft );
-	layout23 = new QHBoxLayout;
-	layout23->setSpacing( 3 );
-	layout23->setMargin( 0 );
-	layout23->setAlignment( Qt::AlignLeft );
-	StrokeIcon = new QLabel( "", colorWidgets );
-	StrokeIcon->setPixmap(loadIcon("16/color-stroke.png"));
-	StrokeIcon->setScaledContents( false );
-	layout23->addWidget( StrokeIcon );
-	TxStroke = new ColorCombo( false, colorWidgets);
-	layout23->addWidget( TxStroke );
-	ShadeTxt1 = new QLabel( "", colorWidgets );
-	ShadeTxt1->setPixmap(loadIcon("shade.png"));
-	layout23->addWidget( ShadeTxt1 );
-	PM1 = new ShadeButton(colorWidgets);
-	layout23->addWidget( PM1 );
-	QSpacerItem* spacer7s = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
-	layout23->addItem( spacer7s );
-	layout41c->addLayout( layout23, 1, 0, 1, 4 );
-	layout24 = new QHBoxLayout;
-	layout24->setSpacing( 3 );
-	layout24->setMargin( 0 );
-	layout24->setAlignment( Qt::AlignLeft );
-	FillIcon = new QLabel( "", colorWidgets );
-	FillIcon->setPixmap(loadIcon("16/color-fill.png"));
-	layout24->addWidget( FillIcon );
-	TxFill = new ColorCombo( false, colorWidgets);
-	layout24->addWidget( TxFill );
-	ShadeTxt2 = new QLabel("", colorWidgets );
-	ShadeTxt2->setPixmap(loadIcon("shade.png"));
-	layout24->addWidget( ShadeTxt2 );
-	PM2 = new ShadeButton(colorWidgets);
-	layout24->addWidget( PM2 );
-	QSpacerItem* spacer7f = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
-	layout24->addItem( spacer7f );
-	layout41c->addLayout( layout24, 0, 0, 1, 4 );
-	Layout1 = new QHBoxLayout;
-	Layout1->setSpacing( 0 );
-	Layout1->setMargin( 0 );
-	Layout1->setAlignment( Qt::AlignLeft );
-	SeStyle = new StyleSelect(colorWidgets);
-	Layout1->addWidget(SeStyle);
-	Revert = new QToolButton( colorWidgets );
-	Revert->setMaximumSize( QSize( 22, 22 ) );
-	Revert->setText("");
-	Revert->setIcon(loadIcon("Revers.png"));
-	Revert->setCheckable( true );
-	Layout1->addWidget( Revert );
-	QSpacerItem* spacer7 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
-	Layout1->addItem( spacer7 );
-	layout41c->addLayout( Layout1, 2, 0, 1, 4 );
-	colorWidgetsItem = TextTree->addWidget( tr("Color & Effects"), colorWidgets);
-
-
-	styleWidgets = new QFrame();
-	styleWidgets->setFrameStyle(QFrame::Box | QFrame::Plain);
-	styleWidgets->setLineWidth(1);
-	GroupBox3aLayout = new QGridLayout(styleWidgets);
-	GroupBox3aLayout->setSpacing( 3 );
-	GroupBox3aLayout->setMargin( 3 );
-	paraStyleCombo = new ParaStyleComboBox(styleWidgets);
-	paraStyleLabel = new QLabel( "Paragraph St&yle:", styleWidgets );
-	paraStyleLabel->setBuddy(paraStyleCombo);
-	paraStyleClear = new QToolButton( styleWidgets );
-	paraStyleClear->setMaximumSize( QSize( 22, 22 ) );
-	paraStyleClear->setText("");
-	paraStyleClear->setIcon(loadIcon("16/edit-clear.png"));
-	GroupBox3aLayout->addWidget( paraStyleLabel, 0, 0, 1, 2 );
-	GroupBox3aLayout->addWidget( paraStyleCombo, 1, 0 );
-	GroupBox3aLayout->addWidget( paraStyleClear, 1, 1 );
-	charStyleCombo = new CharStyleComboBox(styleWidgets);
-	charStyleLabel = new QLabel( "Character St&yle:", styleWidgets );
-	charStyleLabel->setBuddy(charStyleCombo);
-	charStyleClear = new QToolButton( styleWidgets );
-	charStyleClear->setMaximumSize( QSize( 22, 22 ) );
-	charStyleClear->setText("");
-	charStyleClear->setIcon(loadIcon("16/edit-clear.png"));
-	GroupBox3aLayout->addWidget( charStyleLabel, 2, 0, 1, 2 );
-	GroupBox3aLayout->addWidget( charStyleCombo, 3, 0 );
-	GroupBox3aLayout->addWidget( charStyleClear, 3, 1 );
-	
-	styleWidgetsItem = TextTree->addWidget( tr("Style Settings"), styleWidgets);
-
-	flopBox = new QFrame();
-	flopBox->setFrameStyle(QFrame::Box | QFrame::Plain);
-	flopBox->setLineWidth(1);
-	flopLayout = new QGridLayout(flopBox);
-	flopGroup = new QButtonGroup(flopBox);
-	flopRealHeight = new QRadioButton(tr("Maximum Ascent"), flopBox);
-	flopFontAscent = new QRadioButton(tr("Font Ascent"), flopBox);
-	flopLineSpacing = new QRadioButton(tr("Line Spacing"),flopBox);
-	flopGroup->addButton(flopRealHeight, 0);
-	flopGroup->addButton(flopFontAscent, 1);
-	flopGroup->addButton(flopLineSpacing, 2);
-	flopLayout->addWidget(flopRealHeight);
-	flopLayout->addWidget(flopFontAscent);
-	flopLayout->addWidget(flopLineSpacing);
-	flopRealHeight->setChecked(true);
-	flopItem = TextTree->addWidget( tr("First Line Offset"), flopBox);
-
-	Distance = new QFrame();
-	Distance->setFrameStyle(QFrame::Box | QFrame::Plain);
-	Distance->setLineWidth(1);
-	DistanceLayout = new QGridLayout( Distance );
-	DistanceLayout->setSpacing( 2 );
-	DistanceLayout->setMargin( 5 );
-	DistanceLayout->setAlignment( Qt::AlignTop );
-
-	DCol = new QSpinBox(Distance );
-	DCol->setMaximum( 3000 );
-	DCol->setMinimum( 1 );
-	columnsLabel = new QLabel( "Colu&mns:", Distance );
-	columnsLabel->setBuddy(DCol);
-	DistanceLayout->addWidget( columnsLabel, 0, 0 );
-	DistanceLayout->addWidget( DCol, 0, 1 );
-
-	dGap = new ScrSpinBox( 0, 300, Distance, 0 );
-	colgapLabel = new ScComboBox( Distance );
-	DistanceLayout->addWidget( colgapLabel, 1, 0); //, Qt::AlignLeft );
-	DistanceLayout->addWidget( dGap, 1, 1 );
-
-	DTop = new ScrSpinBox( 0, 300, Distance, 0 );
-	topLabel = new QLabel( "To&p:", Distance );
-	topLabel->setBuddy(DTop);
-	DistanceLayout->addWidget( topLabel, 2, 0 );
-	DistanceLayout->addWidget( DTop, 2, 1 );
-
-	DBottom = new ScrSpinBox( 0, 300, Distance, 0 );
-	bottomLabel = new QLabel( "&Bottom:", Distance );
-	bottomLabel->setBuddy(DBottom);
-	DistanceLayout->addWidget( bottomLabel, 3, 0 );
-	DistanceLayout->addWidget( DBottom, 3, 1 );
-
-	DLeft = new ScrSpinBox( 0, 300, Distance, 0 );
-	leftLabel = new QLabel( "&Left:", Distance );
-	leftLabel->setBuddy(DLeft);
-	DistanceLayout->addWidget( leftLabel, 4, 0 );
-	DistanceLayout->addWidget( DLeft, 4, 1 );
-
-	DRight = new ScrSpinBox( 0, 300, Distance, 0 );
-	rightLabel = new QLabel( "&Right:", Distance );
-	rightLabel->setBuddy(DRight);
-	DistanceLayout->addWidget( rightLabel, 5, 0 );
-	DistanceLayout->addWidget( DRight, 5, 1 );
-
-	TabsButton = new QToolButton( Distance );
-	TabsButton->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
-	DistanceLayout->addWidget( TabsButton, 7, 0, 1, 2 );
-    DistanceItem = TextTree->addWidget( tr("Columns & Text Distances"), Distance);
-
-
-	//<< Optical Margins
-
-	OptMargins = new QFrame();
-	OptMargins->setFrameStyle(QFrame::Box | QFrame::Plain);
-	OptMargins->setLineWidth(1);
-	OptMarginsLayout = new QVBoxLayout( OptMargins );
-	OptMarginsLayout->setSpacing( 2 );
-	OptMarginsLayout->setMargin( 5 );
-	OptMarginsLayout->setAlignment( Qt::AlignTop );
-
-	optMarginRadioNone = new QRadioButton(OptMargins);
-	optMarginRadioNone->setObjectName(QString::fromUtf8("optMarginRadioNone"));
-	
-	optMarginRadioBoth = new QRadioButton(OptMargins);
-	optMarginRadioBoth->setObjectName(QString::fromUtf8("optMarginRadioBoth"));
-	
-	optMarginRadioLeft = new QRadioButton(OptMargins);
-	optMarginRadioLeft->setObjectName(QString::fromUtf8("optMarginRadioLeft"));
-	
-	optMarginRadioRight = new QRadioButton(OptMargins);
-	optMarginRadioRight->setObjectName(QString::fromUtf8("optMarginRadioRight"));
-	
-	optMarginResetButton = new QPushButton(OptMargins);
-	optMarginResetButton->setObjectName(QString::fromUtf8("optMarginResetButton"));
-
-	optMarginRadioNone->setText( tr("None","optical margins") );
-	optMarginRadioBoth->setText( tr("Both Sides","optical margins") );
-	optMarginRadioLeft->setText( tr("Left Only","optical margins") );
-	optMarginRadioRight->setText( tr("Right Only","optical margins") );
-	optMarginResetButton->setText( tr("Reset") );
-
-	OptMarginsLayout->addWidget(optMarginRadioNone);
-	OptMarginsLayout->addWidget(optMarginRadioBoth);
-	OptMarginsLayout->addWidget(optMarginRadioLeft);
-	OptMarginsLayout->addWidget(optMarginRadioRight);
-	OptMarginsLayout->addWidget(optMarginResetButton);
-
-	OptMarginsItem = TextTree->addWidget( tr("Optical Margins"), OptMargins);
-
-	//>> Optical Margins
-
-	//<<Advanced Settings
-	advancedWidgets = new QFrame();
-	advancedWidgets->setFrameStyle(QFrame::Box | QFrame::Plain);
-	advancedWidgets->setLineWidth(1);
-	layout41a = new QGridLayout(advancedWidgets);
-	layout41a->setSpacing( 3 );
-	layout41a->setMargin( 3 );
-	layout41a->setAlignment( Qt::AlignLeft );
-	ChBase = new ScrSpinBox( -100, 100, advancedWidgets, 0 );
-	ChBase->setValue( 0 );
-	ChBaseTxt = new QLabel("", advancedWidgets );
-	ChBaseTxt->setPixmap(loadIcon("textbase.png"));
-	layout41a->addWidget( ChBaseTxt, 0, 0 );
-	layout41a->addWidget( ChBase, 0, 1 );
-	Extra = new ScrSpinBox( advancedWidgets, 0 );
-	layout41a->addWidget( Extra, 0, 3 );
-	trackingLabel = new QLabel( "", advancedWidgets );
-	trackingLabel->setText("");
-	trackingLabel->setPixmap(loadIcon("textkern.png"));
-	layout41a->addWidget( trackingLabel, 0, 2 );
-	ChScale = new ScrSpinBox( 10, 400, advancedWidgets, 0 );
-	ChScale->setValue( 100 );
-	ScaleTxt = new QLabel("", advancedWidgets );
-	ScaleTxt->setPixmap(loadIcon("textscaleh.png"));
-	layout41a->addWidget( ScaleTxt, 1, 0 );
-	layout41a->addWidget( ChScale, 1 , 1 );
-	ChScaleV = new ScrSpinBox( 10, 400, advancedWidgets, 0 );
-	ChScaleV->setValue( 100 );
-	ScaleTxtV = new QLabel("", advancedWidgets );
-	ScaleTxtV->setPixmap(loadIcon("textscalev.png"));
-	layout41a->addWidget( ScaleTxtV, 1, 2 );
-	layout41a->addWidget( ChScaleV, 1, 3 );
-
-	wordTrackingLabel = new QLabel( "Word Spacing", advancedWidgets );
-	layout41a->addWidget( wordTrackingLabel, 2, 0, 1, 4 );
-	wordTrackingHLayout = new QHBoxLayout;
-	wordTrackingHLayout->setSpacing( 3 );
-	wordTrackingHLayout->setMargin( 0 );
-	wordTrackingHLayout->setAlignment(Qt::AlignLeft);
-	minWordTrackingSpinBox = new ScrSpinBox( 1, 200, advancedWidgets, 0 );
-	minWordTrackingLabel = new QLabel( "Min:", advancedWidgets );
-	minWordTrackingLabel->setBuddy(minWordTrackingSpinBox);
-	wordTrackingHLayout->addWidget(minWordTrackingLabel);
-	wordTrackingHLayout->addWidget(minWordTrackingSpinBox);
-	normWordTrackingSpinBox = new ScrSpinBox( 1, 200, advancedWidgets, 0 );
-	normWordTrackingLabel = new QLabel( "Norm:", advancedWidgets );
-	normWordTrackingLabel->setBuddy(normWordTrackingSpinBox);
-	wordTrackingHLayout->addWidget(normWordTrackingLabel);
-	wordTrackingHLayout->addWidget(normWordTrackingSpinBox);
-	layout41a->addLayout(wordTrackingHLayout, 3, 0, 1, 4);
-
-	glyphExtensionLabel = new QLabel( "Glyph Extension", advancedWidgets );
-	layout41a->addWidget( glyphExtensionLabel, 4, 0, 1, 4 );
-	glyphExtensionHLayout = new QHBoxLayout;
-	glyphExtensionHLayout->setSpacing( 3 );
-	glyphExtensionHLayout->setMargin( 0 );
-	glyphExtensionHLayout->setAlignment(Qt::AlignLeft);
-	minGlyphExtSpinBox = new ScrSpinBox( 90, 110, advancedWidgets, 0 );
-	minGlyphExtensionLabel = new QLabel( "Min:", advancedWidgets );
-	minGlyphExtensionLabel->setBuddy(minGlyphExtSpinBox);
-	glyphExtensionHLayout->addWidget(minGlyphExtensionLabel);
-	glyphExtensionHLayout->addWidget(minGlyphExtSpinBox);
-	maxGlyphExtSpinBox = new ScrSpinBox( 90, 110, advancedWidgets, 0 );
-	maxGlyphExtensionLabel = new QLabel( "Max:", advancedWidgets );
-	maxGlyphExtensionLabel->setBuddy(maxGlyphExtSpinBox);
-	glyphExtensionHLayout->addWidget(maxGlyphExtensionLabel);
-	glyphExtensionHLayout->addWidget(maxGlyphExtSpinBox);
-	layout41a->addLayout(glyphExtensionHLayout, 5, 0, 1, 4);
-
-	advancedWidgetsItem = TextTree->addWidget( tr("Advanced Settings"), advancedWidgets);
-
-	//>>Advanced Settings
-
-	Distance2 = new QFrame();
-	Distance2->setFrameStyle(QFrame::Box | QFrame::Plain);
-	Distance2->setLineWidth(1);
-	DistanceLayout2 = new QGridLayout( Distance2 );
-	DistanceLayout2->setSpacing( 2 );
-	DistanceLayout2->setMargin( 5 );
-	DistanceLayout2->setAlignment( Qt::AlignTop );
-
-	pathTextType = new ScComboBox( Distance2 );
-	DistanceLayout2->addWidget( pathTextType, 0, 1);
-	pathTextTypeLabel = new QLabel( "Type:", Distance2 );
-	DistanceLayout2->addWidget( pathTextTypeLabel, 0, 0);
-	
-	startoffsetLabel = new QLabel( "Start Offset:", Distance2 );
-	DistanceLayout2->addWidget( startoffsetLabel, 1, 0);
-	Dist = new ScrSpinBox( 0, 30000, Distance2, 0 );
-	Dist->setSingleStep(10);
-	DistanceLayout2->addWidget( Dist, 1, 1);
-
-	distfromcurveLabel = new QLabel( "Distance from Curve:", Distance2 );
-	DistanceLayout2->addWidget( distfromcurveLabel, 2, 0);
-	LineW = new ScrSpinBox( -300, 300, Distance2, 0 );
-	LineW->setSingleStep(10);
-	DistanceLayout2->addWidget( LineW, 2, 1);
-
-	flippedPathText = new QCheckBox( Distance2 );
-	flippedPathText->setText( "Flip Text" );
-	DistanceLayout2->addWidget( flippedPathText, 3, 0, 1, 2 );
-
-	showcurveCheckBox = new QCheckBox( Distance2 );
-	showcurveCheckBox->setText( "Show Curve" );
-	DistanceLayout2->addWidget( showcurveCheckBox, 4, 0, 1, 2 );
-	Distance2Item = TextTree->addWidget( tr("Path Text Properties"), Distance2);
-
-	pageLayout_3->addWidget(TextTree);
-	idTextItem=TabStack->addItem( page_3, "&Text" );
+	textPal = new PropertiesPalette_Text( page_group );
+	pageLayout_3->addWidget( textPal );
+
+	idTextItem = TabStack->addItem( page_3, "&Text" );
 
 	page_4 = new QWidget( TabStack );
 	pageLayout_4 = new QVBoxLayout( page_4 );
 	pageLayout_4->setSpacing( 5 );
 	pageLayout_4->setMargin( 0 );
 
-	imagePageNumberSelector = new QGridLayout();
-	imagePageNumberSelector->setSpacing( 5 );
-	imagePageNumberSelector->setMargin( 0 );
-	imagePageNumber = new QSpinBox( page_4 );
-	imagePageNumber->setMinimum(0);
-	imagePageNumber->setSpecialValueText(tr( "Auto" ));
-	imagePageNumberLabel = new QLabel( "&Page Number:", page_4 );
-	imagePageNumberLabel->setBuddy(imagePageNumber);
-	imagePageNumberSelector->addWidget( imagePageNumberLabel, 0, 0 );
-	imagePageNumberSelector->addWidget( imagePageNumber, 0, 1);
-	pageLayout_4->addLayout( imagePageNumberSelector );
-	
-//	FreeScale = new QRadioButton( "&Free Scaling", page_4 );
-//	FreeScale->setChecked( true );
-//	pageLayout_4->addWidget( FreeScale );
-
-	layout43 = new QGridLayout;
-	layout43->setSpacing( 5 );
-	layout43->setMargin( 0 );
-	imageXOffsetSpinBox = new ScrSpinBox( page_4, 0 );
-	installSniffer(imageXOffsetSpinBox);
-	xposImgLabel = new QLabel( "&X-Pos:", page_4 );
-	xposImgLabel->setBuddy(imageXOffsetSpinBox);
-	layout43->addWidget( xposImgLabel, 0, 0 );
-	layout43->addWidget( imageXOffsetSpinBox, 0, 1 );
-	imageYOffsetSpinBox = new ScrSpinBox( page_4, 0 );
-	installSniffer(imageYOffsetSpinBox);
-	yposImgLabel = new QLabel( "&Y-Pos:", page_4 );
-	yposImgLabel->setBuddy(imageYOffsetSpinBox);
-	layout43->addWidget( yposImgLabel, 1, 0 );
-	layout43->addWidget( imageYOffsetSpinBox, 1, 1 );
-	
-	imageRotation = new ScrSpinBox( page_4, 6);
-	imageRotation->setWrapping( true );
-	installSniffer(imageRotation);
-	imageRotationLabel = new QLabel( "Rotation:", page_4 );
-	imageRotationLabel->setBuddy(imageRotation);
-	layout43->addWidget( imageRotationLabel, 2, 0 );
-	layout43->addWidget( imageRotation, 2, 1 );
-
-	FreeScale = new QRadioButton( "&Free Scaling", page_4 );
-	FreeScale->setChecked( true );
-	layout43->addWidget( FreeScale, 3, 0 );
-	
-	imageXScaleSpinBox = new ScrSpinBox( page_4, 0 );
-	installSniffer(imageXScaleSpinBox);
-	xscaleLabel = new QLabel( "X-Sc&ale:", page_4 );
-	xscaleLabel->setBuddy(imageXScaleSpinBox);
-	layout43->addWidget( xscaleLabel, 4, 0 );
-	layout43->addWidget( imageXScaleSpinBox, 4, 1 );
-	imageYScaleSpinBox = new ScrSpinBox( page_4, 0 );
-	installSniffer(imageYScaleSpinBox);
-	yscaleLabel = new QLabel( "Y-Scal&e:", page_4 );
-	yscaleLabel->setBuddy(imageYScaleSpinBox);
-	layout43->addWidget( yscaleLabel, 5, 0 );
-	layout43->addWidget( imageYScaleSpinBox, 5, 1 );
-	keepImageWHRatioButton = new LinkButton( page_4 );
-	keepImageWHRatioButton->setCheckable( true );
-	keepImageWHRatioButton->setAutoRaise( true );
-	keepImageWHRatioButton->setMaximumSize( QSize( 15, 32767 ) );
-	layout43->addWidget( keepImageWHRatioButton, 4, 2, 2, 1 );
-	imgDpiX = new ScrSpinBox( page_4, 0 );
-	installSniffer(imgDpiX);
-	imgDPIXLabel = new QLabel( "Actual X-DPI:", page_4 );
-	imgDPIXLabel->setBuddy(imgDpiX);
-	layout43->addWidget( imgDPIXLabel, 6, 0 );
-	layout43->addWidget( imgDpiX, 6, 1 );
-	imgDpiY = new ScrSpinBox( page_4, 0 );
-	installSniffer(imgDpiY);
-	imgDPIYLabel = new QLabel( "Actual Y-DPI:", page_4 );
-	imgDPIYLabel->setBuddy(imgDpiY);
-	layout43->addWidget( imgDPIYLabel, 7, 0 );
-	layout43->addWidget( imgDpiY, 7, 1 );
-	keepImageDPIRatioButton = new LinkButton( page_4 );
-	keepImageDPIRatioButton->setCheckable( true );
-	keepImageDPIRatioButton->setAutoRaise( true );
-	keepImageDPIRatioButton->setMaximumSize( QSize( 15, 32767 ) );
-	layout43->addWidget( keepImageDPIRatioButton, 6, 2, 2, 1 );
-	pageLayout_4->addLayout( layout43 );
-
-	Layout24 = new QVBoxLayout;
-	Layout24->setSpacing( 3 );
-	Layout24->setMargin( 0 );
-
-	FrameScale = new QRadioButton( page_4 );
-	FrameScale->setText( "Scale &To Frame Size" );
-	Layout24->addWidget( FrameScale );
-
-	Layout18 = new QHBoxLayout;
-	Layout18->setSpacing( 5 );
-	Layout18->setMargin( 0 );
-
-	Frame4 = new QFrame( page_4 );
-	Frame4->setMinimumSize( QSize( 15, 2 ) );
-	Frame4->setMaximumSize( QSize( 15, 10 ) );
-	Frame4->setFrameShape( QFrame::NoFrame );
-	Frame4->setFrameShadow( QFrame::Plain );
-	Layout18->addWidget( Frame4 );
-
-	Aspect = new QCheckBox( page_4 );
-	Aspect->setEnabled( false );
-	Aspect->setText( "P&roportional" );
-	Aspect->setChecked( true );
-
-	Layout18->addWidget( Aspect );
-	Layout24->addLayout( Layout18 );
-	pageLayout_4->addLayout( Layout24 );
-
-	EditEffects = new QToolButton( page_4);
-	pageLayout_4->addWidget( EditEffects );
-
-	EditPSDProps = new QToolButton( page_4);
-	pageLayout_4->addWidget( EditPSDProps );
-
-	GroupBoxCM = new QFrame( page_4 );
-	GroupBoxCM->setFrameShape( QFrame::NoFrame );
-	GroupBoxCM->setFrameShadow( QFrame::Plain );
-	GroupBoxCMLayout = new QVBoxLayout( GroupBoxCM );
-	GroupBoxCMLayout->setSpacing( 2 );
-	GroupBoxCMLayout->setMargin( 5 );
-	GroupBoxCMLayout->setAlignment( Qt::AlignTop );
-	TextCms1 = new QLabel( GroupBoxCM );
-	GroupBoxCMLayout->addWidget( TextCms1 );
-	InputP = new ScComboBox( GroupBoxCM );
-	GroupBoxCMLayout->addWidget(InputP);
-	TextCms2 = new QLabel( GroupBoxCM );
-	GroupBoxCMLayout->addWidget(TextCms2);
-	MonitorI = new ScComboBox( GroupBoxCM );
-	GroupBoxCMLayout->addWidget(MonitorI);
-	pageLayout_4->addWidget(GroupBoxCM);
-
-	GroupBoxCompression = new QFrame( page_4 );
-	GroupBoxCompression->setFrameShape( QFrame::NoFrame );
-	GroupBoxCompression->setFrameShadow( QFrame::Plain );
-	GroupBoxCompressionLayout = new QVBoxLayout( GroupBoxCompression );
-	GroupBoxCompressionLayout->setSpacing( 2 );
-	GroupBoxCompressionLayout->setMargin( 5 );
-	GroupBoxCompressionLayout->setAlignment( Qt::AlignTop );
-	TextCompressionMethod = new QLabel( GroupBoxCompression );
-	GroupBoxCompressionLayout->addWidget( TextCompressionMethod );
-	CompressionMethod = new ScComboBox( GroupBoxCompression );
-	GroupBoxCompressionLayout->addWidget(CompressionMethod);
-	TextCompressionQuality = new QLabel( GroupBoxCompression );
-	GroupBoxCompressionLayout->addWidget( TextCompressionQuality );
-	CompressionQuality = new ScComboBox( GroupBoxCompression );
-	GroupBoxCompressionLayout->addWidget( CompressionQuality );
-	pageLayout_4->addWidget( GroupBoxCompression );
+	imagePal = new PropertiesPalette_Image(page_4);
+	pageLayout_4->addWidget(imagePal);
 
 	QSpacerItem* spacer9 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
 	pageLayout_4->addItem( spacer9 );
@@ -1023,113 +154,9 @@
 	pageLayout_5->setSpacing( 5 );
 	pageLayout_5->setMargin( 0 );
 
-	LMode = false;
-
-	Layout12_2 = new QGridLayout;
-	Layout12_2->setSpacing( 3 );
-	Layout12_2->setMargin( 0 );
-	LStyle = new LineCombo(page_5);
-	LStyle->addItem( tr("Custom"));
-	LineMode = new ScComboBox( page_5 );
-	LineModeT = new QLabel( "&Basepoint:", page_5 );
-	LineModeT->setBuddy(LineMode);
-	Layout12_2->addWidget( LineModeT, 0, 0 );
-	Layout12_2->addWidget( LineMode, 0, 1 );
-	linetypeLabel = new QLabel( "T&ype of Line:", page_5 );
-	linetypeLabel->setBuddy(LStyle);
-	Layout12_2->addWidget( linetypeLabel, 1, 0 );
-	Layout12_2->addWidget( LStyle, 1, 1 );
-
-	dashEditor = new DashEditor(page_5);
-	Layout12_2->addWidget(dashEditor, 2, 0, 1, 2);
-
-	startArrow = new ArrowChooser(page_5, true);
-	Layout12_2->addWidget( startArrow, 4, 0 );
-	endArrow = new ArrowChooser(page_5, false);
-	Layout12_2->addWidget( endArrow, 4, 1 );
-	startArrowText = new QLabel( "Start Arrow:", page_5 );
-	startArrowText->setBuddy(startArrow);
-	Layout12_2->addWidget( startArrowText, 3, 0 );
-	endArrowText = new QLabel( "End Arrow:", page_5 );
-	endArrowText->setBuddy(endArrow);
-	Layout12_2->addWidget( endArrowText, 3, 1 );
-
-	Layout12_2a = new QHBoxLayout;
-	Layout12_2a->setSpacing( 3 );
-	Layout12_2a->setMargin( 0 );
-	startArrowSpinText = new QLabel( "Scaling:", page_5 );
-	Layout12_2a->addWidget(startArrowSpinText);
-	startArrowScaleSpin = new QSpinBox(page_5 );
-	startArrowScaleSpin->setMaximum( 300 );
-	startArrowScaleSpin->setMinimum( 1 );
-	Layout12_2a->addWidget(startArrowScaleSpin);
-	Layout12_2->addLayout(Layout12_2a, 5, 0);
-
-	Layout12_2b = new QHBoxLayout;
-	Layout12_2b->setSpacing( 3 );
-	Layout12_2b->setMargin( 0 );
-	endArrowSpinText = new QLabel( "Scaling:", page_5 );
-	Layout12_2b->addWidget(endArrowSpinText);
-	endArrowScaleSpin = new QSpinBox(page_5 );
-	endArrowScaleSpin->setMaximum( 300 );
-	endArrowScaleSpin->setMinimum( 1 );
-	Layout12_2b->addWidget(endArrowScaleSpin);
-	Layout12_2->addLayout( Layout12_2b, 5, 1 );
-
-	LSize = new ScrSpinBox( page_5, 0 );
-	linewidthLabel = new QLabel( "Line &Width:", page_5 );
-	linewidthLabel->setBuddy(LSize);
-	Layout12_2->addWidget( linewidthLabel, 6, 0 );
-	Layout12_2->addWidget( LSize, 6, 1 );
-	LJoinStyle = new ScComboBox( page_5 );
-	edgesLabel = new QLabel( "Ed&ges:", page_5 );
-	edgesLabel->setBuddy(LJoinStyle);
-	Layout12_2->addWidget( edgesLabel, 7, 0 );
-	Layout12_2->addWidget( LJoinStyle, 7, 1 );
-	LEndStyle = new ScComboBox( page_5 );
-	endingsLabel = new QLabel( "&Endings:", page_5 );
-	endingsLabel->setBuddy(LEndStyle);
-	Layout12_2->addWidget( endingsLabel, 8, 0 );
-	Layout12_2->addWidget( LEndStyle, 8, 1 );
-	pageLayout_5->addLayout( Layout12_2 );
-
-	TabStack3 = new QStackedWidget( page_5 );
-	TabStack3->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
-
-	page_5a = new QWidget( TabStack3 );
-	pageLayout_5a = new QVBoxLayout( page_5a );
-	pageLayout_5a->setSpacing( 5 );
-	pageLayout_5a->setMargin( 0 );
-	StyledLine = new QListWidget(page_5a);
-	StyledLine->setItemDelegate(new LineFormatItemDelegate);
-	StyledLine->addItem( "No Style" );
-	pageLayout_5a->addWidget(StyledLine);
-	TabStack3->addWidget( page_5a );
-
-	page_5b = new QWidget( TabStack3 );
-	pageLayout_5b = new QVBoxLayout( page_5b );
-	pageLayout_5b->setSpacing( 5 );
-	pageLayout_5b->setMargin( 0 );
-	TLines = new QGroupBox( "Cell Lines", page_5b );
-	TLineLayout = new QVBoxLayout( TLines );
-	TLineLayout->setSpacing( 2 );
-	TLineLayout->setMargin( 5 );
-	TLineLayout->setAlignment( Qt::AlignTop );
-	TopLine = new QCheckBox( TLines );
-	TopLine->setText( "Line at Top" );
-	TLineLayout->addWidget(TopLine);
-	LeftLine = new QCheckBox( TLines );
-	LeftLine->setText( "Line at the Left" );
-	TLineLayout->addWidget(LeftLine);
-	RightLine = new QCheckBox( TLines );
-	RightLine->setText( "Line at the Right " );
-	TLineLayout->addWidget(RightLine);
-	BottomLine = new QCheckBox( TLines );
-	BottomLine->setText( "Line at Bottom" );
-	TLineLayout->addWidget(BottomLine);
-	pageLayout_5b->addWidget(TLines);
-	TabStack3->addWidget( page_5b );
-	pageLayout_5->addWidget( TabStack3 );
+	linePal = new PropertiesPalette_Line(page_5);
+	pageLayout_5->addWidget(linePal);
+
 	idLineItem=TabStack->addItem( page_5, "&Line" );
 	
 	page_6 = new QWidget( TabStack );
@@ -1150,160 +177,44 @@
 
 	MpalLayout->addWidget( TabStack );
 
+	setWidget( TabStack );
+
 	languageChange();
 
-	connect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
-	connect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
-	connect(Width, SIGNAL(valueChanged(double)), this, SLOT(NewW()));
-	connect(Height, SIGNAL(valueChanged(double)), this, SLOT(NewH()));
-	connect(Rotation, SIGNAL(valueChanged(double)), this, SLOT(setRotation()));
-	connect(RoundRect, SIGNAL(valueChanged(double)), this, SLOT(NewCornerRadius()));
-	connect(LineSp, SIGNAL(valueChanged(double)), this, SLOT(NewLineSpacing()));
-	connect(Size, SIGNAL(valueChanged(double)), this, SLOT(NewSize()));
-	connect(Extra, SIGNAL(valueChanged(double)), this, SLOT(NewTracking()));
-	connect(imagePageNumber, SIGNAL(valueChanged(int)), this, SLOT(NewPage()));
-	connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
-	connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
-	connect(imageXOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
-	connect(imageYOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
-	connect(imageRotation, SIGNAL(valueChanged(double)), this, SLOT(NewLocalRot()));
-	connect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
-	connect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
-	connect(LSize, SIGNAL(valueChanged(double)), this, SLOT(NewLineWidth()));
-	connect(LStyle, SIGNAL(activated(int)), this, SLOT(NewLineStyle()));
-	connect(LJoinStyle, SIGNAL(activated(int)), this, SLOT(NewLineJoin()));
-	connect(LEndStyle, SIGNAL(activated(int)), this, SLOT(NewLineEnd()));
-	connect(LineMode, SIGNAL(activated(int)), this, SLOT(NewLineMode()));
-	connect(dashEditor, SIGNAL(dashChanged()), this, SLOT(dashChange()));
-	connect(keepImageWHRatioButton, SIGNAL(clicked()), this, SLOT(ToggleKette()));
-	connect(keepImageDPIRatioButton, SIGNAL(clicked()), this, SLOT(ToggleKetteD()));
-	connect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
-	connect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
-	connect(GroupAlign, SIGNAL(State(int)), this, SLOT(NewAlignement(int)));
-	connect(Revert, SIGNAL(clicked()), this, SLOT(DoRevert()));
-	connect(charStyleClear, SIGNAL(clicked()), this, SLOT(doClearCStyle()));
-	connect(paraStyleClear, SIGNAL(clicked()), this, SLOT(doClearPStyle()));
-	connect(SeStyle, SIGNAL(State(int)), this, SLOT(setTypeStyle(int)));
-	connect(SeStyle->ShadowVal->Xoffset, SIGNAL(valueChanged(double)), this, SLOT(newShadowOffs()));
-	connect(SeStyle->ShadowVal->Yoffset, SIGNAL(valueChanged(double)), this, SLOT(newShadowOffs()));
-	connect(SeStyle->OutlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newOutlineW()));
-	connect(SeStyle->UnderlineVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(newUnderline()));
-	connect(SeStyle->UnderlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newUnderline()));
-	connect(SeStyle->StrikeVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(newStrike()));
-	connect(SeStyle->StrikeVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newStrike()));
-	connect(FreeScale, SIGNAL(clicked()), this, SLOT(ChangeScaling()));
-	connect(FrameScale, SIGNAL(clicked()), this, SLOT(ChangeScaling()));
-	connect(Aspect, SIGNAL(clicked()), this, SLOT(ChangeScaling()));
-	connect(EditEffects, SIGNAL(clicked()), this, SLOT(handleImageEffects()));
-	connect(EditPSDProps, SIGNAL(clicked()), this, SLOT(handleExtImgProperties()));
-	connect(Zup, SIGNAL(clicked()), this, SLOT(DoRaise()));
-	connect(ZDown, SIGNAL(clicked()), this, SLOT(DoLower()));
-	connect(ZTop, SIGNAL(clicked()), this, SLOT(DoFront()));
-	connect(ZBottom, SIGNAL(clicked()), this, SLOT(DoBack()));
-	connect(RotationGroup, SIGNAL(buttonClicked(int)), this, SLOT(NewRotMode(int)));
-	connect(textFlowOptionsB , SIGNAL(buttonClicked(int)), this, SLOT(DoFlow()));
-	connect(textFlowOptionsB2, SIGNAL(buttonClicked(int)), this, SLOT(DoFlow()));
-
-	connect(SCustom, SIGNAL(FormSel(int, int, qreal *)), this, SLOT(MakeIrre(int, int, qreal *)));
-	connect(EditShape, SIGNAL(clicked()), this, SLOT(handleShapeEdit()));
-	connect(SCustom2, SIGNAL(FormSel(int, int, qreal *)), this, SLOT(MakeIrre(int, int, qreal *)));
-	connect(EditShape2, SIGNAL(clicked()), this, SLOT(handleShapeEdit2()));
-	connect(dGap, SIGNAL(valueChanged(double)), this, SLOT(NewGap()));
-	connect(DCol, SIGNAL(valueChanged(int)), this, SLOT(NewCols()));
-	connect(DTop, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
-	connect(DLeft, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
-	connect(DRight, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
-	connect(DBottom, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
-	connect(flopGroup, SIGNAL(buttonClicked( int )), this, SLOT(flop(int)));
+	connect(linePal, SIGNAL(lineModeChanged(int)), this, SLOT(NewLineMode(int)));
+
+	connect(groupPal, SIGNAL(shapeChanged(int)) , this, SLOT(handleNewShape(int)));
+	connect(groupPal, SIGNAL(shapeEditStarted()), this, SLOT(handleShapeEdit()));
+
 	connect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
-	connect(StyledLine, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SetSTline(QListWidgetItem*)));
-	connect(Fonts, SIGNAL(fontSelected(QString )), this, SLOT(NewTFont(QString)));
-	connect(TxFill, SIGNAL(activated(int)), this, SLOT(newTxtFill()));
-	connect(TxStroke, SIGNAL(activated(int)), this, SLOT(newTxtStroke()));
-	connect(PM1, SIGNAL(clicked()), this, SLOT(setActShade()));
-	connect(PM2, SIGNAL(clicked()), this, SLOT(setActShade()));
-	connect(ChScale, SIGNAL(valueChanged(double)), this, SLOT(NewTScale()));
-	connect(ChScaleV, SIGNAL(valueChanged(double)), this, SLOT(NewTScaleV()));
-	connect(ChBase, SIGNAL(valueChanged(double)), this, SLOT(NewTBase()));
-	connect(Locked, SIGNAL(clicked()), this, SLOT(handleLock()));
-	connect(NoPrint, SIGNAL(clicked()), this, SLOT(handlePrint()));
-	connect(NoResize, SIGNAL(clicked()), this, SLOT(handleLockSize()));
-	connect(showcurveCheckBox, SIGNAL(clicked()), this, SLOT(handlePathLine()));
-	connect(pathTextType, SIGNAL(activated(int)), this, SLOT(handlePathType()));
-	connect(flippedPathText, SIGNAL(clicked()), this, SLOT(handlePathFlip()));
-	connect(Dist, SIGNAL(valueChanged(double)), this, SLOT(handlePathDist()));
-	connect(LineW, SIGNAL(valueChanged(double)), this, SLOT(handlePathOffs()));
-	connect(InputP, SIGNAL(activated(const QString&)), this, SLOT(ChangeProfile(const QString&)));
-	connect(MonitorI, SIGNAL(activated(int)), this, SLOT(ChangeIntent()));
-	connect(CompressionMethod, SIGNAL(activated(int)), this, SLOT(ChangeCompressionMethod()));
-	connect(CompressionQuality, SIGNAL(activated(int)), this, SLOT(ChangeCompressionQuality()));
-	connect(NameEdit, SIGNAL(Leaved()), this, SLOT(NewName()));
-	connect( TabsButton, SIGNAL( clicked() ), this, SLOT( ManageTabs() ) );
-	connect( TopLine, SIGNAL( clicked() ), this, SLOT( HandleTLines() ) );
-	connect( LeftLine, SIGNAL( clicked() ), this, SLOT( HandleTLines() ) );
-	connect( RightLine, SIGNAL( clicked() ), this, SLOT( HandleTLines() ) );
-	connect( BottomLine, SIGNAL( clicked() ), this, SLOT( HandleTLines() ) );
-	connect(colgapLabel, SIGNAL(activated(int)), this, SLOT(HandleGapSwitch()));
-	connect( Cpal, SIGNAL(NewSpecial(double, double, double, double, double, double, double, double, double, double)), this, SLOT(NewSpGradient(double, double, double, double, double, double, double, double, double, double )));
-	connect( Cpal, SIGNAL(editGradient(int)), this, SLOT(toggleGradientEdit(int)));
-	connect( Tpal, SIGNAL(NewSpecial(double, double, double, double, double, double, double, double, double, double)), this, SLOT(NewSpGradientM(double, double, double, double, double, double, double, double )));
-	connect( Tpal, SIGNAL(editGradient()), this, SLOT(toggleGradientEditM()));
-	connect( TpalGroup, SIGNAL(NewSpecial(double, double, double, double, double, double, double, double, double, double)), this, SLOT(NewSpGradientM(double, double, double, double, double, double, double, double )));
-	connect( TpalGroup, SIGNAL(editGradient()), this, SLOT(toggleGradientEditMGroup()));
-	connect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
-	connect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
-	connect(startArrowScaleSpin, SIGNAL(valueChanged(int)), this, SLOT(setStartArrowScale(int )));
-	connect(endArrowScaleSpin, SIGNAL(valueChanged(int)), this, SLOT(setEndArrowScale(int )));
-	connect(lineSpacingModeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setLineSpacingMode(int)));
-	connect( EvenOdd, SIGNAL( clicked() ), this, SLOT(handleFillRule() ) );
-	connect( NonZero, SIGNAL( clicked() ), this, SLOT( handleFillRule() ) );
-	connect(DoGroup, SIGNAL(clicked()), this, SLOT(doGrouping()) );
-	connect(optMarginRadioNone, SIGNAL(clicked()), this, SLOT(setOpticalMargins()) );
-	connect(optMarginRadioBoth, SIGNAL(clicked()), this, SLOT(setOpticalMargins()) );
-	connect(optMarginRadioLeft, SIGNAL(clicked()), this, SLOT(setOpticalMargins()) );
-	connect(optMarginRadioRight, SIGNAL(clicked()), this, SLOT(setOpticalMargins()) );
-	connect(optMarginResetButton, SIGNAL(clicked()), this, SLOT(resetOpticalMargins()) );
-
-
-	connect(minWordTrackingSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setMinWordTracking()) );
-	connect(normWordTrackingSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setNormWordTracking()) );
-	connect(minGlyphExtSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setMinGlyphExtension()) );
-	connect(maxGlyphExtSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setMaxGlyphExtension()) );
-
-	HaveItem = false;
-	Xpos->setValue(0);
-	Ypos->setValue(0);
-	Width->setValue(0);
-	Height->setValue(0);
-	Rotation->setValue(0);
-	RoundRect->setValue(0);
-	TabStack3->setCurrentIndex(0);
-	TabStack2->setCurrentIndex(0);
+
+	connect(Cpal, SIGNAL(NewSpecial(double, double, double, double, double, double, double, double, double, double)), this, SLOT(NewSpGradient(double, double, double, double, double, double, double, double, double, double )));
+	connect(Cpal, SIGNAL(editGradient(int)), this, SLOT(toggleGradientEdit(int)));
+	connect(Tpal, SIGNAL(NewSpecial(double, double, double, double, double, double, double, double, double, double)), this, SLOT(NewSpGradientM(double, double, double, double, double, double, double, double )));
+	connect(Tpal, SIGNAL(editGradient()), this, SLOT(toggleGradientEditM()));
+
+	m_haveItem = false;
 	for (int ws = 1; ws < 8; ++ws)
 		TabStack->setItemEnabled(ws, false);
 	TabStack->setCurrentIndex(0);
 	TabStack->widget(0)->setEnabled(false);
 	TabStack->setItemEnabled(0, false);
-	StrokeIcon->setEnabled(false);
-	TxStroke->setEnabled(false);
-	PM1->setEnabled(false);
-	colgapLabel->setCurrentIndex(0);
 }
 
 void PropertiesPalette::closeEvent(QCloseEvent *closeEvent)
 {
 	if (m_ScMW && !m_ScMW->scriptIsRunning())
 	{
-		if ((HaveDoc) && (HaveItem))
+		if ((m_haveDoc) && (m_haveItem))
 		{
 			if (Cpal->gradEditButton->isChecked())
 			{
 				m_ScMW->view->requestMode(modeNormal);
-				m_ScMW->view->RefreshGradient(CurItem);
+				m_ScMW->view->RefreshGradient(m_item);
 			}
 		}
 	}
-	ScrPaletteBase::closeEvent(closeEvent);
+	ScDockPalette::closeEvent(closeEvent);
 }
 
 void PropertiesPalette::setMainWindow(ScribusMainWindow* mw)
@@ -1315,17 +226,17 @@
 	setParent(m_ScMW);
 	move(p2);
 
+	this->xyzPal->setMainWindow(mw);
+	this->shapePal->setMainWindow(mw);
+	this->groupPal->setMainWindow(mw);
+	this->imagePal->setMainWindow(mw);
+	this->linePal->setMainWindow(mw);
+	this->textPal->setMainWindow(mw);
+
 	connect(this, SIGNAL(DocChanged()), m_ScMW, SLOT(slotDocCh()));
-	connect(this, SIGNAL(NewAlignment(int)), m_ScMW, SLOT(setNewAlignment(int)));
-	connect(this, SIGNAL(NewEffects(int)), m_ScMW, SLOT(setItemHoch(int)));
-	connect(this, SIGNAL(NewFont(const QString&)), m_ScMW, SLOT(SetNewFont(const QString&)));
-	connect(this, SIGNAL(UpdtGui(int)), m_ScMW, SLOT(HaveNewSel(int)));
-	connect(this->Cpal, SIGNAL(gradientChanged()), m_ScMW, SLOT(updtGradFill()));
-	connect(this->Cpal, SIGNAL(strokeGradientChanged()), m_ScMW, SLOT(updtGradStroke()));
+	//connect(this->Cpal, SIGNAL(gradientChanged()), m_ScMW, SLOT(updtGradFill()));
+	//connect(this->Cpal, SIGNAL(strokeGradientChanged()), m_ScMW, SLOT(updtGradStroke()));
 	connect(this->Tpal, SIGNAL(gradientChanged()), m_ScMW, SLOT(updtGradMask()));
-	connect(this->TpalGroup, SIGNAL(gradientChanged()), m_ScMW, SLOT(updtGradMaskGroup()));
-	connect(DoUnGroup, SIGNAL(clicked()), m_ScMW, SLOT(UnGroupObj()) );
-	
 }
 
 void PropertiesPalette::SelTab(int t)
@@ -1354,482 +265,172 @@
 
 void PropertiesPalette::setDoc(ScribusDoc *d)
 {
-	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->TpalGroup, SIGNAL(NewTrans(double)), 0, 0);
-	disconnect(this->TpalGroup, SIGNAL(NewBlend(int)), 0, 0);
-	disconnect(this->TpalGroup, SIGNAL(NewGradient(int)), 0, 0);
-	disconnect(this->TpalGroup, SIGNAL(NewPattern(QString)), 0, 0);
-	disconnect(this->TpalGroup, 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);
+	if((d == (ScribusDoc*) m_doc) || (m_ScMW && m_ScMW->scriptIsRunning()))
+		return;
+
+	if (m_doc)
+	{
+		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
+	}
+
+	m_doc = d;
+	m_item = NULL;
+	Cpal->setDocument(m_doc);
 	Cpal->setCurrentItem(NULL);
-	Tpal->setDocument(doc);
+	Tpal->setDocument(m_doc);
 	Tpal->setCurrentItem(NULL);
-	TpalGroup->setDocument(doc);
-	TpalGroup->setCurrentItem(NULL);
-	m_unitRatio=doc->unitRatio();
-	m_unitIndex=doc->unitIndex();
+
+	m_unitRatio=m_doc->unitRatio();
+	m_unitIndex=m_doc->unitIndex();
 	int precision = unitGetPrecisionFromIndex(m_unitIndex);
 //qt4 FIXME here
 	double maxXYWHVal= 16777215 * m_unitRatio;
 	double minXYVal= -16777215 * m_unitRatio;
-	HaveDoc = true;
-	HaveItem = false;
-
-	QMap<QString, double>* docConstants = doc? &doc->constants()  : NULL;
-	Xpos->setValues( minXYVal, maxXYWHVal, precision, minXYVal);
-	Xpos->setConstants(docConstants);
-	Ypos->setValues( minXYVal, maxXYWHVal, precision, minXYVal);
-	Ypos->setConstants(docConstants);
-	Width->setValues( m_unitRatio, maxXYWHVal, precision, m_unitRatio);
-	Width->setConstants(docConstants);
-	Height->setValues( m_unitRatio, maxXYWHVal, precision, m_unitRatio);
-	Height->setConstants(docConstants);
-	imageXOffsetSpinBox->setValues( -16777215, maxXYWHVal, precision, 0);
-	imageYOffsetSpinBox->setValues( -16777215, maxXYWHVal, precision, 0);
-
-	Rotation->setValues( 0, 359.99, 1, 0);
-	imageRotation->setValues( 0, 359.99, 1, 0);
-	RoundRect->setValues( -300, 300, 2, 0);
-	Extra->setValues( -300, 300, 2, 0);
-	Size->setValues( 0.5, 2048, 2, 1);
-	LineSp->setValues( 1, 2048, 2, 1);
-	minWordTrackingSpinBox->setValues(1, 100, 2, 100);
-	normWordTrackingSpinBox->setValues(1, 200, 2, 100);
-	minGlyphExtSpinBox->setValues(90, 110, 2, 100);
-	maxGlyphExtSpinBox->setValues(90, 110, 2, 100);
-	imageXScaleSpinBox->setValues( 1, 30000, 2, 1);
-	imageYScaleSpinBox->setValues( 1, 30000, 2, 1);
-	imgDpiX->setValues( 1, 30000, 2, 1);
-	imgDpiY->setValues( 1, 30000, 2, 1);
-
-	dGap->setDecimals(2);
-	DTop->setDecimals(2);
-	DLeft->setDecimals(2);
-	DBottom->setDecimals(2);
-	DRight->setDecimals(2);
-	LSize->setMaximum( 300 );
-	LSize->setMinimum( 0 );
-	Dist->setMaximum( 30000 );
-	Dist->setMinimum( 0 );
-	Dist->setSingleStep(10);
-	LineW->setMaximum( 300 );
-	LineW->setMinimum( -300 );
-	LineW->setSingleStep(10);
+	m_haveDoc = true;
+	m_haveItem = false;
+
+	xyzPal->setDoc(m_doc);
+	shapePal->setDoc(m_doc);
+	groupPal->setDoc(m_doc);
+	imagePal->setDoc(m_doc);
+	linePal->setDoc(m_doc);
+	textPal->setDoc(m_doc);
 
 	updateColorList();
 
-	updateSpinBoxConstants();
-	paraStyleCombo->setDoc(doc);
-	charStyleCombo->setDoc(doc);
-	SetLineFormats(doc);
-	startArrow->rebuildList(&doc->arrowStyles());
-	endArrow->rebuildList(&doc->arrowStyles());
-
-	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->TpalGroup, SIGNAL(NewTrans(double)), this, SLOT(setGroupTransparency(double)));
-	connect(this->TpalGroup, SIGNAL(NewBlend(int)), this, SLOT(setGroupBlending(int)));
-	connect(this->TpalGroup, SIGNAL(NewGradient(int)), this, SLOT(setGroupGradMask(int)));
-	connect(this->TpalGroup, SIGNAL(NewPattern(QString)), this, SLOT(setGroupPatternMask(QString)));
-	connect(this->TpalGroup, SIGNAL(NewPatternProps(double, double, double, double, double, double, double, bool, bool)), this, SLOT(setGroupPatternMaskProps(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)));
+	connect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+	connect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
 }
 
 void PropertiesPalette::unsetDoc()
 {
-	HaveDoc = false;
-	HaveItem = false;
-	doc=NULL;
-	CurItem = NULL;
+	if (m_doc)
+	{
+		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
+	}
+
+	m_haveDoc = false;
+	m_haveItem = false;
+	m_doc=NULL;
+	m_item = NULL;
+
+	xyzPal->unsetItem();
+	xyzPal->unsetDoc();
+	shapePal->unsetItem();
+	shapePal->unsetDoc();
+	groupPal->unsetItem();
+	groupPal->unsetDoc();
+	imagePal->unsetItem();
+	imagePal->unsetDoc();
+	linePal->unsetItem();
+	linePal->unsetDoc();
+	textPal->unsetItem();
+	textPal->unsetDoc();
+
 	Cpal->setCurrentItem(NULL);
 	Cpal->setDocument(NULL);
 	Tpal->setCurrentItem(NULL);
 	Tpal->setDocument(NULL);
-	TpalGroup->setDocument(NULL);
-	TpalGroup->setCurrentItem(NULL);
-	Xpos->setConstants(NULL);
-	Ypos->setConstants(NULL);
-	Width->setConstants(NULL);
-	Height->setConstants(NULL);
-	paraStyleCombo->setDoc(0);
-	charStyleCombo->setDoc(0);
-	SetLineFormats(0);
-	DoGroup->setEnabled(false);
-	DoUnGroup->setEnabled(false);
-	EditShape->setEnabled(false);
-	FlipH->setEnabled(false);
-	FlipV->setEnabled(false);
-	xposLabel->setText( tr( "&X-Pos:" ) );
-	widthLabel->setText( tr( "&Width:" ) );
-	yposLabel->setText( tr( "&Y-Pos:" ) );
-	heightLabel->setText( tr( "&Height:" ) );
-	RoundRect->setEnabled(false);
-	HaveItem = false;
-	Xpos->setValue(0);
-	Ypos->setValue(0);
-	Width->setValue(0);
-	Height->setValue(0);
-	Rotation->setValue(0);
-	imageRotation->setValue(0);
-	RoundRect->setValue(0);
+
+	m_haveItem = false;
 	for (int ws = 1; ws < 8; ++ws)
 		TabStack->setItemEnabled(ws, false);
 	TabStack->widget(0)->setEnabled(false);
 	TabStack->setItemEnabled(idXYZItem, false);
-	Cpal->ChooseGrad(0);
 }
 
 void PropertiesPalette::unsetItem()
 {
-	HaveItem=false;
-	CurItem = NULL;
+	m_haveItem = false;
+	m_item     = NULL;
 	Cpal->setCurrentItem(NULL);
 	Tpal->setCurrentItem(NULL);
-	TpalGroup->setCurrentItem(NULL);
-	dashEditor->hide();
-	NewSel(-1);
+	handleSelectionChanged();
 }
 
 void PropertiesPalette::setTextFlowMode(PageItem::TextFlowMode mode)
 {
-	if (!m_ScMW || m_ScMW->scriptIsRunning() || !HaveItem)
-		return;
-	if (CurItem->isGroup())
-	{
-		if (mode == PageItem::TextFlowDisabled)
-			textFlowDisabled2->setChecked(true);
-		else if (mode == PageItem::TextFlowUsesFrameShape)
-			textFlowUsesFrameShape2->setChecked(true);
-		else if (mode == PageItem::TextFlowUsesBoundingBox)
-			textFlowUsesBoundingBox2->setChecked(true);
-		else if (mode == PageItem::TextFlowUsesContourLine)
-			textFlowUsesContourLine2->setChecked(true);
-		else if (mode == PageItem::TextFlowUsesImageClipping)
-			textFlowUsesImageClipping2->setChecked(true);
-		if ((CurItem->asImageFrame()) && (CurItem->imageClip.size() != 0))
-			textFlowUsesImageClipping2->setEnabled(true);
-		else
-			textFlowUsesImageClipping2->setEnabled(false);
-	}
-	else
-	{
-		if (mode == PageItem::TextFlowDisabled)
-			textFlowDisabled->setChecked(true);
-		else if (mode == PageItem::TextFlowUsesFrameShape)
-			textFlowUsesFrameShape->setChecked(true);
-		else if (mode == PageItem::TextFlowUsesBoundingBox)
-			textFlowUsesBoundingBox->setChecked(true);
-		else if (mode == PageItem::TextFlowUsesContourLine)
-			textFlowUsesContourLine->setChecked(true);
-		else if (mode == PageItem::TextFlowUsesImageClipping)
-			textFlowUsesImageClipping->setChecked(true);
-		if ((CurItem->asImageFrame()) && (CurItem->imageClip.size() != 0))
-			textFlowUsesImageClipping->setEnabled(true);
-		else
-			textFlowUsesImageClipping->setEnabled(false);
-	}
-}
-
-void PropertiesPalette::SetCurItem(PageItem *i)
+	if (!m_ScMW || m_ScMW->scriptIsRunning() || !m_haveItem)
+		return;
+	shapePal->displayTextFlowMode(mode);
+	groupPal->displayTextFlowMode(mode);
+}
+
+PageItem* PropertiesPalette::currentItemFromSelection()
+{
+	PageItem *currentItem = NULL;
+
+	if (m_doc)
+	{
+		if (m_doc->m_Selection->count() > 1)
+		{
+			uint lowestItem = 999999;
+			for (int a=0; a<m_doc->m_Selection->count(); ++a)
+			{
+				currentItem = m_doc->m_Selection->itemAt(a);
+				lowestItem = qMin(lowestItem, currentItem->ItemNr);
+			}
+			currentItem = m_doc->Items->at(lowestItem);
+		}
+		else if (m_doc->m_Selection->count() == 1)
+		{
+			currentItem = m_doc->m_Selection->itemAt(0);
+		}
+	}
+
+	return currentItem;
+}
+
+void PropertiesPalette::setCurrentItem(PageItem *i)
 {
 	if (!m_ScMW || m_ScMW->scriptIsRunning())
 		return;
 	//CB We shouldnt really need to process this if our item is the same one
 	//maybe we do if the item has been changed by scripter.. but that should probably
 	//set some status if so.
-	//FIXME: This wont work until when a canvas deselect happens, CurItem must be NULL.
-	//if (CurItem == i)
+	//FIXME: This wont work until when a canvas deselect happens, m_item must be NULL.
+	//if (m_item == i)
 	//	return;
 
-	if (!doc)
+	if (!i)
+	{
+		unsetItem();
+		return;
+	}
+
+	int oldTabIndex = TabStack->currentIndex();
+
+	if (!m_doc)
 		setDoc(i->doc());
 
-	disconnect(StyledLine, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SetSTline(QListWidgetItem*)));
-	disconnect(NameEdit, SIGNAL(Leaved()), this, SLOT(NewName()));
-	disconnect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
-	disconnect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
-	disconnect(startArrowScaleSpin, SIGNAL(valueChanged(int)), this, SLOT(setStartArrowScale(int )));
-	disconnect(endArrowScaleSpin, SIGNAL(valueChanged(int)), this, SLOT(setEndArrowScale(int )));
-	disconnect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
-	disconnect(LineMode, SIGNAL(activated(int)), this, SLOT(NewLineMode()));
-
-
-	HaveItem = false;
-	CurItem = i;
-
-	Cpal->setCurrentItem(CurItem);
-	Cpal->updateFromItem();
-	Tpal->setCurrentItem(CurItem);
+	disconnect(TabStack, SIGNAL(currentChanged(int)) , this, SLOT(SelTab(int)));
+	disconnect(linePal , SIGNAL(lineModeChanged(int)), this, SLOT(NewLineMode(int)));
+
+	m_haveItem = false;
+	m_item = i;
+
+	/*xyzPal->handleSelectionChanged();
+	shapePal->handleSelectionChanged();
+	groupPal->handleSelectionChanged();
+	imagePal->handleSelectionChanged();
+	linePal->handleSelectionChanged();
+	textPal->handleSelectionChanged();*/
+
+	/*Cpal->setCurrentItem(m_item);
+	Cpal->updateFromItem();*/
+	Tpal->setCurrentItem(m_item);
 	Tpal->updateFromItem();
-	TpalGroup->setCurrentItem(CurItem);
-	if (CurItem->FrameType == 0)
-		SCustom->setIcon(SCustom->getIconPixmap(0));
-	if (CurItem->FrameType == 1)
-		SCustom->setIcon(SCustom->getIconPixmap(1));
-	if (CurItem->FrameType > 3)
-		SCustom->setIcon(SCustom->getIconPixmap(CurItem->FrameType-2));
-	if ((CurItem->asLine()) || (CurItem->asPolyLine()) || (CurItem->asSpiral()))
-	{
-		startArrow->setEnabled(true);
-		endArrow->setEnabled(true);
-		startArrow->setCurrentIndex(CurItem->startArrowIndex());
-		endArrow->setCurrentIndex(CurItem->endArrowIndex());
-		startArrowScaleSpin->setEnabled(true);
-		endArrowScaleSpin->setEnabled(true);
-		endArrowScaleSpin->setValue(CurItem->endArrowScale());
-		startArrowScaleSpin->setValue(CurItem->startArrowScale());
-	}
-	else
-	{
-		startArrow->setEnabled(false);
-		endArrow->setEnabled(false);
-		startArrowScaleSpin->setEnabled(false);
-		endArrowScaleSpin->setEnabled(false);
-	}
-	NameEdit->setText(CurItem->itemName());
-	RoundRect->setValue(CurItem->cornerRadius()*m_unitRatio);
-	QString tm;
-	LevelTxt->setText(tm.setNum(CurItem->ItemNr + 1));
-	PageItem_TextFrame *i2=CurItem->asTextFrame();
-	if (i2!=0)
-	{
-		disconnect(dGap, SIGNAL(valueChanged(double)), this, SLOT(NewGap()));
-		disconnect(DCol, SIGNAL(valueChanged(int)), this, SLOT(NewCols()));
-		DCol->setMaximum(qMax(qRound(i2->width() / qMax(i2->ColGap, 10.0)), 1));
-		DCol->setMinimum(1);
-		DCol->setValue(i2->Cols);
-		dGap->setMinimum(0);
-		if (colgapLabel->currentIndex() == 0)
-		{
-			dGap->setMaximum(qMax((i2->width() / i2->Cols - i2->textToFrameDistLeft() - i2->textToFrameDistRight())*m_unitRatio, 0.0));
-			dGap->setValue(i2->ColGap*m_unitRatio);
-		}
-		else
-		{
-			dGap->setMaximum(qMax((i2->width() / i2->Cols)*m_unitRatio, 0.0));
-			dGap->setValue(i2->columnWidth()*m_unitRatio);
-		}
-		DLeft->setValue(i2->textToFrameDistLeft()*m_unitRatio);
-		DTop->setValue(i2->textToFrameDistTop()*m_unitRatio);
-		DBottom->setValue(i2->textToFrameDistBottom()*m_unitRatio);
-		DRight->setValue(i2->textToFrameDistRight()*m_unitRatio);
-		if (DCol->value() == 1)
-		{
-			dGap->setEnabled(false);
-			colgapLabel->setEnabled(false);
-		}
-		else
-		{
-			dGap->setEnabled(true);
-			colgapLabel->setEnabled(true);
-		}
-		// I put it here because it’s visually grouped with these elements
-		// but it’s a PageItem prop. and as such should be set without considering
-		// the frame type.
-		setFlop(CurItem->firstLineOffset());
-		
-		// Style
-		updateStyle(i2->currentStyle());
-		
-		connect(dGap, SIGNAL(valueChanged(double)), this, SLOT(NewGap()));
-		connect(DCol, SIGNAL(valueChanged(int)), this, SLOT(NewCols()));
-	}
-	if (CurItem->asImageFrame())
-	{
-		disconnect(imagePageNumber, SIGNAL(valueChanged(int)), this, SLOT(NewPage()));
-		imagePageNumber->setMaximum(CurItem->pixm.imgInfo.numberOfPages);
-		imagePageNumber->setValue(CurItem->pixm.imgInfo.actualPageNumber);
-		CompressionMethod->setCurrentIndex(CurItem->OverrideCompressionMethod ? CurItem->CompressionMethodIndex + 1 : 0);
-		CompressionQuality->setCurrentIndex(CurItem->OverrideCompressionQuality ? CurItem->CompressionQualityIndex + 1 : 0);
-		connect(imagePageNumber, SIGNAL(valueChanged(int)), this, SLOT(NewPage()));
-	}
-	Revert->setChecked(CurItem->reversed());
-	setTextFlowMode(CurItem->textFlowMode());
-	if (StyledLine->currentItem())
-		StyledLine->currentItem()->setSelected(false);
-	bool setter;
-	if (CurItem->NamedLStyle.isEmpty())
-	{
-		setter = true;
-		QListWidgetItem *itemStl = NULL;
-		itemStl = StyledLine->item(0);
-		if (itemStl != NULL)
-			itemStl->setSelected(true);
-	}
-	else
-	{
-		QList<QListWidgetItem*> results (StyledLine->findItems(CurItem->NamedLStyle, Qt::MatchFixedString|Qt::MatchCaseSensitive));
-		if (results.count() > 0)
-			results[0]->setSelected(true); //Qt3-QListBox::ExactMatch));
-		setter = false;
-	}
-	LStyle->setEnabled(setter);
-	LSize->setEnabled(setter);
-	LJoinStyle->setEnabled(setter);
-	LEndStyle->setEnabled(setter);
-	if (CurItem->dashes().count() == 0)
-		dashEditor->hide();
-	else
-	{
-		LStyle->setCurrentIndex(37);
-		dashEditor->setDashValues(CurItem->dashes(), qMax(CurItem->lineWidth(), 0.001), CurItem->dashOffset());
-		dashEditor->show();
-	}
-	if (LMode)
-		LineMode->setCurrentIndex(1);
-	else
-		LineMode->setCurrentIndex(0);
-	connect(StyledLine, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SetSTline(QListWidgetItem*)));
-	connect(NameEdit, SIGNAL(Leaved()), this, SLOT(NewName()));
-	connect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
-	connect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
-	connect(LineMode, SIGNAL(activated(int)), this, SLOT(NewLineMode()));
-	connect(startArrowScaleSpin, SIGNAL(valueChanged(int)), this, SLOT(setStartArrowScale(int )));
-	connect(endArrowScaleSpin, SIGNAL(valueChanged(int)), this, SLOT(setEndArrowScale(int )));
+
+	setTextFlowMode(m_item->textFlowMode());
+
+	connect(linePal , SIGNAL(lineModeChanged(int)), this, SLOT(NewLineMode(int)));
 
 //CB replaces old emits from PageItem::emitAllToGUI()
-	disconnect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
-	disconnect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
-	disconnect(Width, SIGNAL(valueChanged(double)), this, SLOT(NewW()));
-	disconnect(Height, SIGNAL(valueChanged(double)), this, SLOT(NewH()));
-	disconnect(Locked, SIGNAL(clicked()), this, SLOT(handleLock()));
-	disconnect(NoPrint, SIGNAL(clicked()), this, SLOT(handlePrint()));
-	disconnect(NoResize, SIGNAL(clicked()), this, SLOT(handleLockSize()));
-	disconnect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
-	disconnect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
-	disconnect(LSize, SIGNAL(valueChanged(double)), this, SLOT(NewLineWidth()));
-	disconnect(LStyle, SIGNAL(activated(int)), this, SLOT(NewLineStyle()));
-	disconnect(LJoinStyle, SIGNAL(activated(int)), this, SLOT(NewLineJoin()));
-	disconnect(LEndStyle, SIGNAL(activated(int)), this, SLOT(NewLineEnd()));
-	disconnect(Rotation, SIGNAL(valueChanged(double)), this, SLOT(setRotation()));
-	disconnect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
-	disconnect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
-	disconnect(imageXOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
-	disconnect(imageYOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
-	disconnect(imageRotation, SIGNAL(valueChanged(double)), this, SLOT(NewLocalRot()));
-	disconnect(DTop, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
-	disconnect(DLeft, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
-	disconnect(DRight, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
-	disconnect(DBottom, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
-	setXY(i->xPos(), i->yPos());
-	setBH(i->width(), i->height());
-	NoPrint->setChecked(!i->printEnabled());
-	if (i->isImageFrame() || i->isTextFrame() || i->isLatexFrame() || i->isOSGFrame() || i->isSymbol() || i->isGroup() || i->isSpiral())
-	{
-		FlipH->setCheckable(true);
-		FlipV->setCheckable(true);
-	}
-	else
-	{
-		FlipH->setCheckable(false);
-		FlipV->setCheckable(false);
-	}
-	setFlippedH(i->imageFlippedH());
-	setFlippedV(i->imageFlippedV());
-	RoVal = i->rotation();
-	double rr = i->rotation();
-	if (i->rotation() > 0)
-		rr = 360 - rr;
-	Rotation->setValue(fabs(rr));
-	setTextToFrameDistances(i->textToFrameDistLeft(),i->textToFrameDistTop(),i->textToFrameDistBottom(),i->textToFrameDistRight());
-	double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY, patternSpace;
-	bool mirrorX, mirrorY;
-	i->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
-	i->patternFlip(mirrorX, mirrorY);
-	Cpal->setActPattern(i->pattern(), patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY, mirrorX, mirrorY);
-	i->strokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY, patternSpace);
-	i->strokePatternFlip(mirrorX, mirrorY);
-	Cpal->setActPatternStroke(i->strokePattern(), patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY, mirrorX, mirrorY, patternSpace, i->isStrokePatternToPath());
-
-	i->maskTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
-	i->maskFlip(mirrorX, mirrorY);
-	Tpal->setActPattern(i->patternMask(), patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY, mirrorX, mirrorY);
-
-
-//CB TODO reconnect PP signals from here
-	connect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
-	connect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
-	connect(Width, SIGNAL(valueChanged(double)), this, SLOT(NewW()));
-	connect(Height, SIGNAL(valueChanged(double)), this, SLOT(NewH()));
-	connect(Locked, SIGNAL(clicked()), this, SLOT(handleLock()));
-	connect(NoPrint, SIGNAL(clicked()), this, SLOT(handlePrint()));
-	connect(NoResize, SIGNAL(clicked()), this, SLOT(handleLockSize()));
-	connect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
-	connect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
-	connect(LSize, SIGNAL(valueChanged(double)), this, SLOT(NewLineWidth()));
-	connect(LStyle, SIGNAL(activated(int)), this, SLOT(NewLineStyle()));
-	connect(LJoinStyle, SIGNAL(activated(int)), this, SLOT(NewLineJoin()));
-	connect(LEndStyle, SIGNAL(activated(int)), this, SLOT(NewLineEnd()));
-	connect(Rotation, SIGNAL(valueChanged(double)), this, SLOT(setRotation()));
-	connect(DTop, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
-	connect(DLeft, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
-	connect(DRight, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
-	connect(DBottom, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
-
-	if ((CurItem->isTableItem) && (CurItem->isSingleSel))
-	{
-		setter = true;
-		TabStack3->setCurrentIndex(1);
-		TopLine->setChecked(CurItem->TopLine);
-		LeftLine->setChecked(CurItem->LeftLine);
-		RightLine->setChecked(CurItem->RightLine);
-		BottomLine->setChecked(CurItem->BottomLine);
-		Rotation->setEnabled(false);
-	}
-	else
-	{
-		setter = false;
-		TabStack3->setCurrentIndex(0);
-	}
-	Xpos->setEnabled(!setter);
-	Ypos->setEnabled(!setter);
-	LayerGroup->setEnabled(!setter);
-	if ((CurItem->isGroup()) && (!CurItem->isSingleSel))
+	setLocked(i->locked());
+
+	if ((m_item->isGroup()) && (!m_item->isSingleSel))
 	{
 		TabStack->setItemEnabled(idXYZItem, true);
 		TabStack->setItemEnabled(idShapeItem, false);
@@ -1838,161 +439,27 @@
 		TabStack->setItemEnabled(idColorsItem, false);
 		TabStack->setItemEnabled(idTextItem, false);
 		TabStack->setItemEnabled(idImageItem, false);
-		if (CurItem->FrameType == 0)
-			SCustom2->setIcon(SCustom2->getIconPixmap(0));
-		if (CurItem->FrameType == 1)
-			SCustom2->setIcon(SCustom2->getIconPixmap(1));
-		if (CurItem->FrameType > 3)
-			SCustom2->setIcon(SCustom2->getIconPixmap(CurItem->FrameType-2));
-		TpalGroup->updateFromItem();
-		TpalGroup->setActPattern(i->patternMask(), patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY, mirrorX, mirrorY);
-		SCustom2->setEnabled(true);
-		EditShape2->setEnabled(true);
-		SRect2->setEnabled(true);
-		textFlowDisabled2->setEnabled(true);
-		textFlowUsesFrameShape2->setEnabled(true);
-		textFlowUsesBoundingBox2->setEnabled(true);
-		textFlowUsesContourLine2->setEnabled(true);
-		textFlowUsesImageClipping2->setEnabled(false);
 	}
 	else
 		TabStack->setItemEnabled(idGroupItem, false);
-	if (CurItem->asPathText())
-	{
-		TabStack2->setCurrentIndex(0);
-		pathTextType->setCurrentIndex(CurItem->textPathType);
-		flippedPathText->setChecked(CurItem->textPathFlipped);
-		showcurveCheckBox->setChecked(CurItem->PoShow);
-		LineW->setValue(CurItem->BaseOffs * -1);
-		Dist->setValue(CurItem->textToFrameDistLeft());
-		flopItem->setHidden(true);
-		DistanceItem->setHidden(true);
-		Distance2Item->setHidden(false);
-	}
-	else if (CurItem->asTextFrame())
-	{
-		TabStack2->setCurrentIndex(0);
-		flopItem->setHidden(false);
-		DistanceItem->setHidden(false);
-		Distance2Item->setHidden(true);
-	}
-	else
-	{
-		TabStack2->setCurrentIndex(1);
-		Distance3->setVisible(i->itemType() != PageItem::ImageFrame);
-		flopItem->setHidden(false);
-		DistanceItem->setHidden(false);
-		Distance2Item->setHidden(true);
-	}
-	NonZero->setChecked(!CurItem->fillRule);
-	EvenOdd->setChecked(CurItem->fillRule);
-	// Frame type 3 is obsolete: CR 2005-02-06
-	//if (((i->itemType() == PageItem::TextFrame) || (i->itemType() == PageItem::ImageFrame) || (i->itemType() == 3)) &&  (!i->ClipEdited))
-	if (((CurItem->asTextFrame()) || (CurItem->asImageFrame())) &&  (!CurItem->ClipEdited) && ((CurItem->FrameType == 0) || (CurItem->FrameType == 2)))
-		RoundRect->setEnabled(true);
-	else
-	{
-		RoundRect->setEnabled ((CurItem->asPolygon()) &&  (!CurItem->ClipEdited)  && ((CurItem->FrameType == 0) || (CurItem->FrameType == 2)));
-	}
-	if (CurItem->doOverprint)
-		Cpal->setActOverprint(1);
-	else
-		Cpal->setActOverprint(0);
-	if ((CurItem->itemType() == PageItem::Line) && LMode)
-	{
-		xposLabel->setText( tr( "&X1:" ) );
-		widthLabel->setText( tr( "X&2:" ) );
-		yposLabel->setText( tr( "Y&1:" ) );
-		heightLabel->setText( tr( "&Y2:" ) );
-		Rotation->setEnabled(false);
-	}
-	else
-	{
-		xposLabel->setText( tr( "&X-Pos:" ) );
-		widthLabel->setText( tr( "&Width:" ) );
-		yposLabel->setText( tr( "&Y-Pos:" ) );
-		heightLabel->setText( tr( "&Height:" ) );
-		Rotation->setEnabled(!((CurItem->isTableItem) && (CurItem->isSingleSel)));
-	}
-	HaveItem = true;
-	SelTab(TabStack->currentIndex());
-	if (CurItem->asLine())
-	{
-		keepFrameWHRatioButton->setEnabled(false);
-		Height->setEnabled(LMode && !CurItem->locked());
-	}
-	else
-	{
-		Height->setEnabled(true);
-		keepFrameWHRatioButton->setEnabled(true);
-		if (CurItem->asImageFrame())
-		{
-			updateCmsList();
-			EditEffects->setShown(CurItem->PictureIsAvailable && CurItem->isRaster);
-			EditPSDProps->setShown(CurItem->PictureIsAvailable && CurItem->pixm.imgInfo.valid);
-			setter = CurItem->ScaleType;
-			FreeScale->setChecked(setter);
-			FrameScale->setChecked(!setter);
-#ifdef HAVE_OSG
-			if ((CurItem->asLatexFrame()) || (CurItem->asOSGFrame()))
-#else
-			if (CurItem->asLatexFrame())
-#endif
-			{
-				FreeScale->setEnabled(false);
-				FrameScale->setEnabled(false);
-				Aspect->setEnabled(false);
-				imageXScaleSpinBox->setEnabled(false);
-				imageYScaleSpinBox->setEnabled(false);
-				imgDpiX->setEnabled(false);
-				imgDpiY->setEnabled(false);
-			}
-			else
-			{
-				imageXScaleSpinBox->setEnabled(setter);
-				imageYScaleSpinBox->setEnabled(setter);
-				imgDpiX->setEnabled(setter);
-				imgDpiY->setEnabled(setter);
-				Aspect->setEnabled(!setter);
-				Aspect->setChecked(CurItem->AspectRatio);
-				FreeScale->setEnabled(true);
-				FrameScale->setEnabled(true);
-			}
-//CB Why do we need this? Setting it too much here
-// 			if (setter == true)
-// 			{
-// 				keepImageWHRatioButton->setChecked(setter);
-// 				keepImageDPIRatioButton->setChecked(setter);
-// 			}
-			//imageXOffsetSpinBox->setEnabled(setter);
-			//imageYOffsetSpinBox->setEnabled(setter);
-			//imageRotation->setEnabled(setter);
-		}
-	}
-	setXY(CurItem->xPos(), CurItem->yPos());
-	setLocked(i->locked());
-	setSizeLocked(i->sizeLocked());
-	setScaleAndOffset(i->imageXScale(), i->imageYScale(), i->imageXOffset(), i->imageYOffset());
-	setLineWidth(i->lineWidth());
-	setLIvalue(i->lineStyle(), i->lineEnd(), i->lineJoin());
-	double rrR = i->imageRotation();
-	if (i->imageRotation() > 0)
-		rrR = 360 - rrR;
-	imageRotation->setValue(fabs(rrR));
-	connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
-	connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
-	connect(imageXOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
-	connect(imageYOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
-	connect(imageRotation, SIGNAL(valueChanged(double)), this, SLOT(NewLocalRot()));
-
-	DoGroup->setEnabled(false);
-	DoUnGroup->setEnabled(false);
-	if (doc->m_Selection->count() > 1)
-		DoGroup->setEnabled(true);
-	if (doc->m_Selection->count() == 1)
-		DoUnGroup->setEnabled(CurItem->isGroup());
-#ifdef HAVE_OSG
-	if (CurItem->asOSGFrame())
+
+	m_haveItem = true;
+
+	if (oldTabIndex != TabStack->currentIndex())
+	{
+		//Must be called only when necessary : cause focus problem
+		//in spinboxes when processing valueChanged() signals
+		SelTab(TabStack->currentIndex());
+	}
+
+	xyzPal->handleSelectionChanged();
+	shapePal->handleSelectionChanged();
+	groupPal->handleSelectionChanged();
+	imagePal->handleSelectionChanged();
+	linePal->handleSelectionChanged();
+	textPal->handleSelectionChanged();
+
+	if (m_item->asOSGFrame())
 	{
 		TabStack->setItemEnabled(idXYZItem, true);
 		TabStack->setItemEnabled(idShapeItem, true);
@@ -2002,13 +469,8 @@
 		TabStack->setItemEnabled(idTransparencyItem, false);
 		TabStack->setItemEnabled(idTextItem, false);
 		TabStack->setItemEnabled(idImageItem, false);
-		Rotation->setEnabled(false);
-		RoundRect->setEnabled(false);
-		EditShape->setEnabled(false);
-		SCustom->setEnabled(false);
-	}
-#endif
-	if (CurItem->asSymbolFrame())
+	}
+	if (m_item->asSymbolFrame())
 	{
 		TabStack->setItemEnabled(idXYZItem, true);
 		TabStack->setItemEnabled(idShapeItem, false);
@@ -2018,159 +480,66 @@
 		TabStack->setItemEnabled(idTextItem, false);
 		TabStack->setItemEnabled(idImageItem, false);
 		TabStack->setItemEnabled(idTransparencyItem, false);
-		if (CurItem->FrameType == 0)
-			SCustom2->setIcon(SCustom2->getIconPixmap(0));
-		if (CurItem->FrameType == 1)
-			SCustom2->setIcon(SCustom2->getIconPixmap(1));
-		if (CurItem->FrameType > 3)
-			SCustom2->setIcon(SCustom2->getIconPixmap(CurItem->FrameType-2));
-		TpalGroup->updateFromItem();
-		TpalGroup->setActPattern(i->patternMask(), patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY, mirrorX, mirrorY);
-		SCustom2->setEnabled(true);
-		EditShape2->setEnabled(true);
-		SRect2->setEnabled(true);
-		textFlowDisabled2->setEnabled(true);
-		textFlowUsesFrameShape2->setEnabled(true);
-		textFlowUsesBoundingBox2->setEnabled(true);
-		textFlowUsesContourLine2->setEnabled(true);
-		textFlowUsesImageClipping2->setEnabled(false);
-	}
-	updateSpinBoxConstants();
+	}
 	connect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
 }
 
-void PropertiesPalette::NewSel(int nr)
-{
-	if (!HaveDoc || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	int visID;
-	PageItem *i=0;
+void  PropertiesPalette::handleSelectionChanged()
+{
+	if (!m_haveDoc || !m_ScMW || m_ScMW->scriptIsRunning())
+		return;
 	int currentTab = TabStack->currentIndex();
 	disconnect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
-	if (doc->m_Selection->count()>1)
-	{
-		RoVal = 0;
-		double gx, gy, gh, gw;
-		doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-		int bp = RotationGroup->checkedId();
-		if (bp == 0)
-			m_ScMW->view->RCenter = FPoint(gx, gy);
-		else if (bp == 1)
-			m_ScMW->view->RCenter = FPoint(gx + gw, gy);
-		else if (bp == 2)
-			m_ScMW->view->RCenter = FPoint(gx + gw / 2.0, gy + gh / 2.0);
-		else if (bp == 3)
-			m_ScMW->view->RCenter = FPoint(gx, gy + gh);
-		else if (bp == 0)
-			m_ScMW->view->RCenter = FPoint(gx + gw, gy + gh);
-		xposLabel->setText( tr( "&X-Pos:" ) );
-		widthLabel->setText( tr( "&Width:" ) );
-		yposLabel->setText( tr( "&Y-Pos:" ) );
-		heightLabel->setText( tr( "&Height:" ) );
-		HaveItem = false;
-		Xpos->setValue(gx);
-		Ypos->setValue(gy);
-		Width->setValue(gw);
-		Height->setValue(gh);
-		Rotation->setValue(0);
-		RoundRect->setValue(0);
-		HaveItem = true;
-		Xpos->setEnabled(true);
-		Ypos->setEnabled(true);
-		Width->setEnabled(true);
-		Height->setEnabled(true);
-		Rotation->setEnabled(true);
+
+	qDebug() << "PropertiesPalette::handleSelectionChanged()";
+
+	/*xyzPal->handleSelectionChanged();
+	shapePal->handleSelectionChanged();
+	groupPal->handleSelectionChanged();
+	imagePal->handleSelectionChanged();
+	linePal->handleSelectionChanged();
+	textPal->handleSelectionChanged();*/
+
+	PageItem* currItem = currentItemFromSelection();
+	if (m_doc->m_Selection->count() > 1)
+	{
 		for (int ws = 1; ws < 8; ++ws)
 			TabStack->setItemEnabled(ws, false);
 		TabStack->widget(0)->setEnabled(true);
 		TabStack->setItemEnabled(idXYZItem, true);
-		NameEdit->setEnabled(false);
 		TabStack->setItemEnabled(idLineItem, false);
 		TabStack->setItemEnabled(idColorsItem, true);
 		TabStack->setItemEnabled(idTransparencyItem, true);
-		if (HaveItem && CurItem)
-		{
-			if ((CurItem->isGroup()) && (!CurItem->isSingleSel))
+		if (m_haveItem && m_item)
+		{
+			if ((m_item->isGroup()) && (!m_item->isSingleSel))
 				TabStack->setItemEnabled(idGroupItem, true);
 		}
-		FlipH->setCheckable( false );
-		FlipV->setCheckable( false );
-		FlipH->setChecked(false);
-		FlipV->setChecked(false);
-		flopRealHeight->setChecked(true);
 	}
 	else
 	{
-		if (nr!=-1)
-		{
-			i=doc->m_Selection->itemAt(0);
-			HaveItem=true;
-			EditShape->setEnabled(!i->locked());
-			SCustom->setEnabled(nr!=5 && nr!=7 && nr!=8 && nr!=13 && nr!=14 && nr!=15 && !i->locked());
-		}
-		else
-		{
-			DoGroup->setEnabled(false);
-			DoUnGroup->setEnabled(false);
-			EditShape->setEnabled(false);
-			SCustom->setEnabled(false);
-		}
-		NameEdit->setEnabled(true);
-		LineMode->setEnabled(false);
-		RotationGroup->setEnabled(true);
-		visID = TabStack->currentIndex();
+		int itemType = currItem ? (int) currItem->itemType() : -1;
+		m_haveItem   = (itemType != -1);
+
+		int visID = TabStack->currentIndex();
 		TabStack->widget(0)->setEnabled(true);
 		TabStack->setItemEnabled(idXYZItem, true);
 		TabStack->setItemEnabled(idColorsItem, true);
 		TabStack->setItemEnabled(idTransparencyItem, true);
-		//CB If Toggle is not possible, then we need to enable it so we can turn it off
-		//It then gets reset below for items where its valid
-		FlipH->setCheckable(true);
-		FlipV->setCheckable(true);
-		if ((nr == 2) || (nr == 4) || ((nr >= 9) && (nr <= 12)) || (nr == 15))
-		{
-			FlipH->setCheckable(true);
-			FlipV->setCheckable(true);
-		}
-		else
-		{
-			FlipH->setCheckable(false);
-			FlipV->setCheckable(false);
-			FlipH->setChecked(false);
-			FlipV->setChecked(false);
-		}
-		//CB Why cant we do this for lines?
-//		FlipH->setEnabled((nr!=-1) && (nr!=5));
-//		FlipV->setEnabled((nr!=-1) && (nr!=5));
-		FlipH->setEnabled(nr!=-1);
-		FlipV->setEnabled(nr!=-1);
-		switch (nr)
+		switch (itemType)
 		{
 		case -1:
-			xposLabel->setText( tr( "&X-Pos:" ) );
-			widthLabel->setText( tr( "&Width:" ) );
-			yposLabel->setText( tr( "&Y-Pos:" ) );
-			heightLabel->setText( tr( "&Height:" ) );
-			RoundRect->setEnabled(false);
-			HaveItem = false;
-			Xpos->setValue(0);
-			Ypos->setValue(0);
-			Width->setValue(0);
-			Height->setValue(0);
-			Rotation->setValue(0);
-			RoundRect->setValue(0);
+			m_haveItem = false;
 			for (int ws = 1; ws < 8; ++ws)
 				TabStack->setItemEnabled(ws, false);
 			TabStack->widget(0)->setEnabled(false);
 			TabStack->setItemEnabled(idXYZItem, false);
-			Cpal->ChooseGrad(0);
-			LevelTxt->setText("  ");
+			Cpal->displayGradient(0);
 			break;
 		case PageItem::ImageFrame:
 		case PageItem::LatexFrame:
 		case PageItem::OSGFrame:
-#ifdef HAVE_OSG
-			if (i->asOSGFrame())
+			if (currItem->asOSGFrame())
 			{
 				TabStack->setItemEnabled(idXYZItem, true);
 				TabStack->setItemEnabled(idShapeItem, true);
@@ -2180,46 +549,26 @@
 				TabStack->setItemEnabled(idTransparencyItem, false);
 				TabStack->setItemEnabled(idTextItem, false);
 				TabStack->setItemEnabled(idImageItem, false);
-				Rotation->setEnabled(false);
-				RoundRect->setEnabled(false);
-				EditShape->setEnabled(false);
-				SCustom->setEnabled(false);
 			}
 			else
 			{
-#endif
 				TabStack->setItemEnabled(idShapeItem, true);
 				TabStack->setItemEnabled(idTextItem, false);
 				TabStack->setItemEnabled(idImageItem, true);
 				TabStack->setItemEnabled(idLineItem, true);
-				if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
-					RoundRect->setEnabled(!i->locked());
-				else
-					RoundRect->setEnabled(false);
-				if ((doc->m_Selection->itemAt(0)->FrameType == 0) || (doc->m_Selection->itemAt(0)->FrameType == 2))
-					RoundRect->setEnabled(!i->locked());
-#ifdef HAVE_OSG
 			}
-#endif
 			break;
 		case PageItem::TextFrame:
 			TabStack->setItemEnabled(idShapeItem, true);
 			TabStack->setItemEnabled(idTextItem, true);
 			TabStack->setItemEnabled(idImageItem, false);
 			TabStack->setItemEnabled(idLineItem, true);
-			if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
-				RoundRect->setEnabled(!i->locked());
-			else
-				RoundRect->setEnabled(false);
 			break;
 		case PageItem::Line:
 			TabStack->setItemEnabled(idShapeItem, false);
 			TabStack->setItemEnabled(idTextItem, false);
 			TabStack->setItemEnabled(idImageItem, false);
 			TabStack->setItemEnabled(idLineItem, true);
-			RoundRect->setEnabled(false);
-			LineMode->setEnabled(true);
-			RotationGroup->setEnabled(false);
 			break;
 		case PageItem::ItemType1:
 		case PageItem::ItemType3:
@@ -2230,10 +579,6 @@
 			TabStack->setItemEnabled(idTextItem, false);
 			TabStack->setItemEnabled(idImageItem, false);
 			TabStack->setItemEnabled(idLineItem, true);
-			if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
-				RoundRect->setEnabled(!i->locked());
-			else
-				RoundRect->setEnabled(false);
 			break;
 		case PageItem::PolyLine:
 		case PageItem::Spiral:
@@ -2241,14 +586,12 @@
 			TabStack->setItemEnabled(idTextItem, false);
 			TabStack->setItemEnabled(idImageItem, false);
 			TabStack->setItemEnabled(idLineItem, true);
-			RoundRect->setEnabled(false);
 			break;
 		case PageItem::PathText:
 			TabStack->setItemEnabled(idShapeItem, true);
 			TabStack->setItemEnabled(idTextItem, true);
 			TabStack->setItemEnabled(idImageItem, false);
 			TabStack->setItemEnabled(idLineItem, true);
-			RoundRect->setEnabled(false);
 			break;
 		case PageItem::Symbol:
 		case PageItem::Group:
@@ -2259,10 +602,6 @@
 			TabStack->setItemEnabled(idGroupItem, true);
 			TabStack->setItemEnabled(idColorsItem, false);
 			TabStack->setItemEnabled(idTransparencyItem, false);
-			if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
-				RoundRect->setEnabled(!i->locked());
-			else
-				RoundRect->setEnabled(false);
 			break;
 		}
 	}
@@ -2271,2026 +610,162 @@
 	updateGeometry();
 	repaint();
 	connect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
-}
-
-void PropertiesPalette::setMultipleSelection(bool isMultiple)
-{
-	if (!HaveDoc)
-		return;
-	//CB Having added the selection and undo transaction to mirrorpolyh/v in doc,
-	//these can be enabled all the time
-	NameEdit->setEnabled(!isMultiple);
-	FlipH->setEnabled(true);
-	FlipV->setEnabled(true);
-	if (doc->m_Selection->count() > 1)
-	{
-		FlipH->setCheckable( false );
-		FlipV->setCheckable( false );
-		SetCurItem(doc->m_Selection->itemAt(0));
+
+	if (currItem)
+	{
+		setCurrentItem(currItem);
 	}
 }
 
 void PropertiesPalette::unitChange()
 {
-	if (!HaveDoc)
-		return;
-	bool tmp = HaveItem;
-	HaveItem = false;
+	if (!m_haveDoc)
+		return;
+	bool tmp = m_haveItem;
+	m_haveItem = false;
 	double oldRatio = m_unitRatio;
-	m_unitRatio = doc->unitRatio();
-	m_unitIndex = doc->unitIndex();
-	Xpos->setNewUnit( m_unitIndex );
-	Ypos->setNewUnit( m_unitIndex );
-	Width->setNewUnit( m_unitIndex );
-	Height->setNewUnit( m_unitIndex );
-	imageXOffsetSpinBox->setNewUnit( m_unitIndex );
-	imageYOffsetSpinBox->setNewUnit( m_unitIndex );
-	dGap->setNewUnit( m_unitIndex );
-	DLeft->setNewUnit( m_unitIndex );
-	DTop->setNewUnit( m_unitIndex );
-	DBottom->setNewUnit( m_unitIndex );
-	DRight->setNewUnit( m_unitIndex );
-	RoundRect->setNewUnit( m_unitIndex );
-	LSize->setNewUnit( m_unitIndex );
-	Cpal->unitChange(oldRatio, m_unitRatio, doc->unitIndex());
-	Tpal->unitChange(oldRatio, m_unitRatio, doc->unitIndex());
-	TpalGroup->unitChange(oldRatio, m_unitRatio, doc->unitIndex());
-	HaveItem = tmp;
-}
-
-void PropertiesPalette::setLevel(uint l)
-{
-	QString tm;
-	LevelTxt->setText(tm.setNum(l + 1));
-}
-
-void PropertiesPalette::setXY(double x, double y)
+	m_unitRatio = m_doc->unitRatio();
+	m_unitIndex = m_doc->unitIndex();
+
+	xyzPal->unitChange();
+	shapePal->unitChange();
+	groupPal->unitChange();
+	imagePal->unitChange();
+	linePal->unitChange();
+	textPal->unitChange();
+
+	Cpal->unitChange(oldRatio, m_unitRatio, m_doc->unitIndex());
+	Tpal->unitChange(oldRatio, m_unitRatio, m_doc->unitIndex());
+	m_haveItem = tmp;
+}
+
+void PropertiesPalette::NewLineMode(int mode)
 {
 	if (!m_ScMW || m_ScMW->scriptIsRunning())
 		return;
-	disconnect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
-	disconnect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
-	bool useLineMode = false;
-	bool tmp = HaveItem;
-	double inX, inY, b, h, r, dummy1, dummy2;
-	QTransform ma;
-	FPoint n;
-	if (HaveItem)
-	{
-		if (doc->m_Selection->isMultipleSelection())
-		{
-			doc->m_Selection->getGroupRect(&dummy1, &dummy2, &b, &h);
-			r = 0.0;
-			ma.translate(dummy1, dummy2);
-		}
-		else
-		{
-			b = CurItem->width();
-			h = CurItem->height();
-			r = CurItem->rotation();
-			ma.translate(x, y);
-			useLineMode = (LMode && CurItem->isLine());
-		}
-	}
-	else
-	{
-		b = 0.0;
-		h = 0.0;
-		r = 0.0;
-		ma.translate(x, y);
-	}
-	HaveItem = false;
-	ma.rotate(r);
-	int bp = RotationGroup->checkedId();
-	// #8890 : basepoint is meaningless when lines use "end points" mode
-	if (bp == 0 || useLineMode)
-		n = FPoint(0.0, 0.0);
-	else if (bp == 1)
-		n = FPoint(b, 0.0);
-	else if (bp == 2)
-		n = FPoint(b / 2.0, h / 2.0);
-	else if (bp == 3)
-		n = FPoint(0.0, h);
-	else if (bp == 4)
-		n = FPoint(b, h);
-	inX = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
-	inY = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
-	if (tmp)
-	{
-		inX -= doc->rulerXoffset;
-		inY -= doc->rulerYoffset;
-		if (doc->guidesPrefs().rulerMode)
-		{
-			inX -= doc->currentPage()->xOffset();
-			inY -= doc->currentPage()->yOffset();
-		}
-	}
-	Xpos->setValue(inX*m_unitRatio);
-	Ypos->setValue(inY*m_unitRatio);
-	if (useLineMode)
-		setBH(CurItem->width(), CurItem->height());
-	HaveItem = tmp;
-	connect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
-	connect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
-}
-
-void PropertiesPalette::setBH(double x, double y)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	bool tmp = HaveItem;
-	HaveItem = false;
-	QTransform ma;
-	QPoint dp;
-	if ((LMode) && (CurItem->asLine()))
-	{
-		ma.translate(static_cast<double>(Xpos->value()) / m_unitRatio, static_cast<double>(Ypos->value()) / m_unitRatio);
-		ma.rotate(static_cast<double>(Rotation->value())*(-1));
-		// Qt4 dp = ma * QPoint(static_cast<int>(x), static_cast<int>(y));
-		dp = QPoint(static_cast<int>(x), static_cast<int>(y)) * ma;
-		Width->setValue(dp.x()*m_unitRatio);
-		Height->setValue(dp.y()*m_unitRatio);
-	}
-	else
-	{
-		RoundRect->setMaximum(qMin(x, y)/2*m_unitRatio);
-		RoundRect->setMinimum(-qMin(x, y)/2*m_unitRatio);
-		Width->setValue(x*m_unitRatio);
-		Height->setValue(y*m_unitRatio);
-	}
-	HaveItem = tmp;
-}
-
-void PropertiesPalette::setR(double r)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	bool tmp = HaveItem;
-	double rr = r;
-	if (r > 0)
-		rr = 360 - rr;
-	HaveItem = false;
-	Rotation->setValue(fabs(rr));
-	HaveItem = tmp;
-}
-
-void PropertiesPalette::setRR(double r)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	bool tmp = HaveItem;
-	HaveItem = false;
-	RoundRect->setValue(r*m_unitRatio);
-	HaveItem = tmp;
-}
-
-void PropertiesPalette::setCols(int r, double g)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	bool tmp = HaveItem;
-	HaveItem = false;
-	DCol->setValue(r);
-	dGap->setValue(g*m_unitRatio);
-	if (tmp)
-	{
-		PageItem_TextFrame *i2=CurItem->asTextFrame();
-		if (i2!=0)
-		{
-			DCol->setMaximum(qMax(qRound(i2->width() / qMax(i2->ColGap, 10.0)), 1));
-			if (colgapLabel->currentIndex() == 0)
-			{
-				dGap->setMaximum(qMax((i2->width() / i2->Cols - i2->textToFrameDistLeft() - i2->textToFrameDistRight())*m_unitRatio, 0.0));
-				dGap->setValue(i2->ColGap*m_unitRatio);
-			}
-			else
-			{
-				dGap->setMaximum(qMax((i2->width() / i2->Cols)*m_unitRatio, 0.0));
-				dGap->setValue(i2->columnWidth()*m_unitRatio);
-			}
-		}
-	}
-	DCol->setMinimum(1);
-	dGap->setMinimum(0);
-	if (DCol->value() == 1)
-	{
-		dGap->setEnabled(false);
-		colgapLabel->setEnabled(false);
-	}
-	else
-	{
-		dGap->setEnabled(true);
-		colgapLabel->setEnabled(true);
-	}
-	HaveItem = tmp;
-}
-
-void PropertiesPalette::setLineSpacingMode(int id)
-{
-	if ((HaveDoc) && (HaveItem))
-	{
-		doc->itemSelection_SetLineSpacingMode(id);
-		updateStyle(doc->appMode == modeEdit? CurItem->currentStyle() : CurItem->itemText.defaultStyle());
-	}
-}
-
-void PropertiesPalette::setLsp(double r)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	bool tmp = HaveItem;
-	HaveItem = false;
-	LineSp->setValue(r);
-	const ParagraphStyle& curStyle(tmp && doc->appMode == modeEdit? CurItem->currentStyle() : CurItem->itemText.defaultStyle());
-	if (tmp)
-	{
-		setupLineSpacingSpinbox(curStyle.lineSpacingMode(), r);
-		lineSpacingModeCombo->setCurrentIndex(curStyle.lineSpacingMode());
-	}
-	HaveItem = tmp;
-}
-
-void PropertiesPalette::setTextToFrameDistances(double left, double top, double bottom, double right)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	bool tmp = HaveItem;
-	HaveItem = false;
-	DLeft->setValue(left*m_unitRatio);
-	DTop->setValue(top*m_unitRatio);
-	DBottom->setValue(bottom*m_unitRatio);
-	DRight->setValue(right*m_unitRatio);
-	HaveItem = tmp;
-}
-
-void PropertiesPalette::setFontFace(const QString& newFont)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	bool tmp = HaveItem;
-	HaveItem = false;
-	if (CurItem != NULL)
-		Fonts->RebuildList(doc, CurItem->isAnnotation());
-	Fonts->setCurrentFont(newFont);
-	HaveItem = tmp;
-}
-
-
-void PropertiesPalette::setSize(double s)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	bool tmp = HaveItem;
-	HaveItem = false;
-	Size->setValue(s / 10.0);
-	HaveItem = tmp;
-}
-
-void PropertiesPalette::setExtra(double e)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	bool tmp = HaveItem;
-	HaveItem = false;
-	Extra->setValue(e / 10.0);
-	HaveItem = tmp;
-}
-
-void PropertiesPalette::ChangeScaling()
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-
-	if (FreeScale == sender())
-	{
-		FrameScale->setChecked(false);
-		FreeScale->setChecked(true);
-		Aspect->setEnabled(false);
-//		imageXOffsetSpinBox->setEnabled(true);
-//		imageYOffsetSpinBox->setEnabled(true);
-		imageXScaleSpinBox->setEnabled(true);
-		imageYScaleSpinBox->setEnabled(true);
-		imgDpiX->setEnabled(true);
-		imgDpiY->setEnabled(true);
-//		imageRotation->setEnabled(true);
-		keepImageWHRatioButton->setEnabled(true);
-		keepImageDPIRatioButton->setEnabled(true);
-	}
-	if (FrameScale == sender())
-	{
-		FrameScale->setChecked(true);
-		FreeScale->setChecked(false);
-		Aspect->setEnabled(true);
-//		imageXOffsetSpinBox->setEnabled(false);
-//		imageYOffsetSpinBox->setEnabled(false);
-		imageXScaleSpinBox->setEnabled(false);
-		imageYScaleSpinBox->setEnabled(false);
-		imgDpiX->setEnabled(false);
-		imgDpiY->setEnabled(false);
-//		imageRotation->setEnabled(false);
-		keepImageWHRatioButton->setEnabled(false);
-		keepImageDPIRatioButton->setEnabled(false);
-	}
-
-	if ((HaveDoc) && (HaveItem))
-	{
-		CurItem->setImageScalingMode(FreeScale->isChecked(), Aspect->isChecked());
-		emit UpdtGui(PageItem::ImageFrame);
-		emit DocChanged();
-	}
-}
-
-void PropertiesPalette::setImgRotation(double rot)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	disconnect(imageRotation, SIGNAL(valueChanged(double)), this, SLOT(NewLocalRot()));
-	double rrR = rot;
-	if (rot > 0)
-		rrR = 360 - rrR;
-	imageRotation->setValue(fabs(rrR));
-	connect(imageRotation, SIGNAL(valueChanged(double)), this, SLOT(NewLocalRot()));
-}
-
-void PropertiesPalette::setScaleAndOffset(double scx, double scy, double x, double y)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	bool tmp = HaveItem;
-	HaveItem = false;
-	disconnect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
-	disconnect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
-	disconnect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
-	disconnect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
-	disconnect(keepImageWHRatioButton, SIGNAL(clicked()), this, SLOT(ToggleKette()));
-	disconnect(keepImageDPIRatioButton, SIGNAL(clicked()), this, SLOT(ToggleKetteD()));
-	if (fabs(scx - scy) > 0.0002)
-	{
-		keepImageWHRatioButton->setChecked(false);
-		keepImageDPIRatioButton->setChecked(false);
-	}
-	if (tmp)
-	{
-		imageXOffsetSpinBox->setValue(x * m_unitRatio * CurItem->imageXScale());
-		imageYOffsetSpinBox->setValue(y * m_unitRatio * CurItem->imageYScale());
-		imageXScaleSpinBox->setValue(scx * 100 / 72.0 * CurItem->pixm.imgInfo.xres);
-		imageYScaleSpinBox->setValue(scy * 100 / 72.0 * CurItem->pixm.imgInfo.yres);
-		imgDpiX->setValue(qRound(720.0 / CurItem->imageXScale()) / 10.0);
-		imgDpiY->setValue(qRound(720.0 / CurItem->imageYScale()) / 10.0);
-	}
-	else
-	{
-		imageXOffsetSpinBox->setValue(x * m_unitRatio);
-		imageYOffsetSpinBox->setValue(y * m_unitRatio);
-		imageXScaleSpinBox->setValue(scx * 100);
-		imageYScaleSpinBox->setValue(scy * 100);
-		imgDpiX->setValue(72);
-		imgDpiY->setValue(72);
-	}
-	connect(keepImageWHRatioButton, SIGNAL(clicked()), this, SLOT(ToggleKette()));
-	connect(keepImageDPIRatioButton, SIGNAL(clicked()), this, SLOT(ToggleKetteD()));
-	connect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
-	connect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
-	connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
-	connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
-	HaveItem = tmp;
-}
-
-void PropertiesPalette::setLineWidth(double s)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	bool tmp = HaveItem;
-	HaveItem = false;
-	LSize->setValue(s*m_unitRatio);
-	if (tmp)
-	{
-		if (CurItem->dashes().count() != 0)
-		{
-			if (CurItem->lineWidth() != 0.0)
-			{
-				dashEditor->setDashValues(CurItem->dashes(), CurItem->lineWidth(), CurItem->dashOffset());
-				dashEditor->setEnabled(true);
-			}
-			else
-				dashEditor->setEnabled(false);
-		}
-	}
-	HaveItem = tmp;
-}
-
-void PropertiesPalette::setLIvalue(Qt::PenStyle p, Qt::PenCapStyle pc, Qt::PenJoinStyle pj)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	bool tmp = HaveItem;
-	HaveItem = false;
-	if (tmp)
-	{
-		if (CurItem->dashes().count() != 0)
-		{
-			LStyle->setCurrentIndex(37);
-			dashEditor->setDashValues(CurItem->dashes(), qMax(CurItem->lineWidth(), 0.001), CurItem->dashOffset());
-		}
-		else
-			LStyle->setCurrentIndex(static_cast<int>(p) - 1);
-	}
-	else
-		LStyle->setCurrentIndex(static_cast<int>(p) - 1);
-	switch (pc)
-	{
-	case Qt::FlatCap:
-		LEndStyle->setCurrentIndex(0);
-		break;
-	case Qt::SquareCap:
-		LEndStyle->setCurrentIndex(1);
-		break;
-	case Qt::RoundCap:
-		LEndStyle->setCurrentIndex(2);
-		break;
-	default:
-		LEndStyle->setCurrentIndex(0);
-		break;
-	}
-	switch (pj)
-	{
-	case Qt::MiterJoin:
-		LJoinStyle->setCurrentIndex(0);
-		break;
-	case Qt::BevelJoin:
-		LJoinStyle->setCurrentIndex(1);
-		break;
-	case Qt::RoundJoin:
-		LJoinStyle->setCurrentIndex(2);
-		break;
-	default:
-		LJoinStyle->setCurrentIndex(0);
-		break;
-	}
-	HaveItem = tmp;
-}
-
-void PropertiesPalette::setFlop( FirstLineOffsetPolicy f )
-{
-	if(f == FLOPFontAscent)
-		flopFontAscent->setChecked(true);
-	else if(f == FLOPLineSpacing)
-		flopLineSpacing->setChecked(true);
-	else
-		flopRealHeight->setChecked(true); //It’s historical behaviour.
-}
-
-void PropertiesPalette::setupLineSpacingSpinbox(int mode, double value)
-{
-	if (mode > 0)
-	{
-		if (mode==1)
-			LineSp->setSpecialValueText( tr( "Auto" ) );
-		if (mode==2)
-			LineSp->setSpecialValueText( tr( "Baseline" ) );
-		LineSp->setMinimum(0);
-		LineSp->setValue(0);
-		LineSp->setEnabled(false);
-	}
-	else
-	{
-		LineSp->setSpecialValueText("");
-		LineSp->setMinimum(1);
-		LineSp->setValue(value);
-		LineSp->setEnabled(true);
-	}
-}
-
-void PropertiesPalette::updateStyle(const ParagraphStyle& newCurrent)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	bool tmp = HaveItem;
-	HaveItem = false;
-	setupLineSpacingSpinbox(newCurrent.lineSpacingMode(), newCurrent.lineSpacing());
-	lineSpacingModeCombo->setCurrentIndex(newCurrent.lineSpacingMode());
-	GroupAlign->setStyle(newCurrent.alignment());
-	minWordTrackingSpinBox->setValue(newCurrent.minWordTracking() * 100.0);
-	normWordTrackingSpinBox->setValue(newCurrent.charStyle().wordTracking() * 100.0);
-	minGlyphExtSpinBox->setValue(newCurrent.minGlyphExtension() * 100.0);
-	maxGlyphExtSpinBox->setValue(newCurrent.maxGlyphExtension() * 100.0);
-	
-	updateOpticalMargins(newCurrent);
-	
-	HaveItem = tmp;
-	
-	
-}
-
-void PropertiesPalette::setStil(int s)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	StrokeIcon->setEnabled(false);
-	TxStroke->setEnabled(false);
-	PM1->setEnabled(false);
-	SeStyle->setStyle(s);
-	if ((s & 4) || (s & 256))
-	{
-		StrokeIcon->setEnabled(true);
-		TxStroke->setEnabled(true);
-		PM1->setEnabled(true);
-	}
-}
-
-void PropertiesPalette::setAli(int e)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	bool tmp = HaveItem;
-	HaveItem = false;
-	GroupAlign->setEnabled(true);
-	GroupAlign->setStyle(e);
-	HaveItem = tmp;
-}
-
-
-void PropertiesPalette::setParStyle(const QString& name)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	bool tmp = HaveItem;
-	HaveItem = false;
-	paraStyleCombo->setFormat(name);
-	HaveItem = tmp;
-}
-
-
-void PropertiesPalette::setCharStyle(const QString& name)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	bool tmp = HaveItem;
-	HaveItem = false;
-	charStyleCombo->setFormat(name);
-	HaveItem = tmp;
-}
-
-void PropertiesPalette::setOpticalMargins()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	int omt(ParagraphStyle::OM_None);
-	if (optMarginRadioBoth->isChecked())
-		omt =ParagraphStyle::OM_Default;
-	else if (optMarginRadioLeft->isChecked())
-		omt = ParagraphStyle::OM_LeftHangingPunct;
-	else if (optMarginRadioRight->isChecked())
-		omt = ParagraphStyle::OM_RightHangingPunct;
-
-	doc->itemSelection_SetOpticalMargins(omt);
-}
-
-void PropertiesPalette::resetOpticalMargins()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	doc->itemSelection_resetOpticalMargins();
-}
-
-void PropertiesPalette::updateOpticalMargins(const ParagraphStyle & pStyle)
-{
-	
-	ParagraphStyle::OpticalMarginType omt(static_cast<ParagraphStyle::OpticalMarginType>(pStyle.opticalMargins()));
-	if (omt == ParagraphStyle::OM_Default)
-		optMarginRadioBoth->setChecked(true);
-	else if (omt == ParagraphStyle::OM_LeftHangingPunct)
-		optMarginRadioLeft->setChecked(true);
-	else if (omt == ParagraphStyle::OM_RightHangingPunct)
-		optMarginRadioRight->setChecked(true);
-	else
-		optMarginRadioNone->setChecked(true);
-}
-
-void PropertiesPalette::setMinWordTracking()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	ParagraphStyle newStyle;
-	newStyle.setMinWordTracking(minWordTrackingSpinBox->value() / 100.0);
-	doc->itemSelection_ApplyParagraphStyle(newStyle);
-}
-
-
-void PropertiesPalette::setNormWordTracking()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	ParagraphStyle newStyle;
-	newStyle.charStyle().setWordTracking(normWordTrackingSpinBox->value() / 100.0);
-	doc->itemSelection_ApplyParagraphStyle(newStyle);
-}
-
-void PropertiesPalette::setMinGlyphExtension()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	ParagraphStyle newStyle;
-	newStyle.setMinGlyphExtension(minGlyphExtSpinBox->value() / 100.0);
-	doc->itemSelection_ApplyParagraphStyle(newStyle);
-}
-
-void PropertiesPalette::setMaxGlyphExtension()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	ParagraphStyle newStyle;
-	newStyle.setMaxGlyphExtension(maxGlyphExtSpinBox->value() / 100.0);
-	doc->itemSelection_ApplyParagraphStyle(newStyle);
-}
-
-
-void PropertiesPalette::setTScaleV(double e)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	bool tmp = HaveItem;
-	HaveItem = false;
-	ChScaleV->setValue(e / 10.0);
-	HaveItem = tmp;
-}
-
-void PropertiesPalette::NewTScaleV()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	doc->itemSelection_SetScaleV(qRound(ChScaleV->value() * 10));
-}
-
-void PropertiesPalette::NewTBase()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	doc->itemSelection_SetBaselineOffset(qRound(ChBase->value() * 10));
-}
-
-void PropertiesPalette::setTScale(double e)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	bool tmp = HaveItem;
-	HaveItem = false;
-	ChScale->setValue(e / 10.0);
-	HaveItem = tmp;
-}
-
-void PropertiesPalette::setTBase(double e)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	bool tmp = HaveItem;
-	HaveItem = false;
-	ChBase->setValue(e / 10.0);
-	HaveItem = tmp;
-}
-
-void PropertiesPalette::NewTScale()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	doc->itemSelection_SetScaleH(qRound(ChScale->value() * 10));
-}
-
-void PropertiesPalette::NewX()
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	if ((HaveDoc) && (HaveItem))
-	{
-		double x,y,w,h, gx, gy, gh, gw, base;
-		QTransform ma;
-		x = Xpos->value() / m_unitRatio;
-		y = Ypos->value() / m_unitRatio;
-		w = Width->value() / m_unitRatio;
-		h = Height->value() / m_unitRatio;
-		base = 0;
-		x += doc->rulerXoffset;
-		y += doc->rulerYoffset;
-		if (doc->guidesPrefs().rulerMode)
-		{
-			x += doc->currentPage()->xOffset();
-			y += doc->currentPage()->yOffset();
-		}
-		if (doc->m_Selection->isMultipleSelection())
-		{
-			doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-			int bp = RotationGroup->checkedId();
-			if ((bp == 0) || (bp == 3))
-				base = gx;
-			else if (bp == 2)
-				base = gx + gw / 2.0;
-			else if ((bp == 1) || (bp == 4))
-				base = gx + gw;
-			if (!_userActionOn)
-				m_ScMW->view->startGroupTransaction();
-			doc->moveGroup(x - base, 0, true);
-			if (!_userActionOn)
-			{
-				m_ScMW->view->endGroupTransaction();
-			}
-			doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-			setXY(gx, gy);
-		}
-		else
-		{
-			if ((CurItem->asLine()) && (LMode))
-			{
-				w += doc->rulerXoffset;
-				h += doc->rulerYoffset;
-				if (doc->guidesPrefs().rulerMode)
-				{
-					w += doc->currentPage()->xOffset();
-					h += doc->currentPage()->yOffset();
-				}
-				double r = atan2(h-y,w-x)*(180.0/M_PI);
-				w = sqrt(pow(w-x,2)+pow(h-y,2));
-				CurItem->setXYPos(x, CurItem->yPos(), true);
-				CurItem->setRotation(r, true);
-				doc->SizeItem(w, CurItem->height(), CurItem, true);
-			}
-			else
-			{
-				ma.translate(CurItem->xPos(), CurItem->yPos());
-				ma.rotate(CurItem->rotation());
-				int bp = RotationGroup->checkedId();
-				if (bp == 0)
-					base = CurItem->xPos();
-				else if (bp == 2)
-					base = ma.m11() * (CurItem->width() / 2.0) + ma.m21() * (CurItem->height() / 2.0) + ma.dx();
-				else if (bp == 1)
-					base = ma.m11() * CurItem->width() + ma.m21() * 0.0 + ma.dx();
-				else if (bp == 4)
-					base = ma.m11() * CurItem->width() + ma.m21() * CurItem->height() + ma.dx();
-				else if (bp == 3)
-					base = ma.m11() * 0.0 + ma.m21() * CurItem->height() + ma.dx();
-				doc->MoveItem(x - base, 0, CurItem, true);
-			}
-		}
-		doc->regionsChanged()->update(QRect());
-		emit DocChanged();
-	}
-}
-
-void PropertiesPalette::NewY()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-
-	double x,y,w,h, gx, gy, gh, gw, base;
-	QTransform ma;
-	x = Xpos->value() / m_unitRatio;
-	y = Ypos->value() / m_unitRatio;
-	w = Width->value() / m_unitRatio;
-	h = Height->value() / m_unitRatio;
-	base = 0;
-	x += doc->rulerXoffset;
-	y += doc->rulerYoffset;
-	if (doc->guidesPrefs().rulerMode)
-	{
-		x += doc->currentPage()->xOffset();
-		y += doc->currentPage()->yOffset();
-	}
-	if (doc->m_Selection->isMultipleSelection())
-	{
-		doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-		int bp = RotationGroup->checkedId();
-		if ((bp == 0) || (bp == 1))
-			base = gy;
-		else if (bp == 2)
-			base = gy + gh / 2.0;
-		else if ((bp == 3) || (bp == 4))
-			base = gy + gh;
-		if (!_userActionOn)
-			m_ScMW->view->startGroupTransaction();
-		doc->moveGroup(0, y - base, true);
-		if (!_userActionOn)
-		{
-			m_ScMW->view->endGroupTransaction();
-		}
-		doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-		setXY(gx, gy);
-	}
-	else
-	{
-		if ((CurItem->asLine()) && (LMode))
-		{
-			w += doc->rulerXoffset;
-			h += doc->rulerYoffset;
-			if (doc->guidesPrefs().rulerMode)
-			{
-				w += doc->currentPage()->xOffset();
-				h += doc->currentPage()->yOffset();
-			}
-			double r = atan2(h-y,w-x)*(180.0/M_PI);
-			w = sqrt(pow(w-x,2)+pow(h-y,2));
-			doc->MoveItem(0, y - CurItem->yPos(), CurItem, true);
-			CurItem->setXYPos(CurItem->xPos(), y, true);
-			CurItem->setRotation(r, true);
-			doc->SizeItem(w, CurItem->height(), CurItem, true);
-			doc->RotateItem(r, CurItem);
-		}
-		else
-		{
-			ma.translate(CurItem->xPos(), CurItem->yPos());
-			ma.rotate(CurItem->rotation());
-			int bp = RotationGroup->checkedId();
-			if (bp == 0)
-				base = CurItem->yPos();
-			else if (bp == 2)
-				base = ma.m22() * (CurItem->height() / 2.0) + ma.m12() * (CurItem->width() / 2.0) + ma.dy();
-			else if (bp == 1)
-				base = ma.m22() * 0.0 + ma.m12() * CurItem->width() + ma.dy();
-			else if (bp == 4)
-				base = ma.m22() * CurItem->height() + ma.m12() * CurItem->width() + ma.dy();
-			else if (bp == 3)
-				base = ma.m22() * CurItem->height() + ma.m12() * 0.0 + ma.dy();
-			doc->MoveItem(0, y - base, CurItem, true);
-		}
-	}
-	doc->regionsChanged()->update(QRect());
-	emit DocChanged();
-}
-
-void PropertiesPalette::NewW()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	
-	double x,y,w,h, gx, gy, gh, gw;
-	x = Xpos->value() / m_unitRatio;
-	y = Ypos->value() / m_unitRatio;
-	w = Width->value() / m_unitRatio;
-	h = Height->value() / m_unitRatio;
-	double oldW = (CurItem->width() != 0.0) ? CurItem->width() : 1.0;
-	double oldH = (CurItem->height() != 0.0) ? CurItem->height() : 1.0;
-	if (doc->m_Selection->isMultipleSelection())
-	{
-		if (!_userActionOn)
-			m_ScMW->view->startGroupTransaction();
-		doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-		if (keepFrameWHRatioButton->isChecked())
-		{
-			doc->scaleGroup(w / gw, w / gw, false);
-			setBH(w, (w / gw) * gh);
-		}
-		else
-		{
-			doc->scaleGroup(w / gw, 1.0, false);
-			doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-			setBH(gw, gh);
-		}
-		if (!_userActionOn)
-		{
-			m_ScMW->view->endGroupTransaction();
-		}
-	}
-	else
-	{
-		bool oldS = CurItem->Sizing;
-		CurItem->Sizing = false;
-		CurItem->OldB2 = CurItem->width();
-		CurItem->OldH2 = CurItem->height();
-		if (CurItem->asLine())
-		{
-			if (LMode)
-			{
-				double r = atan2(h-y,w-x)*(180.0/M_PI);
-				CurItem->setRotation(r, true);
-				w = sqrt(pow(w-x,2)+pow(h-y,2));
-			}
-			doc->SizeItem(w, CurItem->height(), CurItem, true, true, false);
-		}
-		else
-		{
-			if (CurItem->isTableItem)
-			{
-				int rmo = doc->RotMode();
-				doc->RotMode ( 0 );
-				double dist = w - CurItem->width();
-				PageItem* bb2;
-				PageItem* bb = CurItem;
-				while (bb->TopLink != 0)
-				{
-					bb = bb->TopLink;
-				}
-				while (bb->BottomLink != 0)
-				{
-					bb2 = bb;
-					while (bb2->RightLink != 0)
-					{
-						doc->MoveRotated(bb2->RightLink, FPoint(dist, 0), true);
-						bb2 = bb2->RightLink;
-					}
-					doc->MoveSizeItem(FPoint(0, 0), FPoint(-dist, 0), bb, true);
-					bb = bb->BottomLink;
-				}
-				bb2 = bb;
-				while (bb2->RightLink != 0)
-				{
-					doc->MoveRotated(bb2->RightLink, FPoint(dist, 0), true);
-					bb2 = bb2->RightLink;
-				}
-				doc->MoveSizeItem(FPoint(0, 0), FPoint(-dist, 0), bb, true);
-				doc->RotMode ( rmo );
-				if (keepFrameWHRatioButton->isChecked())
-				{
-					keepFrameWHRatioButton->setChecked(false);
-					setBH(w, (w / oldW) * CurItem->height());
-					NewH();
-					keepFrameWHRatioButton->setChecked(true);
-				}
-			}
-			else
-			{
-				if (keepFrameWHRatioButton->isChecked())
-				{
-					setBH(w, (w / oldW) * CurItem->height());
-					doc->SizeItem(w, (w / oldW) * CurItem->height(), CurItem, true, true, false);
-				}
-				else
-					doc->SizeItem(w, CurItem->height(), CurItem, true, true, false);
-			}
-		}
-		if (CurItem->isArc())
-		{
-			double dw = w - oldW;
-			double dh = h - oldH;
-			PageItem_Arc* item = CurItem->asArc();
-			double dsch = item->arcHeight / oldH;
-			double dscw = item->arcWidth / oldW;
-			item->arcWidth += dw * dscw;
-			item->arcHeight += dh * dsch;
-			item->recalcPath();
-			FPoint tp2(getMinClipF(&CurItem->PoLine));
-			CurItem->PoLine.translate(-tp2.x(), -tp2.y());
-			doc->AdjustItemSize(CurItem);
-		}
-		if (CurItem->isSpiral())
-		{
-			PageItem_Spiral* item = CurItem->asSpiral();
-			item->recalcPath();
-		}
-		if (CurItem->isArc() || CurItem->isRegularPolygon() || CurItem->isSpiral())
-			emit updateEditItem();
-		CurItem->Sizing = oldS;
-	}
-	emit DocChanged();
-	doc->regionsChanged()->update(QRect());
-}
-
-void PropertiesPalette::NewH()
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	if ((HaveDoc) && (HaveItem))
-	{
-		double oldW = (CurItem->width() != 0.0) ? CurItem->width() : 1.0;
-		double oldH = (CurItem->height() != 0.0) ? CurItem->height() : 1.0;
-		double x,y,w,h, gx, gy, gh, gw;
-		x = Xpos->value() / m_unitRatio;
-		y = Ypos->value() / m_unitRatio;
-		w = Width->value() / m_unitRatio;
-		h = Height->value() / m_unitRatio;
-		if (doc->m_Selection->isMultipleSelection())
-		{
-			if (!_userActionOn)
-				m_ScMW->view->startGroupTransaction();
-			doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-			if (keepFrameWHRatioButton->isChecked())
-			{
-				doc->scaleGroup(h / gh, h / gh, false);
-				setBH((h / gh) * gw, h);
-			}
-			else
-			{
-				doc->scaleGroup(1.0, h / gh, false);
-				doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-				setBH(gw, gh);
-			}
-			if (!_userActionOn)
-			{
-				m_ScMW->view->endGroupTransaction();
-			}
-		}
-		else
-		{
-			bool oldS = CurItem->Sizing;
-			CurItem->Sizing = false;
-			CurItem->OldB2 = CurItem->width();
-			CurItem->OldH2 = CurItem->height();
-			if (CurItem->asLine())
-			{
-				if (LMode)
-				{
-					double r = atan2(h-y,w-x)*(180.0/M_PI);
-					CurItem->setRotation(r, true);
-					w = sqrt(pow(w-x,2)+pow(h-y,2));
-				}
-				doc->SizeItem(w, CurItem->height(), CurItem, true, true, false);
-			}
-			else
-			{
-				if (CurItem->isTableItem)
-				{
-					int rmo = doc->RotMode();
-					doc->RotMode ( 0 );
-					double dist = h - CurItem->height();
-					PageItem* bb2;
-					PageItem* bb = CurItem;
-					while (bb->LeftLink != 0)
-					{
-						bb = bb->LeftLink;
-					}
-					while (bb->RightLink != 0)
-					{
-						bb2 = bb;
-						while (bb2->BottomLink != 0)
-						{
-							doc->MoveRotated(bb2->BottomLink, FPoint(0, dist), true);
-							bb2 = bb2->BottomLink;
-						}
-						doc->MoveSizeItem(FPoint(0, 0), FPoint(0, -dist), bb, true);
-						bb = bb->RightLink;
-					}
-					bb2 = bb;
-					while (bb2->BottomLink != 0)
-					{
-						doc->MoveRotated(bb2->BottomLink, FPoint(0, dist), true);
-						bb2 = bb2->BottomLink;
-					}
-					doc->MoveSizeItem(FPoint(0, 0), FPoint(0, -dist), bb, true);
-					doc->RotMode ( rmo );
-					if (keepFrameWHRatioButton->isChecked())
-					{
-						keepFrameWHRatioButton->setChecked(false);
-						setBH((h / oldH) * CurItem->width(), h);
-						NewW();
-						keepFrameWHRatioButton->setChecked(true);
-					}
-				}
-				else
-				{
-					if (keepFrameWHRatioButton->isChecked())
-					{
-						setBH((h / oldH) * CurItem->width(), h);
-						doc->SizeItem((h / oldH) * CurItem->width(), h, CurItem, true, true, false);
-					}
-					else
-						doc->SizeItem(CurItem->width(), h, CurItem, true, true, false);
-				}
-			}
-			CurItem->Sizing = oldS;
-		}
-		if (CurItem->isArc())
-		{
-			double dw = w - oldW;
-			double dh = h - oldH;
-			PageItem_Arc* item = CurItem->asArc();
-			double dsch = item->arcHeight / oldH;
-			double dscw = item->arcWidth / oldW;
-			item->arcWidth += dw * dscw;
-			item->arcHeight += dh * dsch;
-			item->recalcPath();
-			FPoint tp2(getMinClipF(&CurItem->PoLine));
-			CurItem->PoLine.translate(-tp2.x(), -tp2.y());
-			doc->AdjustItemSize(CurItem);
-		}
-		if (CurItem->isSpiral())
-		{
-			PageItem_Spiral* item = CurItem->asSpiral();
-			item->recalcPath();
-		}
-		if (CurItem->isArc() || CurItem->isRegularPolygon() || CurItem->isSpiral())
-			emit updateEditItem();
-		emit DocChanged();
-		doc->regionsChanged()->update(QRect());
-	}
-}
-
-void PropertiesPalette::setRotation()
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	double gx, gy, gh, gw;
-	if ((HaveDoc) && (HaveItem))
-	{
-		if (!_userActionOn)
-			m_ScMW->view->startGroupTransaction(Um::Rotate, "", Um::IRotate);
-		if (doc->m_Selection->isMultipleSelection())
-		{
-			doc->rotateGroup((Rotation->value() - RoVal)*(-1), m_ScMW->view->RCenter);
-			doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-			setXY(gx, gy);
-		}
-		else
-			doc->RotateItem(Rotation->value()*(-1), CurItem);
-		if (!_userActionOn)
-		{
-			for (int i = 0; i < doc->m_Selection->count(); ++i)
-				doc->m_Selection->itemAt(i)->checkChanges(true);
-			m_ScMW->view->endGroupTransaction();
-		}
-		emit DocChanged();
-		doc->regionsChanged()->update(QRect());
-		RoVal = Rotation->value();
-	}
-}
-
-void PropertiesPalette::NewCornerRadius()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	CurItem->setCornerRadius(RoundRect->value() / m_unitRatio);
-	m_ScMW->view->SetFrameRounded();
-	emit DocChanged();
-	doc->regionsChanged()->update(QRect());
-}
-
-void PropertiesPalette::NewLineSpacing()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	doc->itemSelection_SetLineSpacing(LineSp->value());
-}
-
-void PropertiesPalette::HandleGapSwitch()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	setCols(CurItem->Cols, CurItem->ColGap);
-	dGap->setToolTip("");
-	if (colgapLabel->currentIndex() == 0)
-		dGap->setToolTip( tr( "Distance between columns" ) );
-	else
-		dGap->setToolTip( tr( "Column width" ) );
-}
-
-void PropertiesPalette::NewCols()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	CurItem->Cols = DCol->value();
-	setCols(CurItem->Cols, CurItem->ColGap);
-	CurItem->update();
-	if (DCol->value() == 1)
-	{
-		dGap->setEnabled(false);
-		colgapLabel->setEnabled(false);
-	}
-	else
-	{
-		dGap->setEnabled(true);
-		colgapLabel->setEnabled(true);
-	}
-	emit DocChanged();
-}
-
-void PropertiesPalette::NewPage()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	bool reallynew = (CurItem->pixm.imgInfo.actualPageNumber != imagePageNumber->value());
-	CurItem->pixm.imgInfo.actualPageNumber = imagePageNumber->value();
-	if (reallynew)
-		CurItem->loadImage(CurItem->externalFile(), true);
-	CurItem->update();
-}
-
-void PropertiesPalette::NewGap()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	if (colgapLabel->currentIndex() == 0)
-		CurItem->ColGap = dGap->value() / m_unitRatio;
-	else
-	{
-		double lineCorr;
-		if ((CurItem->lineColor() != CommonStrings::None) || (!CurItem->strokePattern().isEmpty()))
-			lineCorr = CurItem->lineWidth();
-		else
-			lineCorr = 0;
-		double newWidth = dGap->value() / m_unitRatio;
-		double newGap = qMax(((CurItem->width() - CurItem->textToFrameDistLeft() - CurItem->textToFrameDistRight() - lineCorr) - (newWidth * CurItem->Cols)) / (CurItem->Cols - 1), 0.0);
-		CurItem->ColGap = newGap;
-	}
-	CurItem->update();
-	emit DocChanged();
-}
-
-void PropertiesPalette::NewSize()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	doc->itemSelection_SetFontSize(qRound(Size->value()*10.0));
-}
-
-void PropertiesPalette::NewTracking()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	doc->itemSelection_SetTracking(qRound(Extra->value() * 10.0));
-}
-
-void PropertiesPalette::NewLocalXY()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	doc->itemSelection_SetImageOffset(imageXOffsetSpinBox->value() / m_unitRatio / CurItem->imageXScale(), imageYOffsetSpinBox->value() / m_unitRatio / CurItem->imageYScale());
-}
-
-void PropertiesPalette::NewLocalSC()
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	if ((HaveDoc) && (HaveItem))
-	{
-		//CB Dont pass in the scale to the offset change as its taken from the new scale
-		doc->itemSelection_SetImageScaleAndOffset(imageXScaleSpinBox->value() / 100.0 / CurItem->pixm.imgInfo.xres * 72.0, imageYScaleSpinBox->value() / 100.0 / CurItem->pixm.imgInfo.yres * 72.0, imageXOffsetSpinBox->value() / m_unitRatio, imageYOffsetSpinBox->value() / m_unitRatio);
-		disconnect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
-		disconnect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
-		imgDpiX->setValue(qRound(720.0 / CurItem->imageXScale()) / 10.0);
-		imgDpiY->setValue(qRound(720.0 / CurItem->imageYScale()) / 10.0);
-		connect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
-		connect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
-	}
-}
-
-void PropertiesPalette::NewLocalDpi()
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	if ((HaveDoc) && (HaveItem))
-	{
-		//CB Dont pass in the scale to the offset change as its taken from the new scale
-		doc->itemSelection_SetImageScaleAndOffset(72.0 / imgDpiX->value(), 72.0 / imgDpiY->value(), imageXOffsetSpinBox->value() / m_unitRatio, imageYOffsetSpinBox->value() / m_unitRatio);
-		disconnect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
-		disconnect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
-		imageXScaleSpinBox->setValue(CurItem->imageXScale() * 100 / 72.0 * CurItem->pixm.imgInfo.xres);
-		imageYScaleSpinBox->setValue(CurItem->imageYScale() * 100 / 72.0 * CurItem->pixm.imgInfo.yres);
-		connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
-		connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
-	}
-}
-
-void PropertiesPalette::NewLocalRot()
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	if ((HaveDoc) && (HaveItem))
-		doc->itemSelection_SetImageRotation(360 - imageRotation->value());
-}
-
-void PropertiesPalette::handleImageEffects()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	m_ScMW->ImageEffects();
-}
-
-void PropertiesPalette::handleExtImgProperties()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	m_ScMW->view->editExtendedImageProperties();
-	emit DocChanged();
-}
-
-void PropertiesPalette::NewLineWidth()
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	if ((HaveDoc) && (HaveItem))
-	{
-		double oldL = CurItem->lineWidth();
-		doc->itemSelection_SetLineWidth(LSize->value() / m_unitRatio);
-		if (CurItem->dashes().count() != 0)
-		{
-			if ((oldL != 0.0) && (CurItem->lineWidth() != 0.0))
-			{
-				for (int a = 0; a < CurItem->DashValues.count(); a++)
-				{
-					CurItem->DashValues[a] = CurItem->DashValues[a] / oldL * CurItem->lineWidth();
-				}
-				CurItem->setDashOffset(CurItem->dashOffset() / oldL * CurItem->lineWidth());
-			}
-			if (CurItem->lineWidth() != 0.0)
-			{
-				dashEditor->setDashValues(CurItem->dashes(), CurItem->lineWidth(), CurItem->dashOffset());
-				dashEditor->setEnabled(true);
-			}
-			else
-				dashEditor->setEnabled(false);
-		}
-	}
-}
-
-void PropertiesPalette::setStartArrow(int id)
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	doc->itemSelection_ApplyArrowHead(id,-1);
-}
-
-void PropertiesPalette::setEndArrow(int id)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	if ((HaveDoc) && (HaveItem))
-		doc->itemSelection_ApplyArrowHead(-1, id);
-}
-
-void PropertiesPalette::setStartArrowScale(int sc)
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	doc->itemSelection_ApplyArrowScale(sc, -1, NULL);
-}
-
-void PropertiesPalette::setEndArrowScale(int sc)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	if ((HaveDoc) && (HaveItem))
-		doc->itemSelection_ApplyArrowScale(-1, sc, NULL);
-}
-
-void PropertiesPalette::NewLineStyle()
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	if ((HaveDoc) && (HaveItem))
-	{
-		if (LStyle->currentIndex() == 37)
-		{
-			if (CurItem->dashes().count() == 0)
-			{
-				if ((CurItem->lineStyle() == 0) || (CurItem->lineStyle() == 1))
-				{
-					CurItem->DashValues.append(4.0 * qMax(CurItem->lineWidth(), 1.0));
-					CurItem->DashValues.append(2.0 * qMax(CurItem->lineWidth(), 1.0));
-				}
-				else
-					getDashArray(CurItem->lineStyle(), qMax(CurItem->lineWidth(), 1.0), CurItem->DashValues);
-			}
-			if (CurItem->lineWidth() != 0.0)
-				dashEditor->setDashValues(CurItem->dashes(), CurItem->lineWidth(), CurItem->dashOffset());
-			else
-			{
-				dashEditor->setEnabled(false);
-				dashEditor->setDashValues(CurItem->dashes(), 1.0, CurItem->dashOffset());
-			}
-			dashEditor->show();
-			CurItem->update();
-		}
-		else
-		{
-			CurItem->DashValues.clear();
-			dashEditor->hide();
-			doc->itemSelection_SetLineArt(static_cast<Qt::PenStyle>(LStyle->currentIndex()+1));
-		}
-	}
-}
-
-void PropertiesPalette::dashChange()
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	if ((HaveDoc) && (HaveItem))
-	{
-		if (CurItem->lineWidth() != 0.0)
-		{
-			CurItem->setDashes(dashEditor->getDashValues(CurItem->lineWidth()));
-			CurItem->setDashOffset(dashEditor->Offset->value() * CurItem->lineWidth());
-		}
-		CurItem->update();
-		emit DocChanged();
-	}
-}
-
-void PropertiesPalette::NewLineMode()
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	if (LineMode->currentIndex() == 0)
-	{
-		xposLabel->setText( tr( "&X-Pos:" ) );
-		widthLabel->setText( tr( "&Width:" ) );
-		yposLabel->setText( tr( "&Y-Pos:" ) );
-		heightLabel->setText( tr( "&Height:" ) );
-		Rotation->setEnabled(true);
-		Height->setEnabled(false);
-		LMode = false;
-	}
-	else
-	{
-		xposLabel->setText( tr( "&X1:" ) );
-		widthLabel->setText( tr( "X&2:" ) );
-		yposLabel->setText( tr( "Y&1:" ) );
-		heightLabel->setText( tr( "&Y2:" ) );
-		Rotation->setEnabled(false);
-		Height->setEnabled(true);
-		LMode = true;
-	}
-	setBH(CurItem->width(), CurItem->height());
+	xyzPal->setLineMode(mode);
+	xyzPal->displayWH(m_item->width(), m_item->height());
 	updateGeometry();
 	repaint();
 }
 
-void PropertiesPalette::NewLineJoin()
+void PropertiesPalette::NewAlignement(int a)
+{
+	if (!m_haveDoc || !m_haveItem || !m_ScMW || m_ScMW->scriptIsRunning())
+		return;
+	m_doc->itemSelection_SetAlignment(a);
+}
+
+void PropertiesPalette::handleNewShape(int frameType)
 {
 	if (!m_ScMW || m_ScMW->scriptIsRunning())
 		return;
-	Qt::PenJoinStyle c = Qt::MiterJoin;
-	switch (LJoinStyle->currentIndex())
-	{
-	case 0:
-		c = Qt::MiterJoin;
-		break;
-	case 1:
-		c = Qt::BevelJoin;
-		break;
-	case 2:
-		c = Qt::RoundJoin;
-		break;
-	}
-	if ((HaveDoc) && (HaveItem))
-		doc->itemSelection_SetLineJoin(c);
-}
-
-void PropertiesPalette::NewLineEnd()
+	if ((m_haveDoc) && (m_haveItem))
+	{
+		if ((m_item->itemType() == PageItem::PolyLine) || (m_item->itemType() == PageItem::PathText))
+			return;
+
+		if ((m_item->itemType() == PageItem::ImageFrame) || (m_item->itemType() == PageItem::TextFrame))
+		{
+			shapePal->setRoundRectEnabled(frameType == 0);
+			return;
+		}
+//		m_item->convertTo(PageItem::Polygon);
+//		newSelection(6);
+		shapePal->setRoundRectEnabled(frameType == 0);
+	}
+}
+
+void PropertiesPalette::NewSpGradient(double x1, double y1, double x2, double y2, double fx, double fy, double sg, double sk, double cx, double cy)
 {
 	if (!m_ScMW || m_ScMW->scriptIsRunning())
 		return;
-	Qt::PenCapStyle c = Qt::FlatCap;
-	switch (LEndStyle->currentIndex())
-	{
-	case 0:
-		c = Qt::FlatCap;
-		break;
-	case 1:
-		c = Qt::SquareCap;
-		break;
-	case 2:
-		c = Qt::RoundCap;
-		break;
-	}
-	if ((HaveDoc) && (HaveItem))
-		doc->itemSelection_SetLineEnd(c);
-}
-
-void PropertiesPalette::ToggleKette()
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	disconnect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
-	disconnect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
-	if (keepImageWHRatioButton->isChecked())
-	{
-		imageYScaleSpinBox->setValue(imageXScaleSpinBox->value());
-		NewLocalSC();
-		keepImageDPIRatioButton->setChecked(true);
-	}
-	else
-		keepImageDPIRatioButton->setChecked(false);
-	connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
-	connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
-}
-
-void PropertiesPalette::HChange()
-{
-	disconnect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
-	disconnect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
-	if (keepImageWHRatioButton->isChecked())
-		imageYScaleSpinBox->setValue(imageXScaleSpinBox->value());
-	NewLocalSC();
-	connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
-	connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
-}
-
-void PropertiesPalette::VChange()
-{
-	disconnect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
-	disconnect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
-	if (keepImageWHRatioButton->isChecked())
-		imageXScaleSpinBox->setValue(imageYScaleSpinBox->value());
-	NewLocalSC();
-	connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
-	connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
-}
-
-void PropertiesPalette::ToggleKetteD()
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	disconnect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
-	disconnect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
-	if (keepImageDPIRatioButton->isChecked())
-	{
-		imgDpiY->setValue(imgDpiX->value());
-		NewLocalDpi();
-		keepImageWHRatioButton->setChecked(true);
-	}
-	else
-		keepImageWHRatioButton->setChecked(false);
-	connect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
-	connect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
-}
-
-void PropertiesPalette::HChangeD()
-{
-	disconnect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
-	disconnect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
-	if (keepImageDPIRatioButton->isChecked())
-		imgDpiY->setValue(imgDpiX->value());
-	NewLocalDpi();
-	connect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
-	connect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
-}
-
-void PropertiesPalette::VChangeD()
-{
-	disconnect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
-	disconnect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
-	if (keepImageDPIRatioButton->isChecked())
-		imgDpiX->setValue(imgDpiY->value());
-	NewLocalDpi();
-	connect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
-	connect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
-}
-
-void PropertiesPalette::NewAlignement(int a)
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	doc->itemSelection_SetAlignment(a);
-}
-
-void PropertiesPalette::setTypeStyle(int s)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	emit NewEffects(s);
-}
-
-void PropertiesPalette::newShadowOffs()
-{
-	if ((HaveDoc) && (HaveItem))
-	{
-		int x = qRound(SeStyle->ShadowVal->Xoffset->value() * 10.0);
-		int y = qRound(SeStyle->ShadowVal->Yoffset->value() * 10.0);
-		doc->itemSelection_SetShadowOffsets(x, y);
-	}
-}
-
-void PropertiesPalette::setShadowOffs(double x, double y)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	disconnect(SeStyle->ShadowVal->Xoffset, SIGNAL(valueChanged(double)), this, SLOT(newShadowOffs()));
-	disconnect(SeStyle->ShadowVal->Yoffset, SIGNAL(valueChanged(double)), this, SLOT(newShadowOffs()));
-	SeStyle->ShadowVal->Xoffset->setValue(x / 10.0);
-	SeStyle->ShadowVal->Yoffset->setValue(y / 10.0);
-	connect(SeStyle->ShadowVal->Xoffset, SIGNAL(valueChanged(double)), this, SLOT(newShadowOffs()));
-	connect(SeStyle->ShadowVal->Yoffset, SIGNAL(valueChanged(double)), this, SLOT(newShadowOffs()));
-}
-
-void PropertiesPalette::newUnderline()
-{
-	if ((HaveDoc) && (HaveItem))
-	{
-		int x = qRound(SeStyle->UnderlineVal->LPos->value() * 10.0);
-		int y = qRound(SeStyle->UnderlineVal->LWidth->value() * 10.0);
-		doc->itemSelection_SetUnderline(x, y);
-	}
-}
-
-void PropertiesPalette::setUnderline(double p, double w)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	disconnect(SeStyle->UnderlineVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(newUnderline()));
-	disconnect(SeStyle->UnderlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newUnderline()));
-	SeStyle->UnderlineVal->LPos->setValue(p / 10.0);
-	SeStyle->UnderlineVal->LWidth->setValue(w / 10.0);
-	connect(SeStyle->UnderlineVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(newUnderline()));
-	connect(SeStyle->UnderlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newUnderline()));
-}
-
-void PropertiesPalette::newStrike()
-{
-	if ((HaveDoc) && (HaveItem))
-	{
-		int x = qRound(SeStyle->StrikeVal->LPos->value() * 10.0);
-		int y = qRound(SeStyle->StrikeVal->LWidth->value() * 10.0);
-		doc->itemSelection_SetStrikethru(x, y);
-	}
-}
-
-void PropertiesPalette::setStrike(double p, double w)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	disconnect(SeStyle->StrikeVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(newStrike()));
-	disconnect(SeStyle->StrikeVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newStrike()));
-	SeStyle->StrikeVal->LPos->setValue(p / 10.0);
-	SeStyle->StrikeVal->LWidth->setValue(w / 10.0);
-	connect(SeStyle->StrikeVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(newStrike()));
-	connect(SeStyle->StrikeVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newStrike()));
-}
-
-void PropertiesPalette::setOutlineW(double x)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	disconnect(SeStyle->OutlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newOutlineW()));
-	SeStyle->OutlineVal->LWidth->setValue(x / 10.0);
-	connect(SeStyle->OutlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newOutlineW()));
-}
-
-void PropertiesPalette::newOutlineW()
-{
-	int x = qRound(SeStyle->OutlineVal->LWidth->value() * 10.0);
-	if ((HaveDoc) && (HaveItem))
-		doc->itemSelection_SetOutlineWidth(x);
-}
-
-void PropertiesPalette::DoLower()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	m_ScMW->view->LowerItem();
-}
-
-void PropertiesPalette::DoRaise()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	m_ScMW->view->RaiseItem();
-}
-
-void PropertiesPalette::DoFront()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	m_ScMW->view->ToFront();
-}
-
-void PropertiesPalette::DoBack()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	m_ScMW->view->ToBack();
-}
-
-void PropertiesPalette::NewRotMode(int m)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	double inX, inY, gx, gy, gh, gw;
-	inX = 0;
-	inY = 0;
-	if ((HaveDoc) && (HaveItem))
-	{
-		HaveItem = false;
-		doc->RotMode ( m );
-		if (doc->m_Selection->isMultipleSelection())
-		{
-			doc->m_Selection->setGroupRect();
-			doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-			if (m == 0)
-			{
-				m_ScMW->view->RCenter = FPoint(gx, gy);
-				inX = gx;
-				inY = gy;
-			}
-			if (m == 1)
-			{
-				m_ScMW->view->RCenter = FPoint(gx+gw, gy);
-				inX = gx+gw;
-				inY = gy;
-			}
-			if (m == 2)
-			{
-				m_ScMW->view->RCenter = FPoint(gx + gw / 2.0, gy + gh / 2.0);
-				inX = gx + gw / 2.0;
-				inY = gy + gh / 2.0;
-			}
-			if (m == 3)
-			{
-				m_ScMW->view->RCenter = FPoint(gx, gy+gh);
-				inX = gx;
-				inY = gy+gh;
-			}
-			if (m == 4)
-			{
-				m_ScMW->view->RCenter = FPoint(gx+gw, gy+gh);
-				inX = gx+gw;
-				inY = gy+gh;
-			}
-			inX -= doc->rulerXoffset;
-			inY -= doc->rulerYoffset;
-			if (doc->guidesPrefs().rulerMode)
-			{
-				inX -= doc->currentPage()->xOffset();
-				inY -= doc->currentPage()->yOffset();
-			}
-			Xpos->setValue(inX*m_unitRatio);
-			Ypos->setValue(inY*m_unitRatio);
-		}
-		else
-		{
-			double b, h, r;
-			QTransform ma;
-			FPoint n;
-			b = CurItem->width();
-			h = CurItem->height();
-			r = CurItem->rotation();
-			ma.translate(CurItem->xPos(), CurItem->yPos());
-			ma.rotate(r);
-			int bp = RotationGroup->checkedId();
-			if (bp == 0)
-				n = FPoint(0.0, 0.0);
-			else if (bp == 1)
-				n = FPoint(b, 0.0);
-			else if (bp == 2)
-				n = FPoint(b / 2.0, h / 2.0);
-			else if (bp == 3)
-				n = FPoint(0.0, h);
-			else if (bp == 4)
-				n = FPoint(b, h);
-			inX = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
-			inY = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
-			inX -= doc->rulerXoffset;
-			inY -= doc->rulerYoffset;
-			if (doc->guidesPrefs().rulerMode)
-			{
-				inX -= doc->currentPage()->xOffset();
-				inY -= doc->currentPage()->yOffset();
-			}
-			Xpos->setValue(inX*m_unitRatio);
-			Ypos->setValue(inY*m_unitRatio);
-		}
-		if (CurItem->itemType() == PageItem::ImageFrame)
-		{
-			if (!FreeScale->isChecked())
-			{
-				CurItem->AdjustPictScale();
-				CurItem->update();
-				disconnect(imageXOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
-				disconnect(imageYOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
-				imageXOffsetSpinBox->setValue(CurItem->imageXOffset() * CurItem->imageXScale() * m_unitRatio);
-				imageYOffsetSpinBox->setValue(CurItem->imageYOffset() * CurItem->imageYScale() * m_unitRatio);
-				connect(imageXOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
-				connect(imageYOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
-				emit DocChanged();
-			}
-		}
-		HaveItem = true;
-	}
-}
-
-void PropertiesPalette::DoFlow()
-{
-	PageItem::TextFlowMode mode = PageItem::TextFlowDisabled;
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	if ((HaveDoc) && (HaveItem))
-	{
-		if (CurItem->isGroup())
-		{
-			if (textFlowDisabled2->isChecked())
-				mode = PageItem::TextFlowDisabled;
-			if (textFlowUsesFrameShape2->isChecked())
-				mode = PageItem::TextFlowUsesFrameShape;
-			if (textFlowUsesBoundingBox2->isChecked())
-				mode = PageItem::TextFlowUsesBoundingBox;
-			if (textFlowUsesContourLine2->isChecked())
-				mode = PageItem::TextFlowUsesContourLine;
-			if (textFlowUsesImageClipping2->isChecked())
-				mode = PageItem::TextFlowUsesImageClipping;
-		}
-		else
-		{
-			if (textFlowDisabled->isChecked())
-				mode = PageItem::TextFlowDisabled;
-			if (textFlowUsesFrameShape->isChecked())
-				mode = PageItem::TextFlowUsesFrameShape;
-			if (textFlowUsesBoundingBox->isChecked())
-				mode = PageItem::TextFlowUsesBoundingBox;
-			if (textFlowUsesContourLine->isChecked())
-				mode = PageItem::TextFlowUsesContourLine;
-			if (textFlowUsesImageClipping->isChecked())
-				mode = PageItem::TextFlowUsesImageClipping;
-		}
-		CurItem->setTextFlowMode(mode);
-		m_ScMW->view->DrawNew();
-		emit DocChanged();
-	}
-}
-
-void PropertiesPalette::MakeIrre(int f, int c, qreal *vals)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	if ((HaveDoc) && (HaveItem))
-	{
-		if ((CurItem->itemType() == PageItem::PolyLine) || (CurItem->itemType() == PageItem::PathText))
-			return;
-
-		if (UndoManager::undoEnabled())
-		{
-			// Store shape info in this form:
-			// CHANGE_SHAPE_TYPE - ID of the undo operation
-			// OLD_FRAME_TYPE - original frame type
-			// NEW_FRAME_TYPE - change of frame type
-			// binary QPair<FPointArray, FPointArray> - .first original shape, .second new shape
-			ItemState<QPair<FPointArray,FPointArray> > *is = new ItemState<QPair<FPointArray,FPointArray> >(Um::ChangeShapeType, "", Um::IBorder);
-			is->set("CHANGE_SHAPE_TYPE", "change_shape_type");
-			is->set("OLD_FRAME_TYPE", CurItem->FrameType);
-			is->set("NEW_FRAME_TYPE", f);
-			// HACK: this is propably Evil Code (TM). I have to find better way...
-			FPointArray newShape;
-			int ix = 0;
-			for (int i = 0; i < c/2; ++i)
-			{
-				double x = CurItem->width() * vals[ix] / 100.0;
-				double y = CurItem->height() * vals[ix+1] / 100.0;
-				newShape.addPoint(x, y);
-				ix += 2;
-			}
-			// HACK: end of hack
-			is->setItem(qMakePair(CurItem->shape(), newShape));
-			UndoManager::instance()->action(CurItem, is);
-		}
-
-		switch (f)
-		{
-		case 0:
-			CurItem->SetRectFrame();
-			doc->setRedrawBounding(CurItem);
-			break;
-		case 1:
-			CurItem->SetOvalFrame();
-			doc->setRedrawBounding(CurItem);
-			break;
-		default:
-			CurItem->SetFrameShape(c, vals);
-			doc->setRedrawBounding(CurItem);
-			CurItem->FrameType = f+2;
-			break;
-		}
-		CurItem->update();
-		emit DocChanged();
-		if ((CurItem->itemType() == PageItem::ImageFrame) || (CurItem->itemType() == PageItem::TextFrame))
-		{
-			RoundRect->setEnabled(f == 0);
-			return;
-		}
-//		CurItem->convertTo(PageItem::Polygon);
-//		NewSel(6);
-		RoundRect->setEnabled(f == 0);
-	}
-}
-
-void PropertiesPalette::handleShapeEdit()
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	if ((HaveDoc) && (HaveItem))
-	{
-		tmpSelection->clear();
-		if (CurItem->asRegularPolygon())
-		{
-			m_ScMW->view->requestMode(modeEditPolygon);
-			RoundRect->setEnabled(false);
-		}
-		else if (CurItem->asArc())
-		{
-			m_ScMW->view->requestMode(modeEditArc);
-			RoundRect->setEnabled(false);
-		}
-		else if (CurItem->asSpiral())
-		{
-			m_ScMW->view->requestMode(modeEditSpiral);
-			RoundRect->setEnabled(false);
-		}
-		else
-		{
-			m_ScMW->view->requestMode(modeEditClip);
-			RoundRect->setEnabled(false);
-		}
-		emit DocChanged();
-	}
-}
-
-void PropertiesPalette::NewTDist()
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	if ((HaveDoc) && (HaveItem))
-	{
-		CurItem->setTextToFrameDist(DLeft->value() / m_unitRatio, DRight->value() / m_unitRatio, DTop->value() / m_unitRatio, DBottom->value() / m_unitRatio);
-		setCols(CurItem->Cols, CurItem->ColGap);
-		CurItem->update();
-		emit DocChanged();
-	}
-}
-
-void PropertiesPalette::NewSpGradient(double x1, double y1, double x2, double y2, double fx, double fy, double sg, double sk, double cx, double cy)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	if ((HaveDoc) && (HaveItem))
+	if ((m_haveDoc) && (m_haveItem))
 	{
 		QRectF upRect;
 		if (m_ScMW->view->editStrokeGradient == 1)
 		{
-			CurItem->GrStrokeStartX = x1 / m_unitRatio;
-			CurItem->GrStrokeStartY = y1 / m_unitRatio;
-			CurItem->GrStrokeEndX = x2 / m_unitRatio;
-			CurItem->GrStrokeEndY = y2 / m_unitRatio;
-			CurItem->GrStrokeFocalX = fx / m_unitRatio;
-			CurItem->GrStrokeFocalY = fy / m_unitRatio;
-			CurItem->GrStrokeScale = sg;
-			CurItem->GrStrokeSkew = sk;
-			if (CurItem->GrTypeStroke == 6)
+			m_item->GrStrokeStartX = x1 / m_unitRatio;
+			m_item->GrStrokeStartY = y1 / m_unitRatio;
+			m_item->GrStrokeEndX = x2 / m_unitRatio;
+			m_item->GrStrokeEndY = y2 / m_unitRatio;
+			m_item->GrStrokeFocalX = fx / m_unitRatio;
+			m_item->GrStrokeFocalY = fy / m_unitRatio;
+			m_item->GrStrokeScale = sg;
+			m_item->GrStrokeSkew = sk;
+			if (m_item->GrTypeStroke == 6)
 			{
-				CurItem->GrStrokeFocalX = CurItem->GrStrokeStartX;
-				CurItem->GrStrokeFocalY = CurItem->GrStrokeStartY;
+				m_item->GrStrokeFocalX = m_item->GrStrokeStartX;
+				m_item->GrStrokeFocalY = m_item->GrStrokeStartY;
 			}
-			CurItem->update();
-			upRect = QRectF(QPointF(CurItem->GrStrokeStartX, CurItem->GrStrokeStartY), QPointF(CurItem->GrStrokeEndX, CurItem->GrStrokeEndY));
-			double radEnd = distance(CurItem->GrStrokeEndX - CurItem->GrStrokeStartX, CurItem->GrStrokeEndY - CurItem->GrStrokeStartY);
-			double rotEnd = xy2Deg(CurItem->GrStrokeEndX - CurItem->GrStrokeStartX, CurItem->GrStrokeEndY - CurItem->GrStrokeStartY);
+			m_item->update();
+			upRect = QRectF(QPointF(m_item->GrStrokeStartX, m_item->GrStrokeStartY), QPointF(m_item->GrStrokeEndX, m_item->GrStrokeEndY));
+			double radEnd = distance(m_item->GrStrokeEndX - m_item->GrStrokeStartX, m_item->GrStrokeEndY - m_item->GrStrokeStartY);
+			double rotEnd = xy2Deg(m_item->GrStrokeEndX - m_item->GrStrokeStartX, m_item->GrStrokeEndY - m_item->GrStrokeStartY);
 			QTransform m;
-			m.translate(CurItem->GrStrokeStartX, CurItem->GrStrokeStartY);
+			m.translate(m_item->GrStrokeStartX, m_item->GrStrokeStartY);
 			m.rotate(rotEnd);
 			m.rotate(-90);
-			m.rotate(CurItem->GrStrokeSkew);
-			m.translate(radEnd * CurItem->GrStrokeScale, 0);
+			m.rotate(m_item->GrStrokeSkew);
+			m.translate(radEnd * m_item->GrStrokeScale, 0);
 			QPointF shP = m.map(QPointF(0,0));
-			upRect = upRect.united(QRectF(shP, QPointF(CurItem->GrStrokeEndX, CurItem->GrStrokeEndY)).normalized());
-			upRect = upRect.united(QRectF(shP, QPointF(CurItem->GrStrokeStartX, CurItem->GrStrokeStartY)).normalized());
+			upRect = upRect.united(QRectF(shP, QPointF(m_item->GrStrokeEndX, m_item->GrStrokeEndY)).normalized());
+			upRect = upRect.united(QRectF(shP, QPointF(m_item->GrStrokeStartX, m_item->GrStrokeStartY)).normalized());
 			upRect |= QRectF(shP, QPointF(0, 0)).normalized();
-			upRect |= QRectF(shP, QPointF(CurItem->width(), CurItem->height())).normalized();
+			upRect |= QRectF(shP, QPointF(m_item->width(), m_item->height())).normalized();
 		}
 		else if (m_ScMW->view->editStrokeGradient == 3)
 		{
-			CurItem->GrControl1 = FPoint(x1 / m_unitRatio, y1 / m_unitRatio);
-			CurItem->GrControl2 = FPoint(x2 / m_unitRatio, y2 / m_unitRatio);
-			CurItem->GrControl3 = FPoint(fx / m_unitRatio, fy / m_unitRatio);
-			CurItem->GrControl4 = FPoint(sg / m_unitRatio, sk / m_unitRatio);
-			CurItem->update();
-			upRect = QRectF(QPointF(-CurItem->width(), -CurItem->height()), QPointF(CurItem->width() * 2, CurItem->height() * 2)).normalized();
+			m_item->GrControl1 = FPoint(x1 / m_unitRatio, y1 / m_unitRatio);
+			m_item->GrControl2 = FPoint(x2 / m_unitRatio, y2 / m_unitRatio);
+			m_item->GrControl3 = FPoint(fx / m_unitRatio, fy / m_unitRatio);
+			m_item->GrControl4 = FPoint(sg / m_unitRatio, sk / m_unitRatio);
+			m_item->update();
+			upRect = QRectF(QPointF(-m_item->width(), -m_item->height()), QPointF(m_item->width() * 2, m_item->height() * 2)).normalized();
 		}
 		else if (m_ScMW->view->editStrokeGradient == 4)
 		{
-			CurItem->GrControl1 = FPoint(x1 / m_unitRatio, y1 / m_unitRatio);
-			CurItem->GrControl2 = FPoint(x2 / m_unitRatio, y2 / m_unitRatio);
-			CurItem->GrControl3 = FPoint(fx / m_unitRatio, fy / m_unitRatio);
-			CurItem->GrControl4 = FPoint(sg / m_unitRatio, sk / m_unitRatio);
-			CurItem->GrControl5 = FPoint(cx / m_unitRatio, cy / m_unitRatio);
-			CurItem->update();
-			upRect = QRectF(QPointF(-CurItem->width(), -CurItem->height()), QPointF(CurItem->width() * 2, CurItem->height() * 2)).normalized();
+			m_item->GrControl1 = FPoint(x1 / m_unitRatio, y1 / m_unitRatio);
+			m_item->GrControl2 = FPoint(x2 / m_unitRatio, y2 / m_unitRatio);
+			m_item->GrControl3 = FPoint(fx / m_unitRatio, fy / m_unitRatio);
+			m_item->GrControl4 = FPoint(sg / m_unitRatio, sk / m_unitRatio);
+			m_item->GrControl5 = FPoint(cx / m_unitRatio, cy / m_unitRatio);
+			m_item->update();
+			upRect = QRectF(QPointF(-m_item->width(), -m_item->height()), QPointF(m_item->width() * 2, m_item->height() * 2)).normalized();
 		}
 		else
 		{
-			CurItem->GrStartX = x1 / m_unitRatio;
-			CurItem->GrStartY = y1 / m_unitRatio;
-			CurItem->GrEndX = x2 / m_unitRatio;
-			CurItem->GrEndY = y2 / m_unitRatio;
-			CurItem->GrFocalX = fx / m_unitRatio;
-			CurItem->GrFocalY = fy / m_unitRatio;
-			CurItem->GrScale = sg;
-			CurItem->GrSkew = sk;
-			if (CurItem->GrTypeStroke == 6)
+			m_item->GrStartX = x1 / m_unitRatio;
+			m_item->GrStartY = y1 / m_unitRatio;
+			m_item->GrEndX = x2 / m_unitRatio;
+			m_item->GrEndY = y2 / m_unitRatio;
+			m_item->GrFocalX = fx / m_unitRatio;
+			m_item->GrFocalY = fy / m_unitRatio;
+			m_item->GrScale = sg;
+			m_item->GrSkew = sk;
+			if (m_item->GrTypeStroke == 6)
 			{
-				CurItem->GrFocalX = CurItem->GrStartX;
-				CurItem->GrFocalY = CurItem->GrStartY;
+				m_item->GrFocalX = m_item->GrStartX;
+				m_item->GrFocalY = m_item->GrStartY;
 			}
-			CurItem->update();
-			upRect = QRectF(QPointF(CurItem->GrStartX, CurItem->GrStartY), QPointF(CurItem->GrEndX, CurItem->GrEndY));
-			double radEnd = distance(CurItem->GrEndX - CurItem->GrStartX, CurItem->GrEndY - CurItem->GrStartY);
-			double rotEnd = xy2Deg(CurItem->GrEndX - CurItem->GrStartX, CurItem->GrEndY - CurItem->GrStartY);
+			m_item->update();
+			upRect = QRectF(QPointF(m_item->GrStartX, m_item->GrStartY), QPointF(m_item->GrEndX, m_item->GrEndY));
+			double radEnd = distance(m_item->GrEndX - m_item->GrStartX, m_item->GrEndY - m_item->GrStartY);
+			double rotEnd = xy2Deg(m_item->GrEndX - m_item->GrStartX, m_item->GrEndY - m_item->GrStartY);
 			QTransform m;
-			m.translate(CurItem->GrStartX, CurItem->GrStartY);
+			m.translate(m_item->GrStartX, m_item->GrStartY);
 			m.rotate(rotEnd);
 			m.rotate(-90);
-			m.rotate(CurItem->GrSkew);
-			m.translate(radEnd * CurItem->GrScale, 0);
+			m.rotate(m_item->GrSkew);
+			m.translate(radEnd * m_item->GrScale, 0);
 			QPointF shP = m.map(QPointF(0,0));
-			upRect |= QRectF(shP, QPointF(CurItem->GrEndX, CurItem->GrEndY)).normalized();
-			upRect |= QRectF(shP, QPointF(CurItem->GrStartX, CurItem->GrStartY)).normalized();
+			upRect |= QRectF(shP, QPointF(m_item->GrEndX, m_item->GrEndY)).normalized();
+			upRect |= QRectF(shP, QPointF(m_item->GrStartX, m_item->GrStartY)).normalized();
 			upRect |= QRectF(shP, QPointF(0, 0)).normalized();
-			upRect |= QRectF(shP, QPointF(CurItem->width(), CurItem->height())).normalized();
-		}
-		upRect.translate(CurItem->xPos(), CurItem->yPos());
-		doc->regionsChanged()->update(upRect.adjusted(-10.0, -10.0, 10.0, 10.0));
+			upRect |= QRectF(shP, QPointF(m_item->width(), m_item->height())).normalized();
+		}
+		upRect.translate(m_item->xPos(), m_item->yPos());
+		m_doc->regionsChanged()->update(upRect.adjusted(-10.0, -10.0, 10.0, 10.0));
 		emit DocChanged();
 	}
 }
@@ -4299,7 +774,7 @@
 {
 	if (!m_ScMW || m_ScMW->scriptIsRunning())
 		return;
-	if ((HaveDoc) && (HaveItem))
+	if ((m_haveDoc) && (m_haveItem))
 	{
 		m_ScMW->view->editStrokeGradient = stroke;
 		if (stroke == 1)
@@ -4321,7 +796,7 @@
 			else
 				m_ScMW->view->requestMode(modeNormal);
 		}
-		m_ScMW->view->RefreshGradient(CurItem);
+		m_ScMW->view->RefreshGradient(m_item);
 	}
 }
 
@@ -4329,39 +804,39 @@
 {
 	if (!m_ScMW || m_ScMW->scriptIsRunning())
 		return;
-	if ((HaveDoc) && (HaveItem))
+	if ((m_haveDoc) && (m_haveItem))
 	{
 		QRectF upRect;
-		CurItem->GrMaskStartX = x1 / m_unitRatio;
-		CurItem->GrMaskStartY = y1 / m_unitRatio;
-		CurItem->GrMaskEndX = x2 / m_unitRatio;
-		CurItem->GrMaskEndY = y2 / m_unitRatio;
-		CurItem->GrMaskFocalX = fx / m_unitRatio;
-		CurItem->GrMaskFocalY = fy / m_unitRatio;
-		CurItem->GrMaskScale = sg;
-		CurItem->GrMaskSkew = sk;
-		if ((CurItem->GrMask == 1) || (CurItem->GrMask == 4))
-		{
-			CurItem->GrMaskFocalX = CurItem->GrMaskStartX;
-			CurItem->GrMaskFocalY = CurItem->GrMaskStartY;
-		}
-		CurItem->update();
-		upRect = QRectF(QPointF(CurItem->GrMaskStartX, CurItem->GrMaskStartY), QPointF(CurItem->GrMaskEndX, CurItem->GrMaskEndY));
-		double radEnd = distance(CurItem->GrMaskEndX - CurItem->GrMaskStartX, CurItem->GrMaskEndY - CurItem->GrMaskStartY);
-		double rotEnd = xy2Deg(CurItem->GrMaskEndX - CurItem->GrMaskStartX, CurItem->GrMaskEndY - CurItem->GrMaskStartY);
+		m_item->GrMaskStartX = x1 / m_unitRatio;
+		m_item->GrMaskStartY = y1 / m_unitRatio;
+		m_item->GrMaskEndX = x2 / m_unitRatio;
+		m_item->GrMaskEndY = y2 / m_unitRatio;
+		m_item->GrMaskFocalX = fx / m_unitRatio;
+		m_item->GrMaskFocalY = fy / m_unitRatio;
+		m_item->GrMaskScale = sg;
+		m_item->GrMaskSkew = sk;
+		if ((m_item->GrMask == 1) || (m_item->GrMask == 4))
+		{
+			m_item->GrMaskFocalX = m_item->GrMaskStartX;
+			m_item->GrMaskFocalY = m_item->GrMaskStartY;
+		}
+		m_item->update();
+		upRect = QRectF(QPointF(m_item->GrMaskStartX, m_item->GrMaskStartY), QPointF(m_item->GrMaskEndX, m_item->GrMaskEndY));
+		double radEnd = distance(m_item->GrMaskEndX - m_item->GrMaskStartX, m_item->GrMaskEndY - m_item->GrMaskStartY);
+		double rotEnd = xy2Deg(m_item->GrMaskEndX - m_item->GrMaskStartX, m_item->GrMaskEndY - m_item->GrMaskStartY);
 		QTransform m;
-		m.translate(CurItem->GrMaskStartX, CurItem->GrMaskStartY);
+		m.translate(m_item->GrMaskStartX, m_item->GrMaskStartY);
 		m.rotate(rotEnd);
 		m.rotate(-90);
-		m.rotate(CurItem->GrMaskSkew);
-		m.translate(radEnd * CurItem->GrMaskScale, 0);
+		m.rotate(m_item->GrMaskSkew);
+		m.translate(radEnd * m_item->GrMaskScale, 0);
 		QPointF shP = m.map(QPointF(0,0));
-		upRect |= QRectF(shP, QPointF(CurItem->GrMaskEndX, CurItem->GrMaskEndY)).normalized();
-		upRect |= QRectF(shP, QPointF(CurItem->GrMaskStartX, CurItem->GrMaskStartY)).normalized();
+		upRect |= QRectF(shP, QPointF(m_item->GrMaskEndX, m_item->GrMaskEndY)).normalized();
+		upRect |= QRectF(shP, QPointF(m_item->GrMaskStartX, m_item->GrMaskStartY)).normalized();
 		upRect |= QRectF(shP, QPointF(0, 0)).normalized();
-		upRect |= QRectF(shP, QPointF(CurItem->width(), CurItem->height())).normalized();
-		upRect.translate(CurItem->xPos(), CurItem->yPos());
-		doc->regionsChanged()->update(upRect.adjusted(-10.0, -10.0, 10.0, 10.0));
+		upRect |= QRectF(shP, QPointF(m_item->width(), m_item->height())).normalized();
+		upRect.translate(m_item->xPos(), m_item->yPos());
+		m_doc->regionsChanged()->update(upRect.adjusted(-10.0, -10.0, 10.0, 10.0));
 		emit DocChanged();
 	}
 }
@@ -4370,7 +845,7 @@
 {
 	if (!m_ScMW || m_ScMW->scriptIsRunning())
 		return;
-	if ((HaveDoc) && (HaveItem))
+	if ((m_haveDoc) && (m_haveItem))
 	{
 		m_ScMW->view->editStrokeGradient = 2;
 		if (Tpal->gradEditButton->isChecked())
@@ -4380,539 +855,26 @@
 	}
 }
 
-void PropertiesPalette::toggleGradientEditMGroup()
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	if ((HaveDoc) && (HaveItem))
-	{
-		m_ScMW->view->editStrokeGradient = 2;
-		if (TpalGroup->gradEditButton->isChecked())
-			m_ScMW->view->requestMode(modeEditGradientVectors);
-		else
-			m_ScMW->view->requestMode(modeNormal);
-	}
-}
-
-void PropertiesPalette::NewTFont(QString c)
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	emit NewFont(c);
-}
-
-void PropertiesPalette::DoRevert()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	bool setter=Revert->isChecked();
-	CurItem->setImageFlippedH(setter);
-	CurItem->setReversed(setter);
-	CurItem->update();
-	emit DocChanged();
-}
-
-
-void PropertiesPalette::doClearCStyle()
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	if (HaveDoc)
-	{
-		doc->itemSelection_EraseCharStyle();
-	}
-}
-
-
-void PropertiesPalette::doClearPStyle()
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	if (HaveDoc)
-	{
-		doc->itemSelection_EraseParagraphStyle();
-		CharStyle emptyCStyle;
-		doc->itemSelection_SetCharStyle(emptyCStyle);
-	}
-}
-
-
-void PropertiesPalette::SetLineFormats(ScribusDoc *dd)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	disconnect(StyledLine, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SetSTline(QListWidgetItem*)));
-	StyledLine->clear();
-	if (dd != 0)
-	{
-		QMap<QString,multiLine>::Iterator it;
-		for (it = dd->MLineStyles.begin(); it != dd->MLineStyles.end(); ++it)
-			StyledLine->addItem( new LineFormatItem(dd, it.value(), it.key()) );
-		StyledLine->sortItems();
-		StyledLine->insertItem( 0, tr("No Style"));
-		if (StyledLine->currentItem())
-			StyledLine->currentItem()->setSelected(false);
-	}
-	connect(StyledLine, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SetSTline(QListWidgetItem*)));
-}
-
-void PropertiesPalette::SetSTline(QListWidgetItem *c)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	if (c == NULL)
-		return;
-	bool setter = (c->listWidget()->currentRow() == 0);
-	doc->itemSelection_SetNamedLineStyle(setter ? QString("") : c->text());
-	LStyle->setEnabled(setter);
-	LSize->setEnabled(setter);
-	LJoinStyle->setEnabled(setter);
-	LEndStyle->setEnabled(setter);
-}
-
 void PropertiesPalette::updateColorList()
 {
-	if (!HaveDoc || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	Cpal->SetColors(doc->PageColors);
-	Cpal->SetPatterns(&doc->docPatterns);
-	Cpal->SetGradients(&doc->docGradients);
-	Tpal->SetColors(doc->PageColors);
-	Tpal->SetPatterns(&doc->docPatterns);
-	Tpal->SetGradients(&doc->docGradients);
-	TpalGroup->SetColors(doc->PageColors);
-	TpalGroup->SetPatterns(&doc->docPatterns);
-	TpalGroup->SetGradients(&doc->docGradients);
-	assert (doc->PageColors.document());
-	TxFill->updateBox(doc->PageColors, ColorCombo::fancyPixmaps, true);
-	TxStroke->updateBox(doc->PageColors, ColorCombo::fancyPixmaps, false);
-	TxFill->view()->setMinimumWidth(TxFill->view()->maximumViewportSize().width() + 24);
-	TxStroke->view()->setMinimumWidth(TxStroke->view()->maximumViewportSize().width() + 24);
-}
-
-void PropertiesPalette::updateCmsList()
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	if (HaveDoc)
-	{
-		if (ScCore->haveCMS() && doc->cmsSettings().CMSinUse)
-			GroupBoxCM->show();
-		else
-		{
-			GroupBoxCM->hide();
-			return;
-		}
-		disconnect(InputP, SIGNAL(activated(const QString&)), this, SLOT(ChangeProfile(const QString&)));
-		disconnect(MonitorI, SIGNAL(activated(int)), this, SLOT(ChangeIntent()));
-		InputP->clear();
-		if (HaveItem)
-		{
-			if (CurItem->pixm.imgInfo.colorspace == ColorSpaceCMYK)
-			{
-				ProfilesL::Iterator itP;
-				ProfilesL::Iterator itPend=ScCore->InputProfilesCMYK.end();
-				for (itP = ScCore->InputProfilesCMYK.begin(); itP != itPend; ++itP)
-				{
-					InputP->addItem(itP.key());
-					if (itP.key() == CurItem->IProfile)
-						InputP->setCurrentIndex(InputP->count()-1);
-				}
-				if (!ScCore->InputProfilesCMYK.contains(CurItem->IProfile))
-				{
-					InputP->addItem(CurItem->IProfile);
-					InputP->setCurrentIndex(InputP->count()-1);
-				}
-				else
-				{
-					if (!CurItem->EmProfile.isEmpty())
-						InputP->addItem(CurItem->EmProfile);
-				}
-			}
-			else
-			{
-				ProfilesL::Iterator itP;
-				ProfilesL::Iterator itPend=ScCore->InputProfiles.end();
-				for (itP = ScCore->InputProfiles.begin(); itP != itPend; ++itP)
-				{
-					InputP->addItem(itP.key());
-					if (itP.key() == CurItem->IProfile)
-						InputP->setCurrentIndex(InputP->count()-1);
-				}
-				if (!ScCore->InputProfiles.contains(CurItem->IProfile))
-				{
-					InputP->addItem(CurItem->IProfile);
-					InputP->setCurrentIndex(InputP->count()-1);
-				}
-				else
-				{
-					if (!CurItem->EmProfile.isEmpty())
-						InputP->addItem(CurItem->EmProfile);
-				}
-			}
-			MonitorI->setCurrentIndex(CurItem->IRender);
-		}
-		connect(MonitorI, SIGNAL(activated(int)), this, SLOT(ChangeIntent()));
-		connect(InputP, SIGNAL(activated(const QString&)), this, SLOT(ChangeProfile(const QString&)));
-	}
-}
-
-void PropertiesPalette::ChangeProfile(const QString& prn)
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	doc->itemSelection_SetColorProfile(InputP->currentText());
-}
-
-void PropertiesPalette::ChangeIntent()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	doc->itemSelection_SetRenderIntent(MonitorI->currentIndex());
-}
- 
-void PropertiesPalette::ChangeCompressionMethod()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	doc->itemSelection_SetCompressionMethod(CompressionMethod->currentIndex() - 1);
-}
-
-void PropertiesPalette::ChangeCompressionQuality()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	doc->itemSelection_SetCompressionQuality(CompressionQuality->currentIndex() - 1);
-}
-
-void PropertiesPalette::ShowCMS()
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	if (HaveItem)
-		updateCmsList();
-	else
-		GroupBoxCM->setVisible(ScCore->haveCMS() && doc->cmsSettings().CMSinUse);
-}
-
-void PropertiesPalette::newTxtFill()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	doc->itemSelection_SetFillColor(TxFill->currentColor());
-}
-
-void PropertiesPalette::newTxtStroke()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	doc->itemSelection_SetStrokeColor(TxStroke->currentColor());
-}
-
-void PropertiesPalette::setActShade()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	int b;
-	if (PM1 == sender())
-	{
-		b = PM1->getValue();
-		doc->itemSelection_SetStrokeShade(b);
-	}
-	else
-	{
-		b = PM2->getValue();
-		doc->itemSelection_SetFillShade(b);
-	}
-}
-
-void PropertiesPalette::setActFarben(QString p, QString b, double shp, double shb)
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	ColorList::Iterator it;
-	int c = 0;
-	PM2->setValue(qRound(shb));
-	PM1->setValue(qRound(shp));
-	if ((b != CommonStrings::None) && (!b.isEmpty()))
-	{
-		c++;
-		for (it = doc->PageColors.begin(); it != doc->PageColors.end(); ++it)
-		{
-			if (it.key() == b)
-				break;
-			c++;
-		}
-	}
-	TxFill->setCurrentIndex(c);
-	c = 0;
-	if ((p != CommonStrings::None) && (!p.isEmpty()))
-	{
-		for (it = doc->PageColors.begin(); it != doc->PageColors.end(); ++it)
-		{
-			if (it.key() == p)
-				break;
-			c++;
-		}
-	}
-	TxStroke->setCurrentIndex(c);
-}
-
-void PropertiesPalette::handleLock()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	m_ScMW->scrActions["itemLock"]->toggle();
-}
-
-void PropertiesPalette::handleLockSize()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	m_ScMW->scrActions["itemLockSize"]->toggle();
-}
-
-void PropertiesPalette::handlePrint()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	m_ScMW->scrActions["itemPrintingEnabled"]->toggle();
-}
-
-void PropertiesPalette::handleFlipH()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	m_ScMW->scrActions["itemFlipH"]->toggle();
-}
-
-void PropertiesPalette::handleFlipV()
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	m_ScMW->scrActions["itemFlipV"]->toggle();
-}
-
-
-void PropertiesPalette::handlePathType()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	CurItem->textPathType = pathTextType->currentIndex();
-	CurItem->update();
-	emit DocChanged();
-}
-
-void PropertiesPalette::handlePathFlip()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	CurItem->textPathFlipped = flippedPathText->isChecked();
-	CurItem->updatePolyClip();
-	CurItem->update();
-	emit DocChanged();
-}
-
-void PropertiesPalette::handlePathLine()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	CurItem->PoShow = showcurveCheckBox->isChecked();
-	CurItem->update();
-	emit DocChanged();
-}
-
-void PropertiesPalette::handlePathDist()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	CurItem->setTextToFrameDistLeft(Dist->value());
-	doc->AdjustItemSize(CurItem);
-	CurItem->updatePolyClip();
-	CurItem->update();
-	emit DocChanged();
-}
-
-void PropertiesPalette::handlePathOffs()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	CurItem->BaseOffs = -LineW->value();
-	doc->AdjustItemSize(CurItem);
-	CurItem->updatePolyClip();
-	CurItem->update();
-	emit DocChanged();
-}
-
-void PropertiesPalette::handleFillRule()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	CurItem->fillRule = EvenOdd->isChecked();
-	CurItem->update();
-	emit DocChanged();
-}
-
-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);
-}
-
-void PropertiesPalette::NewName()
-{
-	if (m_ScMW->scriptIsRunning() || !HaveDoc || !HaveItem)
-		return;
-	QString NameOld = CurItem->itemName();
-	QString NameNew = NameEdit->text();
-	if (NameNew.isEmpty())
-	{
-		NameEdit->setText(NameOld);
-		return;
-	}
-	bool found = false;
-	QList<PageItem*> allItems;
-	for (int a = 0; a < doc->Items->count(); ++a)
-	{
-		PageItem *currItem = doc->Items->at(a);
-		if (currItem->isGroup())
-			allItems = currItem->getItemList();
-		else
-			allItems.append(currItem);
-		for (int ii = 0; ii < allItems.count(); ii++)
-		{
-			PageItem* item = allItems.at(ii);
-			if ((NameNew == item->itemName()) && (item != CurItem))
-			{
-				found = true;
-				break;
-			}
-		}
-		allItems.clear();
-	}
-	if (found)
-	{
-		QMessageBox::warning(this, CommonStrings::trWarning, "<qt>"+ tr("Name \"%1\" isn't unique.<br/>Please choose another.").arg(NameNew)+"</qt>", CommonStrings::tr_OK);
-		NameEdit->setText(NameOld);
-		NameEdit->setFocus();
-	}
-	else
-	{
-		if (CurItem->itemName() != NameEdit->text())
-		{
-			CurItem->setItemName(NameEdit->text());
-			emit DocChanged();
-		}
-	}
-}
-
-void PropertiesPalette::fillLangCombo(QMap<QString,QString> langMap)
-{
-	QStringList sortList;
-	QMap<QString,QString>::Iterator it;
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	langCombo->clear();
-	for (it = langMap.begin(); it != langMap.end(); ++it)
-		sortList.push_back(it.value());
-	langCombo->addItems(sortQStringList(sortList));
-	QListView *tmpView = dynamic_cast<QListView*>(langCombo->view()); Q_ASSERT(tmpView);
-	int tmpWidth = tmpView->sizeHintForColumn(0);
-	if (tmpWidth > 0)
-		tmpView->setMinimumWidth(tmpWidth + 24);
-}
-
-void PropertiesPalette::NewLanguage()
-{
-	if ((HaveDoc) && (HaveItem))
-	{
-		CurItem->doc()->setHyphLanguage(m_ScMW->GetLang(langCombo->currentText()));
-		emit DocChanged();
-	}
-}
-
-void PropertiesPalette::ManageTabs()
-{
-	if ((HaveDoc) && (HaveItem))
-	{
-		PageItem_TextFrame *i2=CurItem->asTextFrame();
-		if (i2==0)
-			return;
-		const ParagraphStyle& style(doc->appMode == modeEdit ? i2->currentStyle() : i2->itemText.defaultStyle());
-		TabManager *dia = new TabManager(this, doc->unitIndex(), style.tabValues(), i2->columnWidth());
-		if (dia->exec())
-		{
-			if (doc->appMode != modeEdit)
-			{
-				ParagraphStyle newStyle(CurItem->itemText.defaultStyle());
-				newStyle.setTabValues(dia->tmpTab);
-				CurItem->itemText.setDefaultStyle(newStyle);
-			}
-			else
-			{
-				ParagraphStyle newStyle;
-				newStyle.setTabValues(dia->tmpTab);
-				doc->itemSelection_ApplyParagraphStyle(newStyle);
-			}
-			CurItem->update();
-			emit DocChanged();
-		}
-		delete dia;
-	}
-}
-
-void PropertiesPalette::HandleTLines()
-{
-	if ((HaveDoc) && (HaveItem))
-	{
-		CurItem->TopLine = TopLine->isChecked();
-		CurItem->LeftLine = LeftLine->isChecked();
-		CurItem->RightLine = RightLine->isChecked();
-		CurItem->BottomLine = BottomLine->isChecked();
-		CurItem->update();
-		emit DocChanged();
-	}
-}
-
-void PropertiesPalette::installSniffer(ScrSpinBox *spinBox)
-{
-	const QList<QObject*> list = spinBox->children();
-	if (!list.isEmpty())
-	{
-		QListIterator<QObject*> it(list);
-		QObject *obj;
-		while (it.hasNext())
-		{
-			obj = it.next();
-			obj->installEventFilter(userActionSniffer);
-		}
-	}
+	if (!m_haveDoc || !m_ScMW || m_ScMW->scriptIsRunning())
+		return;
+
+	groupPal->updateColorList();
+	textPal->updateColorList();
+
+	Cpal->updateColorList();
+	Tpal->updateColorList();
+
+	assert (m_doc->PageColors.document());
 }
 
 bool PropertiesPalette::userActionOn()
 {
-	return _userActionOn;
-}
-
-void PropertiesPalette::spinboxStartUserAction()
-{
-	_userActionOn = true;
-}
-
-void PropertiesPalette::spinboxFinishUserAction()
-{
-	_userActionOn = false;
-
-	for (int i = 0; i < doc->m_Selection->count(); ++i)
-		doc->m_Selection->itemAt(i)->checkChanges(true);
-	if (m_ScMW->view->groupTransactionStarted())
-	{
-		m_ScMW->view->endGroupTransaction();
-	}
+	bool userActionOn = false;
+	userActionOn  = xyzPal->userActionOn();
+	userActionOn |= imagePal->userActionOn();
+	return userActionOn;
 }
 
 void PropertiesPalette::changeEvent(QEvent *e)
@@ -4920,9 +882,9 @@
 	if (e->type() == QEvent::LanguageChange)
 	{
 		languageChange();
-	}
-	else
-		QWidget::changeEvent(e);
+		return;
+	}
+	ScDockPalette::changeEvent(e);
 }
 
 void PropertiesPalette::languageChange()
@@ -4938,325 +900,12 @@
 	TabStack->setItemText(idGroupItem, tr("&Group"));
 	TabStack->setItemText(idTransparencyItem, tr("&Transparency"));
 
-	NameGroup->setTitle( tr("Name"));
-	GeoGroup->setTitle( tr("Geometry"));
-	xposLabel->setText( tr("&X-Pos:"));
-	yposLabel->setText( tr("&Y-Pos:"));
-	widthLabel->setText( tr("&Width:"));
-	heightLabel->setText( tr("&Height:"));
-	rotationLabel->setText( tr("&Rotation:"));
-	basepointLabel->setText( tr("Basepoint:"));
-	LayerGroup->setTitle( tr("Level"));
-	SRect->setText( tr("Shape:"));
-	EditShape->setText( tr("&Edit..."));
-	EditShape2->setText( tr("&Edit..."));
-	SRect2->setText( tr("Shape:"));
-	rndcornersLabel->setText( tr("R&ound\nCorners:"));
-	columnsLabel->setText( tr("Colu&mns:"));
-	int oldcolgapLabel = colgapLabel->currentIndex();
-	colgapLabel->clear();
-	colgapLabel->addItem( tr("Gap:"));
-	colgapLabel->addItem( tr("Width:"));
-	colgapLabel->setCurrentIndex(oldcolgapLabel);
-	topLabel->setText( tr("To&p:"));
-	bottomLabel->setText( tr("&Bottom:"));
-	leftLabel->setText( tr("&Left:"));
-	rightLabel->setText( tr("&Right:"));
-	TabsButton->setText( tr("T&abulators..."));
-	int oldPathType = pathTextType->currentIndex();
-	pathTextType->clear();
-	pathTextType->addItem( tr("Default"));
-	pathTextType->addItem( tr("Stair Step"));
-	pathTextType->addItem( tr("Skew"));
-	pathTextType->setCurrentIndex(oldPathType);
-	flippedPathText->setText( tr("Flip Text"));
-	showcurveCheckBox->setText( tr("Show Curve"));
-	pathTextTypeLabel->setText( tr("Type:"));
-	startoffsetLabel->setText( tr("Start Offset:"));
-	distfromcurveLabel->setText( tr("Distance from Curve:"));
-	Distance3->setTitle( tr("Fill Rule"));
-	EvenOdd->setText( tr("Even-Odd"));
-	NonZero->setText( tr("Non Zero"));
-	textFlowOptions->setTitle( tr("Text &Flow Around Frame"));
-	textFlowDisabled->setText( tr("Disabled"));
-	textFlowUsesFrameShape->setText( tr("Use Frame &Shape"));
-	textFlowUsesBoundingBox->setText( tr("Use &Bounding Box"));
-	textFlowUsesContourLine->setText( tr("&Use Contour Line"));
-	textFlowUsesImageClipping->setText( tr("Use Image Clip Path"));
-	textFlowOptions2->setTitle( tr("Text &Flow Around Frame"));
-	textFlowDisabled2->setText( tr("Disabled"));
-	textFlowUsesFrameShape2->setText( tr("Use Frame &Shape"));
-	textFlowUsesBoundingBox2->setText( tr("Use &Bounding Box"));
-	textFlowUsesContourLine2->setText( tr("&Use Contour Line"));
-	textFlowUsesImageClipping2->setText( tr("Use Image Clip Path"));
-	paraStyleLabel->setText( tr("Paragraph St&yle:"));
-	charStyleLabel->setText( tr("Character St&yle:"));
-	optMarginRadioNone->setText( tr("None","optical margins") );
-	optMarginRadioBoth->setText( tr("Both Sides","optical margins") );
-	optMarginRadioLeft->setText( tr("Left Only","optical margins") );
-	optMarginRadioRight->setText( tr("Right Only","optical margins") );
-	optMarginResetButton->setText( tr("Reset") );
-	OptMarginsItem->setText(0, tr("Optical Margins"));
-	wordTrackingLabel->setText( tr("Word Tracking"));
-	minWordTrackingLabel->setText( tr("Min:"));
-	normWordTrackingLabel->setText( tr("Norm:"));
-	glyphExtensionLabel->setText( tr("Glyph Extension"));
-	minGlyphExtensionLabel->setText( tr("Min:"));
-	maxGlyphExtensionLabel->setText( tr("Max:"));
-	colorWidgetsItem->setText(0, tr("Color & Effects"));
-	advancedWidgetsItem->setText(0, tr("Advanced Settings"));
-	styleWidgetsItem->setText(0, tr("Style Settings"));
-	flopItem->setText(0, tr("First Line Offset"));
-	flopRealHeight->setText( tr("Maximum Ascent"));
-	flopFontAscent->setText( tr("Font Ascent"));
-	flopLineSpacing->setText( tr("Line Spacing"));
-	DistanceItem->setText(0, tr("Columns & Text Distances"));
-	Distance2Item->setText(0, tr("Path Text Properties"));
-	imagePageNumberLabel->setText( tr("&Page Number:"));
-	FreeScale->setText( tr("&Free Scaling"));
-	imgDPIXLabel->setText( tr("Actual X-DPI:"));
-	imgDPIYLabel->setText( tr("Actual Y-DPI:"));
-	xposImgLabel->setText( tr("&X-Pos:"));
-	yposImgLabel->setText( tr("&Y-Pos:"));
-	xscaleLabel->setText( tr("X-Sc&ale:"));
-	yscaleLabel->setText( tr("Y-Scal&e:"));
-	imageRotationLabel->setText( tr("Rotation:"));
-	FrameScale->setText( tr("Scale &To Frame Size"));
-	Aspect->setText( tr("P&roportional"));
-	EditEffects->setText( tr("Image Effects"));
-	EditPSDProps->setText( tr("Extended Image Properties"));
-	TextCms1->setText( tr("Input Profile:"));
-	TextCms2->setText( tr("Rendering Intent:"));
-	TextCompressionMethod->setText( tr("PDF Compression Method:"));
-	TextCompressionQuality->setText( tr("PDF Compression Quality:"));
-	int oldLineSpacingMode = lineSpacingModeCombo->currentIndex();
-	lineSpacingModeCombo->clear();
-	lineSpacingModeCombo->addItem( tr("Fixed Linespacing"));
-	lineSpacingModeCombo->addItem( tr("Automatic Linespacing"));
-	lineSpacingModeCombo->addItem( tr("Align to Baseline Grid"));
-	lineSpacingModeCombo->setCurrentIndex(oldLineSpacingMode);
-	int oldMonitorI=MonitorI->currentIndex();
-	MonitorI->clear();
-	MonitorI->addItem( tr("Perceptual"));
-	MonitorI->addItem( tr("Relative Colorimetric"));
-	MonitorI->addItem( tr("Saturation"));
-	MonitorI->addItem( tr("Absolute Colorimetric"));
-	MonitorI->setCurrentIndex(oldMonitorI);
-	int oldCompressionMethod=CompressionMethod->currentIndex();
-	CompressionMethod->clear();
-	CompressionMethod->addItem( tr( "Global" ) );
-	CompressionMethod->addItem( tr( "Automatic" ) );
-	CompressionMethod->addItem( tr( "Lossy - JPEG" ) );
-	CompressionMethod->addItem( tr( "Lossless - Zip" ) );
-	CompressionMethod->addItem( tr( "None" ) );
-	CompressionMethod->setCurrentIndex(oldCompressionMethod);
-	int oldCompressionQuality=CompressionQuality->currentIndex();
-	CompressionQuality->clear();
-	CompressionQuality->addItem( tr( "Global" ) );
-	CompressionQuality->addItem( tr( "Maximum" ) );
-	CompressionQuality->addItem( tr( "High" ) );
-	CompressionQuality->addItem( tr( "Medium" ) );
-	CompressionQuality->addItem( tr( "Low" ) );
-	CompressionQuality->addItem( tr( "Minimum" ) );
-	CompressionQuality->setCurrentIndex(oldCompressionQuality);
-	int oldLineStyle = LStyle->currentIndex();
-	LStyle->clear();
-	LStyle->updateList();
-	LStyle->addItem( tr("Custom"));
-	LStyle->setCurrentIndex(oldLineStyle);
-	int oldLineMode=LineMode->currentIndex();
-	LineMode->clear();
-	LineMode->addItem( tr("Left Point"));
-	LineMode->addItem( tr("End Points"));
-	LineMode->setCurrentIndex(oldLineMode);
-	LineModeT->setText( tr("&Basepoint:"));
-	linetypeLabel->setText( tr("T&ype of Line:"));
-	startArrowText->setText( tr("Start Arrow:"));
-	endArrowText->setText( tr("End Arrow:"));
-	startArrowSpinText->setText( tr("Scaling:"));
-	endArrowSpinText->setText( tr("Scaling:"));
-	if (HaveDoc)
-	{
-		int arrowItem=startArrow->currentIndex();
-		startArrow->rebuildList(&doc->arrowStyles());
-		startArrow->setCurrentIndex(arrowItem);
-		arrowItem=endArrow->currentIndex();
-		endArrow->rebuildList(&doc->arrowStyles());
-		endArrow->setCurrentIndex(arrowItem);
-	}
-	linewidthLabel->setText( tr("Line &Width:"));
-	edgesLabel->setText( tr("Ed&ges:"));
-	int oldLJoinStyle=LJoinStyle->currentIndex();
-	LJoinStyle->clear();
-	LJoinStyle->addItem(loadIcon("16/stroke-join-miter.png"), tr("Miter Join"));
-	LJoinStyle->addItem(loadIcon("16/stroke-join-bevel.png"), tr("Bevel Join"));
-	LJoinStyle->addItem(loadIcon("16/stroke-join-round.png"), tr("Round Join"));
-	LJoinStyle->setCurrentIndex(oldLJoinStyle);
-
-	int oldLEndStyle=LEndStyle->currentIndex();
-	LEndStyle->clear();
-	LEndStyle->addItem(loadIcon("16/stroke-cap-butt.png"), tr("Flat Cap"));
-	LEndStyle->addItem(loadIcon("16/stroke-cap-square.png"), tr("Square Cap"));
-	LEndStyle->addItem(loadIcon("16/stroke-cap-round.png"), tr("Round Cap"));
-	LEndStyle->setCurrentIndex(oldLEndStyle);
-	endingsLabel->setText( tr("&Endings:"));
-
-	TLines->setTitle( tr("Cell Lines"));
-	TopLine->setText( tr("Line at Top"));
-	LeftLine->setText( tr("Line at the Left"));
-	RightLine->setText( tr("Line at the Right "));
-	BottomLine->setText( tr("Line at Bottom"));
-
-	QString pctSuffix=tr(" %");
-	ChBase->setSuffix(pctSuffix);
-	ChScale->setSuffix(pctSuffix);
-	ChScaleV->setSuffix(pctSuffix);
-	imageXScaleSpinBox->setSuffix(pctSuffix);
-	imageYScaleSpinBox->setSuffix(pctSuffix);
-	imgDpiX->setSuffix("");
-	imgDpiY->setSuffix("");
-	Extra->setSuffix(pctSuffix);
-	minWordTrackingSpinBox->setSuffix(pctSuffix);
-	normWordTrackingSpinBox->setSuffix(pctSuffix);
-	minGlyphExtSpinBox->setSuffix(pctSuffix);
-	maxGlyphExtSpinBox->setSuffix(pctSuffix);
-	startArrowScaleSpin->setSuffix(pctSuffix);
-	endArrowScaleSpin->setSuffix(pctSuffix);
-	
-	QString ptSuffix = tr(" pt");
-	Dist->setSuffix(ptSuffix);
-	LineW->setSuffix(ptSuffix);
-	Size->setSuffix(ptSuffix);
-	LineSp->setSuffix(ptSuffix);
-
-	QString ein = (HaveDoc) ? unitGetSuffixFromIndex(doc->unitIndex()) : ptSuffix;
-
-	LSize->setSuffix(ein);
-	LSize->setSpecialValueText( tr("Hairline"));
-	Xpos->setSuffix(ein);
-	Ypos->setSuffix(ein);
-	Width->setSuffix(ein);
-	Height->setSuffix(ein);
-	imageXOffsetSpinBox->setSuffix(ein);
-	imageYOffsetSpinBox->setSuffix(ein);
-	dGap->setSuffix(ein);
-	DLeft->setSuffix(ein);
-	DTop->setSuffix(ein);
-	DBottom->setSuffix(ein);
-	DRight->setSuffix(ein);
-	RoundRect->setSuffix(ein);
-
-	SeStyle->languageChange();
-	GroupAlign->languageChange();
-
-	if(StyledLine->count() > 0)
-		StyledLine->item(0)->setText( tr("No Style") );
-
-	NameEdit->setToolTip( tr("Name of selected object"));
-	Xpos->setToolTip( tr("Horizontal position of current basepoint"));
-	Ypos->setToolTip( tr("Vertical position of current basepoint"));
-	Width->setToolTip( tr("Width"));
-	Height->setToolTip( tr("Height"));
-	Rotation->setToolTip( tr("Rotation of object at current basepoint"));
-	basepointLabel->setToolTip( tr("Point from which measurements or rotation angles are referenced"));
-	DoGroup->setToolTip( tr("Group the selected objects"));
-	DoUnGroup->setToolTip( tr("Ungroup the selected group"));
-	FlipH->setToolTip( tr("Flip Horizontal"));
-	FlipV->setToolTip( tr("Flip Vertical"));
-	Zup->setToolTip( tr("Move one level up"));
-	ZDown->setToolTip( tr("Move one level down"));
-	ZTop->setToolTip( tr("Move to front"));
-	ZBottom->setToolTip( tr("Move to back"));
-	LevelTxt->setToolTip( tr("Indicates the level the object is on, 0 means the object is at the bottom"));
-	Locked->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"));
-	textFlowDisabled->setToolTip( tr("Disable text flow from lower frames around object"));
-	textFlowUsesFrameShape->setToolTip( tr("Use the frame shape for text flow of text frames below the object."));
-	textFlowUsesBoundingBox->setToolTip(  "<qt>" + tr("Use the bounding box, which is always rectangular, instead of the frame's shape for text flow of text frames below the object. ") + "</qt>" );
-	textFlowUsesContourLine->setToolTip(  "<qt>" + tr("When chosen, the contour line can be edited with the Edit Shape Tool on the palette further above. When edited via the shape palette, this becomes a second separate line originally based on the frame's shape for text flow of text frames below the object.") + "</qt>" );
-	textFlowUsesImageClipping->setToolTip(  "<qt>" + tr("Use the clipping path of the image") + "</qt>" );
-	textFlowDisabled2->setToolTip( tr("Disable text flow from lower frames around object"));
-	textFlowUsesFrameShape2->setToolTip( tr("Use the frame shape for text flow of text frames below the object."));
-	textFlowUsesBoundingBox2->setToolTip(  "<qt>" + tr("Use the bounding box, which is always rectangular, instead of the frame's shape for text flow of text frames below the object. ") + "</qt>" );
-	textFlowUsesContourLine2->setToolTip(  "<qt>" + tr("When chosen, the contour line can be edited with the Edit Shape Tool on the palette further above. When edited via the shape palette, this becomes a second separate line originally based on the frame's shape for text flow of text frames below the object.") + "</qt>" );
-	textFlowUsesImageClipping2->setToolTip(  "<qt>" + tr("Use the clipping path of the image") + "</qt>" );
-
-	Size->setToolTip( tr("Font Size"));
-	ChBase->setToolTip( tr("Offset to baseline of characters"));
-	ChScale->setToolTip( tr("Scaling width of characters"));
-	ChScaleV->setToolTip( tr("Scaling height of characters"));
-	TxStroke->setToolTip( "<qt>" + tr("Color of text stroke and/or drop shadow, depending which is chosen.If both are chosen, then they share the same color.") + "</qt>" );
-	TxFill->setToolTip( "<qt>" + tr("Color of selected text. If Outline text decoration is enabled, this color will be the fill color. If Drop Shadow Text is enabled, then this will be the top most color.") + "</qt>" );
-	PM1->setToolTip( tr("Saturation of color of text stroke"));
-	PM2->setToolTip( tr("Saturation of color of text fill"));
-	Revert->setToolTip( tr("Right to Left Writing"));
-	Extra->setToolTip( tr("Manual Tracking"));
-	LineSp->setToolTip( tr("Line Spacing"));
-	lineSpacingModeCombo->setToolTip( tr("Select the line spacing mode.") );
-	paraStyleCombo->setToolTip( tr("Paragraph style of currently selected text or paragraph"));
-	charStyleCombo->setToolTip( tr("Character style of currently selected text or paragraph"));
-	paraStyleClear->setToolTip( tr("Remove Direct Paragraph Formatting"));
-	charStyleClear->setToolTip( tr("Remove Direct Character Formatting"));
-
-	flopRealHeight->setToolTip( "<qt>" + tr("Set the height of the first line of the text frame to use the tallest height of the included characters") + "</qt>" );
-	flopFontAscent->setToolTip( "<qt>" + tr("Set the height of the first line of text frame to use the full ascent of the font(s) in use") + "</qt>" );
-	flopLineSpacing->setToolTip( "<qt>" + tr("Set the height of the first line of the text frame to the specified line height") + "</qt>" );
-
-	minWordTrackingSpinBox->setToolTip( tr("Minimal width of spaces between words"));
-	normWordTrackingSpinBox->setToolTip( tr("Normal width of spaces between words"));
-	minGlyphExtSpinBox->setToolTip( tr("Minimal shrinkage of glyphs for justification"));
-	maxGlyphExtSpinBox->setToolTip( tr("Maximal extension of glyphs for justification"));
-
-	LineMode->setToolTip( tr("Change settings for left or end points"));
-	LStyle->setToolTip( tr("Pattern of line"));
-	LSize->setToolTip( tr("Thickness of line"));
-	LJoinStyle->setToolTip( tr("Type of line joins"));
-	LEndStyle->setToolTip( tr("Type of line end"));
-	StyledLine->setToolTip( tr("Line style of current object"));
-	startArrow->setToolTip( tr("Arrow head style for start of line"));
-	endArrow->setToolTip( tr("Arrow head style for end of line"));
-	startArrowScaleSpin->setToolTip( tr("Arrow head scale for start of line"));
-	endArrowScaleSpin->setToolTip( tr("Arrow head scale for end of line"));
-
-	SCustom->setToolTip( tr("Choose the shape of frame..."));
-	EditShape->setToolTip( tr("Edit shape of the frame..."));
-	RoundRect->setToolTip( tr("Set radius of corner rounding"));
-	DCol->setToolTip( tr("Number of columns in text frame"));
-	colgapLabel->setToolTip( tr("Switches between Gap or Column width"));
-	dGap->setToolTip( tr("Distance between columns"));
-	DTop->setToolTip( tr("Distance of text from top of frame"));
-	DBottom->setToolTip( tr("Distance of text from bottom of frame"));
-	DLeft->setToolTip( tr("Distance of text from left of frame"));
-	DRight->setToolTip( tr("Distance of text from right of frame"));
-	TabsButton->setToolTip( tr("Edit tab settings of text frame..."));
-
-	FreeScale->setToolTip( tr("Allow the image to be a different size to the frame"));
-	imageXOffsetSpinBox->setToolTip( tr("Horizontal offset of image within frame"));
-	imageYOffsetSpinBox->setToolTip( tr("Vertical offset of image within frame"));
-	imageXScaleSpinBox->setToolTip( tr("Resize the image horizontally"));
-	imageYScaleSpinBox->setToolTip( tr("Resize the image vertically"));
-	keepImageWHRatioButton->setToolTip( tr("Keep the X and Y scaling the same"));
-	keepFrameWHRatioButton->setToolTip( tr("Keep the aspect ratio"));
-	FrameScale->setToolTip( tr("Make the image fit within the size of the frame"));
-	imgDpiX->setToolTip( tr("Effective horizontal DPI of the image after scaling"));
-	imgDpiY->setToolTip( tr("Effective vertical DPI of the image after scaling"));
-	Aspect->setToolTip( tr("Use image proportions rather than those of the frame"));
-	InputP->setToolTip( tr("Source profile of the image"));
-	MonitorI->setToolTip( tr("Rendering intent for the image"));
-	CompressionMethod->setToolTip( tr("Compression method used in PDF export for the image"));
-	CompressionQuality->setToolTip( tr("Compression quality used in PDF export for the image"));
-}
-
-
-const VGradient PropertiesPalette::getFillGradient()
-{
-	return Cpal->gradEdit->gradient();
-}
-
-const VGradient PropertiesPalette::getStrokeGradient()
-{
-	return Cpal->gradEditStroke->gradient();
+	xyzPal->languageChange();
+	shapePal->languageChange();
+	groupPal->languageChange();
+	imagePal->languageChange();
+	linePal->languageChange();
+	textPal->languageChange();
 }
 
 const VGradient PropertiesPalette::getMaskGradient()
@@ -5266,7 +915,7 @@
 
 const VGradient PropertiesPalette::getMaskGradientGroup()
 {
-	return TpalGroup->gradEdit->gradient();
+	return groupPal->getMaskGradientGroup();
 }
 
 void PropertiesPalette::setGradientEditMode(bool on)
@@ -5276,12 +925,15 @@
 
 void PropertiesPalette::updateColorSpecialGradient()
 {
-	if (!HaveDoc)
-		return;
-	if(doc->m_Selection->isEmpty())
-		return;
-	double dur=doc->unitRatio();
-	PageItem *currItem=doc->m_Selection->itemAt(0);
+	if (!m_haveDoc)
+		return;
+	if(m_doc->m_Selection->isEmpty())
+		return;
+
+	groupPal->updateColorSpecialGradient();
+
+	double dur=m_doc->unitRatio();
+	PageItem *currItem=m_doc->m_Selection->itemAt(0);
 	if (currItem)
 	{
 		if (m_ScMW->view->editStrokeGradient == 0)
@@ -5296,232 +948,22 @@
 			Cpal->setMeshPoint();
 		else if (m_ScMW->view->editStrokeGradient == 7)
 			Cpal->setMeshControlPoint();
-		else
-		{
-			if (currItem->isGroup())
-				TpalGroup->setSpecialGradient(currItem->GrMaskStartX * dur, currItem->GrMaskStartY * dur, currItem->GrMaskEndX * dur, currItem->GrMaskEndY * dur, currItem->GrMaskFocalX * dur, currItem->GrMaskFocalY * dur, currItem->GrMaskScale, currItem->GrMaskSkew);
-			else
-				Tpal->setSpecialGradient(currItem->GrMaskStartX * dur, currItem->GrMaskStartY * dur, currItem->GrMaskEndX * dur, currItem->GrMaskEndY * dur, currItem->GrMaskFocalX * dur, currItem->GrMaskFocalY * dur, currItem->GrMaskScale, currItem->GrMaskSkew);
-		}
-	}
-}
-
-void PropertiesPalette::updateSpinBoxConstants()
-{
-	if (!HaveDoc)
-		return;
-	if(doc->m_Selection->count()==0)
-		return;
-	Width->setConstants(&doc->constants());
-	Height->setConstants(&doc->constants());
-	Xpos->setConstants(&doc->constants());
-	Ypos->setConstants(&doc->constants());
-
-}
-
-UserActionSniffer::UserActionSniffer(QObject* parent) : QObject (parent)
-{
-
-}
-
-bool UserActionSniffer::eventFilter(QObject*, QEvent *e)
-{
-	if (e->type() == QEvent::MouseButtonPress)
-		emit actionStart();
-	else if (e->type() == QEvent::MouseButtonRelease)
-		emit actionEnd();
-	else if (e->type() == QEvent::KeyPress)
-	{
-		QKeyEvent *k = dynamic_cast<QKeyEvent*>(e);
-		if (k && !k->isAutoRepeat() && (k->key() == Qt::Key_Up || k->key() == Qt::Key_Down))
-			emit actionStart();
-	}
-	else if (e->type() == QEvent::KeyRelease)
-	{
-		QKeyEvent *k = dynamic_cast<QKeyEvent*>(e);
-		if (k && !k->isAutoRepeat() && (k->key() == Qt::Key_Up || k->key() == Qt::Key_Down))
-			emit actionEnd();
-	}
-	return false;
+		else if (!currItem->isGroup())
+			Tpal->setSpecialGradient(currItem->GrMaskStartX * dur, currItem->GrMaskStartY * dur, currItem->GrMaskEndX * dur, currItem->GrMaskEndY * dur, currItem->GrMaskFocalX * dur, currItem->GrMaskFocalY * dur, currItem->GrMaskScale, currItem->GrMaskSkew);
+	}
 }
 
 void PropertiesPalette::setLocked(bool isLocked)
 {
-	Xpos->setReadOnly(isLocked);
-	Ypos->setReadOnly(isLocked);
-	Width->setReadOnly(isLocked);
-	Height->setReadOnly(isLocked);
-	Rotation->setReadOnly(isLocked);
-	QPalette pal(qApp->palette());
-	if (isLocked)
-		pal.setCurrentColorGroup(QPalette::Disabled);
-
-	Xpos->setPalette(pal);
-	Ypos->setPalette(pal);
-	Width->setPalette(pal);
-	Height->setPalette(pal);
-	Rotation->setPalette(pal);
-
-	EditShape->setEnabled(!isLocked);
-	LayerGroup->setEnabled(!isLocked);
-	Locked->setChecked(isLocked);
-	if ((HaveDoc) && (HaveItem))
-	{
-		SCustom->setEnabled(!CurItem->asLine() && !CurItem->asPolyLine() && !CurItem->asSpiral() && !CurItem->asPathText() && !isLocked);
-		if (((CurItem->asTextFrame()) || (CurItem->asImageFrame()) || (CurItem->asPolygon())) &&  (!CurItem->ClipEdited) && ((CurItem->FrameType == 0) || (CurItem->FrameType == 2)))
-			RoundRect->setEnabled(!isLocked);
-		else
-			RoundRect->setEnabled(false);
-	}
-}
-
-void PropertiesPalette::setSizeLocked(bool isSizeLocked)
-{
-	bool b=isSizeLocked;
-	if (HaveItem && CurItem->locked())
-		b=true;
-	Width->setReadOnly(b);
-	Height->setReadOnly(b);
-	QPalette pal(qApp->palette());
-	
-	if (b)
-		pal.setCurrentColorGroup(QPalette::Disabled);
-
-	Width->setPalette(pal);
-	Height->setPalette(pal);
-	NoResize->setChecked(isSizeLocked);
-}
-
-void PropertiesPalette::setPrintingEnabled(bool isPrintingEnabled)
-{
-	NoPrint->setChecked(!isPrintingEnabled);
-}
-
-void PropertiesPalette::setFlippedH(bool isFlippedH)
-{
-	FlipH->setChecked(isFlippedH);
-}
-
-void PropertiesPalette::setFlippedV(bool isFlippedV)
-{
-	FlipV->setChecked(isFlippedV);
-}
-
-void PropertiesPalette::setGroupTransparency(double trans)
-{
-	if ((HaveDoc) && (HaveItem))
-	{
-		CurItem->setFillTransparency(trans);
-		CurItem->update();
-		emit DocChanged();
-	}
-}
-
-void PropertiesPalette::setGroupBlending(int blend)
-{
-	if ((HaveDoc) && (HaveItem))
-	{
-		CurItem->setFillBlendmode(blend);
-		CurItem->update();
-		emit DocChanged();
-	}
-}
-
-void PropertiesPalette::setGroupGradMask(int typ)
-{
-	if ((HaveDoc) && (HaveItem))
-	{
-		CurItem->GrMask = typ;
-		if ((typ > 0) && (typ < 7))
-			CurItem->updateGradientVectors();
-		CurItem->update();
-		emit DocChanged();
-	}
-}
-
-void PropertiesPalette::setGroupPatternMask(QString pattern)
-{
-	if ((HaveDoc) && (HaveItem))
-	{
-		CurItem->setPatternMask(pattern);
-		CurItem->update();
-		emit DocChanged();
-	}
-}
-
-void PropertiesPalette::setGroupPatternMaskProps(double imageScaleX, double imageScaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY, bool mirrorX, bool mirrorY)
-{
-	if ((HaveDoc) && (HaveItem))
-	{
-		CurItem->setMaskTransform(imageScaleX, imageScaleY, offsetX, offsetY, rotation, skewX, skewY);
-		CurItem->setMaskFlip(mirrorX, mirrorY);
-		CurItem->update();
-		emit DocChanged();
-	}
-}
-
-void PropertiesPalette::doGrouping()
-{
-	m_ScMW->GroupObj();
-	DoGroup->setEnabled(false);
-	DoUnGroup->setEnabled(true);
-	setMultipleSelection(true);
-	double gx, gy, gh, gw;
-	doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-	int bp = RotationGroup->checkedId();
-	if (bp == 0)
-		m_ScMW->view->RCenter = FPoint(gx, gy);
-	else if (bp == 1)
-		m_ScMW->view->RCenter = FPoint(gx + gw, gy);
-	else if (bp == 2)
-		m_ScMW->view->RCenter = FPoint(gx + gw / 2.0, gy + gh / 2.0);
-	else if (bp == 3)
-		m_ScMW->view->RCenter = FPoint(gx, gy + gh);
-	else if (bp == 4)
-		m_ScMW->view->RCenter = FPoint(gx + gw, gy + gh);
-	TabStack->setItemEnabled(idShapeItem, false);
-}
-
-void PropertiesPalette::handleShapeEdit2()
+	shapePal->setLocked(isLocked);
+}
+
+void PropertiesPalette::handleShapeEdit()
 {
 	if (!m_ScMW || m_ScMW->scriptIsRunning())
 		return;
-	if ((HaveDoc) && (HaveItem))
-	{
-		tmpSelection->clear();
-		tmpSelection->copy(*doc->m_Selection, true);
-		doc->m_Selection->clear();
-		doc->m_Selection->addItem(CurItem);
-		CurItem->isSingleSel = true;
-		CurItem->update();
-		m_ScMW->view->requestMode(modeEditClip);
-		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();
-	}
-}
-
-void PropertiesPalette::flop(int radioFlop)
-{
-	if (!m_ScMW || m_ScMW->scriptIsRunning() || !HaveDoc || !HaveItem)
-		return;
-	if( radioFlop == 0)
-		CurItem->setFirstLineOffset(FLOPRealGlyphHeight);
-	else if( radioFlop == 1)
-		CurItem->setFirstLineOffset(FLOPFontAscent);
-	else if( radioFlop == 2)
-		CurItem->setFirstLineOffset(FLOPLineSpacing);
-	CurItem->update();
-	emit DocChanged();
-}
+	if ((m_haveDoc) && (m_haveItem))
+	{
+		shapePal->setRoundRectEnabled(false);
+	}
+}

Modified: trunk/Scribus/scribus/ui/propertiespalette.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/ui/propertiespalette.h
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette.h (original)
+++ trunk/Scribus/scribus/ui/propertiespalette.h Sun Apr  3 15:06:46 2011
@@ -4,130 +4,48 @@
 a copyright and/or license notice that predates the release of Scribus 1.3.2
 for which a new license (GPL+exception) is in place.
 */
-#ifndef MPALETTE_H
-#define MPALETTE_H
+#ifndef PROPERTIESPALETTE_H
+#define PROPERTIESPALETTE_H
 
 #include <QListWidgetItem>
 #include <QLineEdit>
 
-class QButtonGroup;
-class QCheckBox;
 class QCloseEvent;
-class QComboBox;
-class QEvent;
 class QEvent;
 class QFocusEvent;
-class QFrame;
-class QGridLayout;
-class QGroupBox;
-class QHBoxLayout;
-class QLabel;
-class QMenu;
-class QPushButton;
-class QRadioButton;
-class QSpinBox;
-class QStackedWidget;
-class QStackedWidget;
 class QToolBox;
 class QVBoxLayout;
 class QWidget;
 
-
 #include "scribusapi.h"
-#include "scrpalettebase.h"
+#include "scdockpalette.h"
+#include "scguardedptr.h"
 #include "scrspinbox.h"
 #include "pageitem.h"
 #include "page.h"
 #include "linkbutton.h"
 #include "linecombo.h"
 #include "spalette.h"
-#include "alignselect.h"
-#include "shadebutton.h"
 #include "sclistboxpixmap.h"
 #include "scguardedptr.h"
 #include "sctreewidget.h"
 
-class StyleSelect;
+class ColorCombo;
+class Cpalette;
+class NameWidget;
+class PropertiesPalette_Group;
+class PropertiesPalette_Image;
+class PropertiesPalette_Line;
+class PropertiesPalette_Shape;
+class PropertiesPalette_Text;
+class PropertiesPalette_XYZ;
+class ScComboBox;
 class ScribusDoc;
-class Cpalette;
+class ScribusMainWindow;
+class Selection;
 class Tpalette;
-class Autoforms;
-class ArrowChooser;
-class ScComboBox;
-class ScribusMainWindow;
-class UserActionSniffer;
-class DashEditor;
-class Selection;
-class BasePointWidget;
-class ColorCombo;
-class FontComboH;
 
-
-struct SCRIBUS_API LineFormatValue
-{
-	multiLine m_Line;
-	ScGuardedPtr<ScribusDoc> m_doc;
-	QString m_name;
-	
-	LineFormatValue();
-	LineFormatValue( const multiLine& line, ScribusDoc* doc, const QString name );
-	LineFormatValue(const LineFormatValue& other);
-	LineFormatValue& operator= (const LineFormatValue& other);
-};
-
-
-Q_DECLARE_METATYPE(LineFormatValue);
-
-
-class SCRIBUS_API LineFormatItem : public QListWidgetItem
-{	
-	enum {
-		LineFormatUserType = UserType + 2
-	} usrtyp;
-	
-public:	
-	LineFormatItem( ScribusDoc* doc, const multiLine& line, const QString& name ) : QListWidgetItem(NULL, LineFormatUserType)
-	{		
-		setText(name);
-		setData(Qt::UserRole, QVariant::fromValue(LineFormatValue(line, doc, name))); 
-	};
-	LineFormatItem( ) : QListWidgetItem(NULL, LineFormatUserType)
-	{		
-		setText("");
-		setData(Qt::UserRole, QVariant::fromValue(LineFormatValue())); 
-	};
-	LineFormatItem * clone () const { return new LineFormatItem(*this); }
-};
-
-
-
-class SCRIBUS_API LineFormatItemDelegate : public ScListBoxPixmap<37, 37>
-{
-public:
-	LineFormatItemDelegate() : ScListBoxPixmap<37, 37>() {}
-	virtual int rtti() const { return 148523874; }
-	virtual QString text(const QVariant&) const;
-	virtual void redraw(const QVariant&) const;
-};
-
-
-
-class SCRIBUS_API NameWidget : public QLineEdit
-{
-	Q_OBJECT
-
-public:
-	NameWidget(QWidget* parent);
-	~NameWidget() {};
-
-signals:
-	void Leaved();
-
-protected:
-	virtual void focusOutEvent(QFocusEvent *);
-};
-
-class SCRIBUS_API PropertiesPalette : public ScrPaletteBase
+class SCRIBUS_API PropertiesPalette : public ScDockPalette
 {
 	Q_OBJECT
 
@@ -139,215 +57,61 @@
 	virtual void closeEvent(QCloseEvent *closeEvent);
 	
 	void updateColorSpecialGradient();
-	const VGradient getFillGradient();
-	const VGradient getStrokeGradient();
 	const VGradient getMaskGradient();
 	const VGradient getMaskGradientGroup();
 	void updateColorList();
 	void setGradientEditMode(bool);
-	void updateCmsList();
 	void setTextFlowMode(PageItem::TextFlowMode mode);
-	void ShowCMS();
-	/*! \brief fills the langs combobox in language specific order
-	\author 10/07/2004 - Petr Vanek - rewritten to fix #1185.
-	Uses sortQStringList from utils.cpp - STL!
-	\param langMap a structure with languages/hyphs*/
-	void fillLangCombo(QMap<QString,QString> langMap);
+
 	/** @brief Returns true if there is a user action going on at the moment of call. */
 	bool userActionOn(); // not yet implemented!!! This is needed badly.
                          // When user releases the mouse button or arrow key, changes must be checked
                          // and if in ScribusView a groupTransaction has been started it must be also
                          // commmited
 
+
+	PropertiesPalette_Group* groupPal;
+	PropertiesPalette_Image* imagePal;
+	PropertiesPalette_Line*  linePal;
+	PropertiesPalette_Shape* shapePal;
+	PropertiesPalette_Text*  textPal;
+	PropertiesPalette_XYZ*   xyzPal;
 	Cpalette *Cpal;
 	Tpalette *Tpal;
-	Tpalette *TpalGroup;
-	Autoforms* SCustom;
-	Autoforms* SCustom2;
-	ParaStyleComboBox *paraStyleCombo;
-	CharStyleComboBox *charStyleCombo;
-	FontComboH* Fonts;
-	ArrowChooser* startArrow;
-	ArrowChooser* endArrow;
-	BasePointWidget* RotationGroup;
-	QGroupBox* textFlowOptions;
-	QGroupBox* textFlowOptions2;
-	QButtonGroup* textFlowOptionsB;
-	QButtonGroup* textFlowOptionsB2;
-	DashEditor* dashEditor;
+
+private:
+
+	PageItem* currentItemFromSelection();
 	
 public slots:
 	void setMainWindow(ScribusMainWindow *mw);
-	void languageChange();
+	
 	void setDoc(ScribusDoc *d);
+	void setCurrentItem(PageItem *i);
 	void unsetDoc();
 	void unsetItem();
-//	void setCurrentItem(PageItem *);
-	void setMultipleSelection(bool);
-	void NewSel(int nr);
-	void SetCurItem(PageItem *i);
+
+	void handleSelectionChanged();
+	
 	void unitChange();
-	void setLevel(uint l);
-	void setXY(double x, double y);
-	void setBH(double x, double y);
-	void setR(double r);
-	void setRR(double r);
-	void setCols(int r, double g);
-// 	void setLspMode(QAction *);
-	void setLineSpacingMode(int id);
-	void setLsp(double r);
-	void setupLineSpacingSpinbox(int mode, double value);
-	void setSize(double s);
-	void setFontFace(const QString&);
-	void setExtra(double e);
-	void setTextToFrameDistances(double left, double top, double bottom, double right);
-	void ChangeScaling();
-	void setImgRotation(double rot);
-	void setScaleAndOffset(double scx, double scy, double x, double y);
-	void setLineWidth(double s);
-	void setLIvalue(Qt::PenStyle p, Qt::PenCapStyle pc, Qt::PenJoinStyle pj);
-	void setFlop(FirstLineOffsetPolicy);
-	/// update TB values:
-	void updateStyle(const ParagraphStyle& newCurrent);
-	void setStil(int s);
-	void setAli(int e);
-	void setParStyle(const QString& name);
-	void setCharStyle(const QString& name);
-	void setOpticalMargins();
-	void resetOpticalMargins();
-	void updateOpticalMargins(const ParagraphStyle& pStyle);
-	void setMinWordTracking();
-	void setNormWordTracking();
-	void setMinGlyphExtension();
-	void setMaxGlyphExtension();
-	void setShadowOffs(double x, double y);
-	void setUnderline(double p, double w);
-	void newUnderline();
-	void setStrike(double p, double w);
-	void newStrike();
-	void setOutlineW(double x);
-	void newOutlineW();
-	void setTScale(double e);
-	void NewTScale();
-	void NewTScaleV();
-	void NewTBase();
-	void setTScaleV(double e);
-	void setTBase(double e);
-	void SetLineFormats(ScribusDoc *dd);
-	void SetSTline(QListWidgetItem *c);
-	void NewTFont(QString);
-	void newTxtFill();
-	void newTxtStroke();
-	void setActShade();
-	void setActFarben(QString p, QString b, double shp, double shb);
-	void ManageTabs();
+	void languageChange();
+
 	void setLocked(bool);
-	void setSizeLocked(bool);
-	void setPrintingEnabled(bool);
-	void setFlippedH(bool);
-	void setFlippedV(bool);
-	void endEdit2();
 
 private slots:
 	void SelTab(int t);
-	void NewX();
-	void NewY();
-	void NewW();
-	void NewH();
-	void setRotation();
-	void NewCornerRadius();
-	void NewLineSpacing();
-	void HandleGapSwitch();
-	void NewCols();
-	void NewGap();
-	void NewSize();
-	void NewTracking();
-	void handleFlipH();
-	void handleFlipV();
-	void NewPage();
-	void ToggleKette();
-	void HChange();
-	void VChange();
-	void ToggleKetteD();
-	void HChangeD();
-	void VChangeD();
-	void NewLocalXY();
-	void NewLocalSC();
-	void NewLocalDpi();
-	void NewLocalRot();
-	void NewLineWidth();
-	void NewLineStyle();
-	void NewLineJoin();
-	void NewLineEnd();
-	void NewLineMode();
+
+	void NewLineMode(int mode);
 	void NewAlignement(int a);
-	void setTypeStyle(int s);
-	void newShadowOffs();
-	void DoLower();
-	void DoRaise();
-	void DoFront();
-	void DoBack();
-	void NewRotMode(int m);
-	void DoFlow();
-	void MakeIrre(int f, int c, qreal *vals);
-	void NewTDist();
+	void handleNewShape(int frameType);
 	void NewSpGradient(double x1, double y1, double x2, double y2, double fx, double fy, double sg, double sk, double cx, double cy);
 	void toggleGradientEdit(int);
 	void NewSpGradientM(double x1, double y1, double x2, double y2, double fx, double fy, double sg, double sk);
 	void toggleGradientEditM();
-	void toggleGradientEditMGroup();
-	void DoRevert();
-	void doClearCStyle();
-	void doClearPStyle();
 	void handleShapeEdit();
-	void handleShapeEdit2();
-	void handleImageEffects();
-	void handleExtImgProperties();
-	void handleLock();
-	void handleLockSize();
-	void handlePrint();
-	void handlePathType();
-	void handlePathFlip();
-	void handlePathLine();
-	void handlePathDist();
-	void handlePathOffs();
-	void handleFillRule();
-	void handleOverprint(int);
-	void ChangeProfile(const QString& prn);
-	void ChangeIntent();
-	void ChangeCompressionMethod();
-	void ChangeCompressionQuality();
-	void NewName();
-	void NewLanguage();
-	void HandleTLines();
-	void setStartArrow(int id);
-	void setEndArrow(int id);
-	void setStartArrowScale(int sc);
-	void setEndArrowScale(int sc);
-	void setGroupTransparency(double trans);
-	void setGroupBlending(int blend);
-	void setGroupGradMask(int typ);
-	void setGroupPatternMask(QString pattern);
-	void setGroupPatternMaskProps(double imageScaleX, double imageScaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY, bool mirrorX, bool mirrorY);
-	void doGrouping();
-	void dashChange();
-	void flop(int);
-
-protected slots:
-	//virtual void reject();
-	void spinboxStartUserAction();
-	void spinboxFinishUserAction();
-	void updateSpinBoxConstants();
 
 signals:
 	void DocChanged();
-	void NewParStyle(int);
-	void NewAlignment(int);
-	void NewEffects(int);
-	void ShapeEdit();
-	void NewFont(const QString&);
-	void UpdtGui(int);
-	void updateEditItem();
 
 protected:
 	ScribusMainWindow *m_ScMW;
@@ -355,298 +119,33 @@
 	QVBoxLayout* MpalLayout;
 	QVBoxLayout* pageLayout;
 	QVBoxLayout* pageLayout_2;
-	QVBoxLayout* pageLayout_2c;
 	QVBoxLayout* pageLayout_3;
 	QVBoxLayout* pageLayout_4;
 	QVBoxLayout* pageLayout_5;
-	QVBoxLayout* pageLayout_5a;
-	QVBoxLayout* pageLayout_5b;
 	QVBoxLayout* pageLayout_6;
 	QVBoxLayout* pageLayout_7;
-	QVBoxLayout* TLineLayout;
-	QHBoxLayout* layout60;
-	QGridLayout* Layout44;
-	QHBoxLayout* Layout13;
-	QGridLayout* layout41;
-	QGridLayout* layout41a;
-	QGridLayout* layout41c;
-	QHBoxLayout* Layout1;
-	QHBoxLayout* Layout1AL;
-	QGridLayout* layout43;
-	QVBoxLayout* Layout24;
-	QHBoxLayout* Layout18;
-	QGridLayout* Layout12_2;
-	QGridLayout* imagePageNumberSelector;
-	QHBoxLayout* NameGroupLayout;
-	QGridLayout* GeoGroupLayout;
-	QGridLayout* LayerGroupLayout;
-	QHBoxLayout* ShapeGroupLayout;
-	QGridLayout* DistanceLayout;
-	QGridLayout* DistanceLayout2;
-	QVBoxLayout* DistanceLayout3;
-	QGridLayout* GroupBox3aLayout;
-	QVBoxLayout* GroupBoxCMLayout;
-	QVBoxLayout* GroupBoxCompressionLayout;
-	QVBoxLayout* textFlowOptionsLayout;
-	QVBoxLayout* textFlowOptionsLayout2;
-	QHBoxLayout* layout23;
-	QHBoxLayout* layout24;
+
 	QVBoxLayout* page_group_layout;
-	QHBoxLayout* ShapeGroupLayout2;
-	QVBoxLayout* Layout1t;
-	QHBoxLayout* wordTrackingHLayout;
-	QHBoxLayout* glyphExtensionHLayout;
-	QGridLayout* flopLayout;
-	QVBoxLayout* OptMarginsLayout;
-	QHBoxLayout* Layout12_2a;
-	QHBoxLayout* Layout12_2b;
-	
-	NameWidget* NameEdit;
 	
 	QWidget* page;
 	QWidget* page_2;
-	QWidget* page_2a;
-	QWidget* page_2c;
 	QWidget* page_3;
 	QWidget* page_4;
 	QWidget* page_5;
-	QWidget* page_5a;
-	QWidget* page_5b;
 	QWidget* page_6;
 	QWidget* page_7;
 	QWidget* page_group;
-	
-	QLabel* xposLabel;
-	QLabel* widthLabel;
-	QLabel* yposLabel;
-	QLabel* heightLabel;
-	QLabel* rotationLabel;
-	QLabel* basepointLabel;
-	QLabel* LevelTxt;
-	QLabel* SRect;
-	QLabel* SRect2;
-	QLabel* rndcornersLabel;
-	QLabel* startoffsetLabel;
-	QLabel* distfromcurveLabel;
-	QLabel* pathTextTypeLabel;
-	QLabel* topLabel;
-	QLabel* columnsLabel;
-	QLabel* bottomLabel;
-	QLabel* leftLabel;
-	QLabel* rightLabel;
-	QLabel* trackingLabel;
-	QLabel* fontsizeLabel;
-	QLabel* lineSpacingLabel;
-	QLabel* yscaleLabel;
-	QLabel* xscaleLabel;
-	QLabel* xposImgLabel;
-	QLabel* yposImgLabel;
-	QLabel* imageRotationLabel;
-	QLabel* linewidthLabel;
-	QLabel* endingsLabel;
-	QLabel* linetypeLabel;
-	QLabel* StrokeIcon;
-	QLabel* ShadeTxt2;
-	QLabel* ShadeTxt1;
-	QLabel* FillIcon;
-	QLabel* paraStyleLabel;
-	QLabel* charStyleLabel;
-	QLabel* langLabel;
-	QLabel* LineModeT;
-	QLabel* TextCms1;
-	QLabel* TextCms2;
-	QLabel* TextCompressionMethod;
-	QLabel* TextCompressionQuality;
-	QLabel* edgesLabel;
-	QLabel* ChBaseTxt;
-	QLabel* ScaleTxt;
-	QLabel* ScaleTxtV;
-	QLabel* imagePageNumberLabel;
-	QLabel* imgDPIXLabel;
-	QLabel* imgDPIYLabel;
-	QLabel* startArrowText;
-	QLabel* endArrowText;
-	QLabel* TransTxt;
-	QLabel* TransTxt2;
-	QLabel* wordTrackingLabel;
-	QLabel* minWordTrackingLabel;
-	QLabel* normWordTrackingLabel;
-	QLabel* glyphExtensionLabel;
-	QLabel* minGlyphExtensionLabel;
-	QLabel* maxGlyphExtensionLabel;
-	QLabel* startArrowSpinText;
-	QLabel* endArrowSpinText;
-
-	ScComboBox* colgapLabel;
-	StyleSelect* SeStyle;
-	AlignSelect* GroupAlign;
-
-	LinkButton* keepImageWHRatioButton;
-	LinkButton* keepFrameWHRatioButton;
-	LinkButton* keepImageDPIRatioButton;
-	LineCombo* LStyle;
-
-	ShadeButton *PM1;
-	ShadeButton *PM2;
-	PageItem *CurItem;
-	bool HaveDoc;
-	bool HaveItem;
-	ScribusDoc *doc;
-	double m_unitRatio;
-	int m_unitIndex;
-	bool LMode;
-	double RoVal;
-
-
-	QGroupBox* ShapeGroup;
-	QGroupBox* ShapeGroup2;
-	QGroupBox* Distance3;
-
-	QToolButton* TabsButton;
-
-	QToolButton* Zup;
-	QToolButton* ZDown;
-	QToolButton* ZTop;
-	QToolButton* ZBottom;
 
 	QToolBox* TabStack;
-	QStackedWidget* TabStack2;
-	QStackedWidget* TabStack3;
 
-
-	QGroupBox* NameGroup;
-	QGroupBox* GeoGroup;
-	QGroupBox* LayerGroup;
-	QFrame* GroupBoxCM;
-	QFrame* GroupBoxCompression;
-	QGroupBox* TLines;
-	QGroupBox* GroupBox3a;
-	QGroupBox* TransGroup;
-
-	QToolButton* textFlowDisabled;
-	QToolButton* textFlowUsesFrameShape;
-	QToolButton* textFlowUsesBoundingBox;
-	QToolButton* textFlowUsesContourLine;
-	QToolButton* textFlowUsesImageClipping;
-	QToolButton* textFlowDisabled2;
-	QToolButton* textFlowUsesFrameShape2;
-	QToolButton* textFlowUsesBoundingBox2;
-	QToolButton* textFlowUsesContourLine2;
-	QToolButton* textFlowUsesImageClipping2;
-	QCheckBox* Aspect;
-	QCheckBox* flippedPathText;
-	QCheckBox* showcurveCheckBox;
-	QCheckBox* TopLine;
-	QCheckBox* LeftLine;
-	QCheckBox* RightLine;
-	QCheckBox* BottomLine;
-
-	ScComboBox* pathTextType;
-	QComboBox* langCombo;
-	QComboBox* InputP;
-	QComboBox* MonitorI;
-	QComboBox* CompressionMethod;
-	QComboBox* CompressionQuality;
-	QComboBox* LineMode;
-	QComboBox* lineSpacingModeCombo;
-	ColorCombo* TxStroke;
-	QComboBox* LJoinStyle;
-	QComboBox* LEndStyle;
-	ColorCombo* TxFill;
-	ScComboBox* blendMode;
-	QRadioButton *optMarginRadioNone;
-	QRadioButton *optMarginRadioBoth;
-	QRadioButton *optMarginRadioLeft;
-	QRadioButton *optMarginRadioRight;
-	QPushButton *optMarginResetButton;
-
-	QListWidget* StyledLine;
-
-	ScrSpinBox* Width;
-	ScrSpinBox* Xpos;
-	ScrSpinBox* Ypos;
-	ScrSpinBox* Height;
-	ScrSpinBox* Rotation;
-	ScrSpinBox* RoundRect;
-	ScrSpinBox* dGap;
-	ScrSpinBox* DTop;
-	ScrSpinBox* DBottom;
-	ScrSpinBox* DLeft;
-	ScrSpinBox* DRight;
-	ScrSpinBox* Dist;
-	ScrSpinBox* LineW;
-	ScrSpinBox* Size;
-	ScrSpinBox* LineSp;
-	ScrSpinBox* Extra;
-	ScrSpinBox* imageYOffsetSpinBox;
-	ScrSpinBox* imageXOffsetSpinBox;
-	ScrSpinBox* imageRotation;
-	ScrSpinBox* imageYScaleSpinBox;
-	ScrSpinBox* imageXScaleSpinBox;
-	ScrSpinBox* imgDpiX;
-	ScrSpinBox* imgDpiY;
-	ScrSpinBox* LSize;
-	ScrSpinBox* ChScale;
-	ScrSpinBox* ChScaleV;
-	ScrSpinBox* ChBase;
-	ScrSpinBox* minWordTrackingSpinBox;
-	ScrSpinBox* normWordTrackingSpinBox;
-	ScrSpinBox* minGlyphExtSpinBox;
-	ScrSpinBox* maxGlyphExtSpinBox;
-	QSpinBox* imagePageNumber;
-	QSpinBox* DCol;
-	QSpinBox* TransSpin;
-	QSpinBox* startArrowScaleSpin;
-	QSpinBox* endArrowScaleSpin;
-
-	QRadioButton* FreeScale;
-	QRadioButton* FrameScale;
-	QRadioButton* EvenOdd;
-	QRadioButton* NonZero;
-	QRadioButton* flopRealHeight;
-	QRadioButton* flopFontAscent;
-	QRadioButton* flopLineSpacing;
+	bool      m_haveDoc;
+	bool      m_haveItem;
+	double    m_unitRatio;
+	int       m_unitIndex;
+	PageItem* m_item;
 	
-	QButtonGroup* flopGroup;
-
-	QFrame* Frame4;
-
-	QMenu* lineSpacingPop;
-
-	QToolButton* DoGroup;
-	QToolButton* DoUnGroup;
-	QToolButton* FlipH;
-	QToolButton* FlipV;
-	QToolButton* Locked;
-	QToolButton* NoPrint;
-	QToolButton* NoResize;
-	QToolButton* Revert;
-	QToolButton* charStyleClear;
-	QToolButton* paraStyleClear;
-	QToolButton* EditShape;
-	QToolButton* EditShape2;
-	QToolButton* EditEffects;
-	QToolButton* EditPSDProps;
-
-	ScTreeWidget* TextTree;
-	QFrame* colorWidgets;
-	QTreeWidgetItem* colorWidgetsItem;
-	QFrame* advancedWidgets;
-	QTreeWidgetItem* advancedWidgetsItem;
-	QFrame* styleWidgets;
-	QTreeWidgetItem* styleWidgetsItem;
-	QFrame* flopBox;
-	QTreeWidgetItem* flopItem;
-	QFrame* Distance;
-	QTreeWidgetItem* DistanceItem;
-	QFrame* Distance2;
-	QTreeWidgetItem* Distance2Item;
-	QFrame* OptMargins;
-	QTreeWidgetItem* OptMarginsItem;
-
-	bool _userActionOn;
-	UserActionSniffer *userActionSniffer;
-	void installSniffer(ScrSpinBox *spinBox);
+	ScGuardedPtr<ScribusDoc> m_doc;
+	
 	
 	int idXYZItem;
 	int idShapeItem;
@@ -656,20 +155,6 @@
 	int idColorsItem;
 	int idTransparencyItem;
 	int idGroupItem;
-	Selection* tmpSelection;
-};
-
-class SCRIBUS_API UserActionSniffer : public QObject
-{
-	Q_OBJECT
-
-public:
-	UserActionSniffer( QObject* parent );
-protected:
-	bool eventFilter( QObject *o, QEvent *e );
-signals:
-	void actionStart();
-	void actionEnd();
 };
 
 #endif

Modified: trunk/Scribus/scribus/ui/scrapbookpalette.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/ui/scrapbookpalette.h
==============================================================================
--- trunk/Scribus/scribus/ui/scrapbookpalette.h (original)
+++ trunk/Scribus/scribus/ui/scrapbookpalette.h Sun Apr  3 15:06:46 2011
@@ -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: trunk/Scribus/scribus/ui/scrspinbox.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/ui/scrspinbox.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scrspinbox.cpp (original)
+++ trunk/Scribus/scribus/ui/scrspinbox.cpp Sun Apr  3 15:06:46 2011
@@ -49,6 +49,13 @@
 
 ScrSpinBox::~ScrSpinBox()
 {
+}
+
+void ScrSpinBox::showValue(double val)
+{
+	this->blockSignals(true);
+	setValue(val);
+	this->blockSignals(false);
 }
 
 

Modified: trunk/Scribus/scribus/ui/scrspinbox.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/ui/scrspinbox.h
==============================================================================
--- trunk/Scribus/scribus/ui/scrspinbox.h (original)
+++ trunk/Scribus/scribus/ui/scrspinbox.h Sun Apr  3 15:06:46 2011
@@ -31,6 +31,9 @@
 		QString textFromValue ( double value ) const;
 		QValidator::State validate ( QString & input, int & pos ) const;
 		void fixup ( QString & input ) const;
+
+		// call QDoubleSpinBox::setValue() without emitting valueChanged() signal
+		void showValue(double val);
 		
 		//custom
 		void init(int unitIndex);

Modified: trunk/Scribus/scribus/ui/smlinestyle.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/ui/smlinestyle.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smlinestyle.cpp (original)
+++ trunk/Scribus/scribus/ui/smlinestyle.cpp Sun Apr  3 15:06:46 2011
@@ -12,6 +12,7 @@
 #include "smlinestylewidget.h"
 #include "scribus.h"
 #include "propertiespalette.h"
+#include "propertiespalette_line.h"
 #include "scribusdoc.h"
 #include "scribusview.h"
 #include "selection.h"
@@ -261,7 +262,7 @@
 		}
 	}
 	doc_->changed();
-	doc_->scMW()->propertiesPalette->SetLineFormats(doc_);
+	doc_->scMW()->requestUpdate(reqLineStylesUpdate);
 	// Better not call DrawNew() here, as this will cause several unnecessary calls
 	// doc_->view()->DrawNew();
 	selectionIsDirty_ = false;

Modified: trunk/Scribus/scribus/ui/smtextstyles.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/ui/smtextstyles.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smtextstyles.cpp (original)
+++ trunk/Scribus/scribus/ui/smtextstyles.cpp Sun Apr  3 15:06:46 2011
@@ -6,6 +6,7 @@
 */
 
 #include <QEvent>
+#include <QMessageBox>
 #include <QTabWidget>
 
 #include "alignselect.h"
@@ -15,6 +16,7 @@
 #include "ui/scmwmenumanager.h"
 #include "prefsmanager.h"
 #include "propertiespalette.h"
+#include "propertiespalette_text.h"
 #include "sccombobox.h"
 #include "scribus.h"
 #include "scribusdoc.h"
@@ -298,8 +300,7 @@
 
 	deleted_.clear(); // deletion done at this point
 
-	doc_->scMW()->propertiesPalette->paraStyleCombo->updateFormatList();
-	doc_->scMW()->propertiesPalette->charStyleCombo->updateFormatList();
+	doc_->scMW()->requestUpdate(reqTextStylesUpdate);
 	// Better not call DrawNew() here, as this will cause several unnecessary calls
 	// doc_->view()->DrawNew();
 	doc_->changed();
@@ -1658,8 +1659,7 @@
 
 	deleted_.clear(); // deletion done at this point
 
-	doc_->scMW()->propertiesPalette->paraStyleCombo->updateFormatList();
-	doc_->scMW()->propertiesPalette->charStyleCombo->updateFormatList();
+	doc_->scMW()->requestUpdate(reqTextStylesUpdate);
 	// Better not call DrawNew() here, as this will cause several unnecessary calls
 	// doc_->view()->DrawNew();
 	doc_->changed();

Modified: trunk/Scribus/scribus/ui/symbolpalette.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/ui/symbolpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/symbolpalette.cpp (original)
+++ trunk/Scribus/scribus/ui/symbolpalette.cpp Sun Apr  3 15:06:46 2011
@@ -128,7 +128,12 @@
 {
 	m_scMW = mw;
 	if (m_scMW == NULL)
+	{
 		SymbolViewWidget->clear();
+		disconnect(m_scMW, SIGNAL(UpdateRequest(int)), this, SLOT(handleUpdateRequest(int)));
+		return;
+	}
+	connect(m_scMW, SIGNAL(UpdateRequest(int)), this, SLOT(handleUpdateRequest(int)), Qt::UniqueConnection);
 }
 
 void SymbolPalette::setDoc(ScribusDoc *newDoc)
@@ -147,6 +152,12 @@
 {
 	currDoc = NULL;
 	SymbolViewWidget->clear();
+}
+
+void SymbolPalette::handleUpdateRequest(int updateFlags)
+{
+	if (updateFlags & reqSymbolsUpdate)
+		updateSymbolList();
 }
 
 void SymbolPalette::updateSymbolList()

Modified: trunk/Scribus/scribus/ui/symbolpalette.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/ui/symbolpalette.h
==============================================================================
--- trunk/Scribus/scribus/ui/symbolpalette.h (original)
+++ trunk/Scribus/scribus/ui/symbolpalette.h Sun Apr  3 15:06:46 2011
@@ -75,6 +75,7 @@
 
 public slots:
 	void handleDoubleClick(QListWidgetItem *item);
+	void handleUpdateRequest(int);
 	void languageChange();
 
 signals:

Modified: trunk/Scribus/scribus/ui/transparencypalette.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/ui/transparencypalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/transparencypalette.cpp (original)
+++ trunk/Scribus/scribus/ui/transparencypalette.cpp Sun Apr  3 15:06:46 2011
@@ -25,6 +25,7 @@
 #include "sccolorengine.h"
 #include "scpainter.h"
 #include "scpattern.h"
+#include "scribus.h"
 #include "util_icon.h"
 #include "util.h"
 #include "util_math.h"
@@ -67,11 +68,52 @@
 
 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);
+	
+	if (currentDoc)
+	{
+		disconnect(currentDoc->scMW(), SIGNAL(UpdateRequest(int)), this, 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)));
+		connect(doc->scMW(), SIGNAL(UpdateRequest(int)), this, SLOT(handleUpdateRequest(int)));
+	}
+}
+
+void Tpalette::handleUpdateRequest(int updateFlags)
+{
+	if (updateFlags & reqColorsUpdate)
+		updateColorList();
+}
+
+void Tpalette::updateColorList()
+{
+	if (currentDoc)
+	{
+		this->setColors(currentDoc->PageColors);
+		this->setPatterns(&currentDoc->docPatterns);
+		this->setGradients(&currentDoc->docGradients);
 	}
 }
 
@@ -128,6 +170,13 @@
 		gradientType->setCurrentIndex(0);
 	else if ((currentItem->GrMask == 2) || (currentItem->GrMask == 5))
 		gradientType->setCurrentIndex(1);
+
+	double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
+	bool mirrorX, mirrorY;
+	currentItem->maskTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
+	currentItem->maskFlip(mirrorX, mirrorY);
+	setActPattern(currentItem->patternMask(), patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY, mirrorX, mirrorY);
+
 	connect(gradEdit, SIGNAL(gradientChanged()), this, SIGNAL(gradientChanged()));
 	connect(namedGradient, SIGNAL(activated(const QString &)), this, SLOT(setNamedGradient(const QString &)));
 	connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(slotGrad(int)));
@@ -171,13 +220,13 @@
 	connect(namedGradient, SIGNAL(activated(const QString &)), this, SLOT(setNamedGradient(const QString &)));
 }
 
-void Tpalette::SetGradients(QMap<QString, VGradient> *docGradients)
+void Tpalette::setGradients(QMap<QString, VGradient> *docGradients)
 {
 	gradientList = docGradients;
 	updateGradientList();
 }
 
-void Tpalette::SetColors(ColorList newColorList)
+void Tpalette::setColors(ColorList newColorList)
 {
 	colorList.clear();
 	colorList = newColorList;
@@ -372,7 +421,7 @@
 	connect(patternBox, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(selectPattern(QListWidgetItem*)));
 }
 
-void Tpalette::SetPatterns(QMap<QString, ScPattern> *docPatterns)
+void Tpalette::setPatterns(QMap<QString, ScPattern> *docPatterns)
 {
 	patternList = docPatterns;
 	updatePatternList();

Modified: trunk/Scribus/scribus/ui/transparencypalette.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/ui/transparencypalette.h
==============================================================================
--- trunk/Scribus/scribus/ui/transparencypalette.h (original)
+++ trunk/Scribus/scribus/ui/transparencypalette.h Sun Apr  3 15:06:46 2011
@@ -53,6 +53,7 @@
 	Q_OBJECT
 
 	friend class PropertiesPalette;
+	friend class PropertiesPalette_Group;
 
 public:
 	Tpalette(QWidget* parent);
@@ -60,18 +61,24 @@
 	
 	virtual void changeEvent(QEvent *e);
 
+	void handleUpdateRequest(int);
+
 	void setDocument(ScribusDoc* doc);
 	void setCurrentItem(PageItem* item);
 	void hideSelectionButtons();
 	void updateFromItem();
+
+	void updateColorList();
+
+	void setColors(ColorList newColorList);
+	void setGradients(QMap<QString, VGradient> *docGradients);
+	void setPatterns(QMap<QString, ScPattern> *docPatterns);
 
 public slots:
 	void editLineSelectorButton();
 	void editFillSelectorButton();
 	void updateCList();
 	void updateGradientList();
-	void SetGradients(QMap<QString, VGradient> *docGradients);
-	void SetColors(ColorList newColorList);
 	void slotGrad(int nr);
 	void slotGradType(int type);
 	void setNamedGradient(const QString &name);
@@ -81,7 +88,6 @@
 	void setActiveGradDia(bool active);
 	void hideEditedPatterns(QStringList names);
 	void updatePatternList();
-	void SetPatterns(QMap<QString, ScPattern> *docPatterns);
 	void selectPattern(QListWidgetItem *c);
 	void setActPattern(QString pattern, double scaleX, double scaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY, bool mirrorX, bool mirrorY);
 	void changePatternProps();

Modified: trunk/Scribus/scribus/undogui.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/undogui.cpp
==============================================================================
--- trunk/Scribus/scribus/undogui.cpp (original)
+++ trunk/Scribus/scribus/undogui.cpp Sun Apr  3 15:06:46 2011
@@ -23,10 +23,11 @@
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
+#include <QCheckBox>
 #include <QDebug>
 #include <QEvent>
+#include <QPainter>
 #include <QPushButton>
-#include <QCheckBox>
 #include <QVBoxLayout>
 
 #include "undogui.h"

Modified: trunk/Scribus/scribus/upgradechecker.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/upgradechecker.cpp
==============================================================================
--- trunk/Scribus/scribus/upgradechecker.cpp (original)
+++ trunk/Scribus/scribus/upgradechecker.cpp Sun Apr  3 15:06:46 2011
@@ -5,6 +5,7 @@
 for which a new license (GPL+exception) is in place.
 */
 
+#include <QApplication>
 #include <QDebug>
 #include <QDir>
 #include <QDomDocument>

Modified: trunk/Scribus/scribus/util.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/util.cpp
==============================================================================
--- trunk/Scribus/scribus/util.cpp (original)
+++ trunk/Scribus/scribus/util.cpp Sun Apr  3 15:06:46 2011
@@ -24,6 +24,7 @@
 #include <algorithm>
 #include "util.h"
 #include <zlib.h>
+#include <QApplication>
 #include <QCryptographicHash>
 #include <QDomElement>
 #include <QProcess>

Modified: trunk/Scribus/scribus/util_ghostscript.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/scribus/util_ghostscript.cpp
==============================================================================
--- trunk/Scribus/scribus/util_ghostscript.cpp (original)
+++ trunk/Scribus/scribus/util_ghostscript.cpp Sun Apr  3 15:06:46 2011
@@ -24,6 +24,7 @@
 
 #include "util_ghostscript.h"
 
+#include <QApplication>
 #include <QDebug>
 #include <QDir>
 #include <QFile>

Modified: trunk/Scribus/win32/vc9/Scribus.vcproj
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16546&path=/trunk/Scribus/win32/vc9/Scribus.vcproj
==============================================================================
--- trunk/Scribus/win32/vc9/Scribus.vcproj (original)
+++ trunk/Scribus/win32/vc9/Scribus.vcproj Sun Apr  3 15:06:46 2011
@@ -1277,6 +1277,62 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\scribus\ui\propertiespalette_group.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertiespalette_image.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertiespalette_line.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertiespalette_shape.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertiespalette_text.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertiespalette_utils.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertiespalette_xyz.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertywidget_advanced.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertywidget_distance.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertywidget_flop.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertywidget_optmargins.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertywidget_pathtext.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertywidget_textcolor.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertywidgetbase.cpp"
+				>
+			</File>
+			<File
 				RelativePath="..\..\scribus\pslib.cpp"
 				>
 			</File>
@@ -1326,6 +1382,10 @@
 			</File>
 			<File
 				RelativePath="..\..\scribus\ui\sccombobox.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\scdockpalette.cpp"
 				>
 			</File>
 			<File
@@ -5492,6 +5552,244 @@
 				</FileConfiguration>
 			</File>
 			<File
+				RelativePath="..\..\scribus\ui\propertiespalette_group.h"
+				>
+				<FileConfiguration
+					Name="Debug-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertiespalette_image.h"
+				>
+				<FileConfiguration
+					Name="Debug-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertiespalette_line.h"
+				>
+				<FileConfiguration
+					Name="Debug-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertiespalette_shape.h"
+				>
+				<FileConfiguration
+					Name="Debug-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertiespalette_text.h"
+				>
+				<FileConfiguration
+					Name="Debug-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertiespalette_utils.h"
+				>
+				<FileConfiguration
+					Name="Debug-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertiespalette_xyz.h"
+				>
+				<FileConfiguration
+					Name="Debug-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertywidget_advanced.h"
+				>
+				<FileConfiguration
+					Name="Debug-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertywidget_distance.h"
+				>
+				<FileConfiguration
+					Name="Debug-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertywidget_flop.h"
+				>
+				<FileConfiguration
+					Name="Debug-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertywidget_optmargins.h"
+				>
+				<FileConfiguration
+					Name="Debug-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertywidget_pathtext.h"
+				>
+				<FileConfiguration
+					Name="Debug-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertywidget_textcolor.h"
+				>
+				<FileConfiguration
+					Name="Debug-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertywidgetbase.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\scribus\pslib.h"
 				>
 				<FileConfiguration
@@ -5638,6 +5936,24 @@
 			<File
 				RelativePath="..\..\scribus\scconfig.h"
 				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\scdockpalette.h"
+				>
+				<FileConfiguration
+					Name="Debug-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
 			</File>
 			<File
 				RelativePath="..\..\scribus\scdocoutput.h"
@@ -6118,22 +6434,14 @@
 					Name="Debug-cairo|Win32"
 					>
 					<Tool
-						Name="VCCustomBuildTool"
-						Description="Moc&apos;ing $(InputFileName)"
-						CommandLine="$(QT4_DIR)\bin\moc.exe &quot;$(InputPath)&quot; -o  &quot;$(InputDir)\moc_$(InputName).cpp&quot;&#x0D;&#x0A;"
-						AdditionalDependencies="$(QT4_DIR)\bin\moc.exe"
-						Outputs="$(InputDir)\moc_$(InputName).cpp"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-cairo|Win32"
-					>
-					<Tool
-						Name="VCCustomBuildTool"
-						Description="Moc&apos;ing $(InputFileName)"
-						CommandLine="$(QT4_DIR)\bin\moc.exe &quot;$(InputPath)&quot; -o  &quot;$(InputDir)\moc_$(InputName).cpp&quot;&#x0D;&#x0A;"
-						AdditionalDependencies="$(QT4_DIR)\bin\moc.exe"
-						Outputs="$(InputDir)\moc_$(InputName).cpp"
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
 					/>
 				</FileConfiguration>
 			</File>
@@ -7699,6 +8007,58 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\scribus\ui\ui_propertiespalette_groupbase.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\ui_propertiespalette_imagebase.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\ui_propertiespalette_linebase.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\ui_propertiespalette_shapebase.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\ui_propertiespalette_textbase.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\ui_propertiespalette_xyzbase.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\ui_propertywidget_advancedbase.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\ui_propertywidget_distancebase.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\ui_propertywidget_flopbase.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\ui_propertywidget_linebase.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\ui_propertywidget_optmarginsbase.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\ui_propertywidget_pathtextbase.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\ui_propertywidget_textcolorbase.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\scribus\ui\ui_replacecolors.h"
 				>
 			</File>
@@ -8468,6 +8828,58 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\scribus\ui\moc_propertiespalette_group.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\moc_propertiespalette_image.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\moc_propertiespalette_line.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\moc_propertiespalette_shape.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\moc_propertiespalette_text.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\moc_propertiespalette_utils.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\moc_propertiespalette_xyz.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\moc_propertywidget_advanced.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\moc_propertywidget_distance.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\moc_propertywidget_flop.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\moc_propertywidget_optmargins.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\moc_propertywidget_pathtext.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\moc_propertywidget_textcolor.cpp"
+				>
+			</File>
+			<File
 				RelativePath="..\..\scribus\moc_pslib.cpp"
 				>
 			</File>
@@ -8489,6 +8901,10 @@
 			</File>
 			<File
 				RelativePath="..\..\scribus\moc_sampleitem.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\moc_scdockpalette.cpp"
 				>
 			</File>
 			<File
@@ -9037,6 +9453,54 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\scribus\ui\propertiespalette_groupbase.ui"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertiespalette_imagebase.ui"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertiespalette_linebase.ui"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertiespalette_shapebase.ui"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertiespalette_textbase.ui"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertiespalette_xyzbase.ui"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertywidget_advancedbase.ui"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertywidget_distancebase.ui"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertywidget_flopbase.ui"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertywidget_optmarginsbase.ui"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertywidget_pathtextbase.ui"
+				>
+			</File>
+			<File
+				RelativePath="..\..\scribus\ui\propertywidget_textcolorbase.ui"
+				>
+			</File>
+			<File
 				RelativePath="..\..\scribus\ui\replacecolors.ui"
 				>
 			</File>




More information about the scribus-commit mailing list