r17391 by jghali - merge trunk revisions up to r17390

scribus-commit scribus-commit at lists.scribus.net
Mon Mar 19 22:27:38 UTC 2012


Author: jghali
Date: Mon Mar 19 22:27:37 2012
New Revision: 17391

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17391
Log:
merge trunk revisions up to r17390

Modified:
    branches/ScribusOIF/scribus/selection.cpp
    branches/ScribusOIF/scribus/ui/about.cpp
    branches/ScribusOIF/scribus/ui/propertiespalette.cpp
    branches/ScribusOIF/scribus/ui/propertiespalette_content.cpp
    branches/ScribusOIF/scribus/ui/propertiespalette_content.h
    branches/ScribusOIF/scribus/ui/propertiespalette_frame.cpp
    branches/ScribusOIF/scribus/ui/propertiespalette_frame.h
    branches/ScribusOIF/scribus/ui/propertiespalette_text.cpp
    branches/ScribusOIF/scribus/ui/propertiespalette_text.h
    branches/ScribusOIF/scribus/ui/propertywidget_advanced.cpp
    branches/ScribusOIF/scribus/ui/propertywidget_advanced.h
    branches/ScribusOIF/scribus/ui/propertywidget_distance.cpp
    branches/ScribusOIF/scribus/ui/propertywidget_distance.h
    branches/ScribusOIF/scribus/ui/propertywidget_dropcap.cpp
    branches/ScribusOIF/scribus/ui/propertywidget_dropcap.h
    branches/ScribusOIF/scribus/ui/propertywidget_group.cpp
    branches/ScribusOIF/scribus/ui/propertywidget_group.h
    branches/ScribusOIF/scribus/ui/propertywidget_groupshape.cpp
    branches/ScribusOIF/scribus/ui/propertywidget_groupshape.h
    branches/ScribusOIF/scribus/ui/propertywidget_image.cpp
    branches/ScribusOIF/scribus/ui/propertywidget_image.h
    branches/ScribusOIF/scribus/ui/propertywidget_line.cpp
    branches/ScribusOIF/scribus/ui/propertywidget_line.h
    branches/ScribusOIF/scribus/ui/propertywidget_optmargins.cpp
    branches/ScribusOIF/scribus/ui/propertywidget_optmargins.h
    branches/ScribusOIF/scribus/ui/propertywidget_pathtext.cpp
    branches/ScribusOIF/scribus/ui/propertywidget_pathtext.h
    branches/ScribusOIF/scribus/ui/propertywidget_pos.cpp
    branches/ScribusOIF/scribus/ui/propertywidget_pos.h
    branches/ScribusOIF/scribus/ui/propertywidget_shape.cpp
    branches/ScribusOIF/scribus/ui/propertywidget_shape.h
    branches/ScribusOIF/scribus/ui/propertywidget_text.cpp
    branches/ScribusOIF/scribus/ui/propertywidget_text.h
    branches/ScribusOIF/scribus/ui/propertywidget_textcolor.cpp
    branches/ScribusOIF/scribus/ui/propertywidget_textcolor.h
    branches/ScribusOIF/scribus/ui/propertywidget_textstyles.cpp
    branches/ScribusOIF/scribus/ui/propertywidget_textstyles.h
    branches/ScribusOIF/scribus/ui/sctreewidget.cpp

Modified: branches/ScribusOIF/scribus/selection.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/selection.cpp
==============================================================================
--- branches/ScribusOIF/scribus/selection.cpp (original)
+++ branches/ScribusOIF/scribus/selection.cpp Mon Mar 19 22:27:37 2012
@@ -194,7 +194,7 @@
 {
 	if (item==NULL)
 		return false;
-	bool listWasEmpty=m_SelList.isEmpty();
+	bool listWasEmpty = m_SelList.isEmpty();
 	if (listWasEmpty || !m_SelList.contains(item))
 	{
 		m_SelList.append(item);

Modified: branches/ScribusOIF/scribus/ui/about.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/about.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/about.cpp (original)
+++ branches/ScribusOIF/scribus/ui/about.cpp Mon Mar 19 22:27:37 2012
@@ -112,8 +112,8 @@
 	buildID = new QLabel( tab );
 	buildID->setAlignment(Qt::AlignCenter);
 	buildID->setTextInteractionFlags(Qt::TextSelectableByMouse);
-	QString BUILD_DAY = "6";
-	QString BUILD_MONTH = CommonStrings::february;
+	QString BUILD_DAY = "19";
+	QString BUILD_MONTH = CommonStrings::march;
 	QString BUILD_YEAR = "2012";
 	QString BUILD_TIME = "";
 	QString BUILD_TZ = "";

Modified: branches/ScribusOIF/scribus/ui/propertiespalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertiespalette.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertiespalette.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertiespalette.cpp Mon Mar 19 22:27:37 2012
@@ -85,7 +85,8 @@
 	setFont(f);
 
 	TabStack = new ScTreeWidget( this );
-	TabStack->setToolBoxMode(true);
+//	Uncomment this line if the new behaviour makes any trouble.
+//	TabStack->setToolBoxMode(true);
 
 	xyzPal = new PropertiesPalette_XYZ( this );
 	idXYZItem = TabStack->addItem( xyzPal, "X, Y, &Z" );
@@ -390,6 +391,7 @@
 		TabStack->setItemEnabled(idColorsItem, false);
 		TabStack->setItemEnabled(idTextItem, false);
 		TabStack->setItemEnabled(idImageItem, false);
+		TabStack->setItemEnabled(idTableItem, false);
 	}
 	else
 		TabStack->setItemEnabled(idGroupItem, false);
@@ -422,6 +424,7 @@
 		TabStack->setItemEnabled(idTransparencyItem, false);
 		TabStack->setItemEnabled(idTextItem, false);
 		TabStack->setItemEnabled(idImageItem, false);
+		TabStack->setItemEnabled(idTableItem, false);
 	}
 	if (m_item->asSymbolFrame())
 	{
@@ -433,6 +436,7 @@
 		TabStack->setItemEnabled(idTextItem, false);
 		TabStack->setItemEnabled(idImageItem, false);
 		TabStack->setItemEnabled(idTransparencyItem, false);
+		TabStack->setItemEnabled(idTableItem, false);
 	}
 	connect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
 }
@@ -471,6 +475,7 @@
 		TabStack->setItemEnabled(idXYZItem, true);
 		TabStack->setItemEnabled(idColorsItem, true);
 		TabStack->setItemEnabled(idTransparencyItem, true);
+		TabStack->setItemEnabled(idTableItem, false);
 		switch (itemType)
 		{
 		case -1:
@@ -492,7 +497,6 @@
 				TabStack->setItemEnabled(idLineItem, false);
 				TabStack->setItemEnabled(idColorsItem, true);
 				TabStack->setItemEnabled(idTransparencyItem, false);
-				TabStack->setItemEnabled(idTableItem, false);
 				TabStack->setItemEnabled(idTextItem, false);
 				TabStack->setItemEnabled(idImageItem, false);
 			}

Modified: branches/ScribusOIF/scribus/ui/propertiespalette_content.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertiespalette_content.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertiespalette_content.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertiespalette_content.cpp Mon Mar 19 22:27:37 2012
@@ -141,7 +141,7 @@
 
 }
 
-void PropertiesPalette_Content::enableFromSelection(void)
+void PropertiesPalette_Content::configureWidgets(void)
 {
 	bool enabled = false;
 	if (m_doc && m_item)
@@ -213,7 +213,7 @@
 	m_item = item;
 
 	disconnectSignals();
-	enableFromSelection();
+	configureWidgets();
 
 	if (m_item)
 	{

Modified: branches/ScribusOIF/scribus/ui/propertiespalette_content.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertiespalette_content.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertiespalette_content.h (original)
+++ branches/ScribusOIF/scribus/ui/propertiespalette_content.h Mon Mar 19 22:27:37 2012
@@ -42,7 +42,7 @@
 	PageItem*          m_item;
 	ScribusMainWindow* m_ScMW;
 
-	void enableFromSelection(void);
+	void configureWidgets(void);
 	void setCurrentItem(PageItem *i);
 	
 private:

Modified: branches/ScribusOIF/scribus/ui/propertiespalette_frame.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertiespalette_frame.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertiespalette_frame.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertiespalette_frame.cpp Mon Mar 19 22:27:37 2012
@@ -78,7 +78,7 @@
 
 }
 
-void PropertiesPalette_Frame::enableFromSelection(void)
+void PropertiesPalette_Frame::configureWidgets(void)
 {
 	bool enabled = false;
 	if (m_doc && m_item)
@@ -152,7 +152,7 @@
 	m_item = item;
 
 	disconnectSignals();
-	enableFromSelection();
+	configureWidgets();
 
 	if (m_item)
 	{

Modified: branches/ScribusOIF/scribus/ui/propertiespalette_frame.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertiespalette_frame.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertiespalette_frame.h (original)
+++ branches/ScribusOIF/scribus/ui/propertiespalette_frame.h Mon Mar 19 22:27:37 2012
@@ -41,7 +41,7 @@
 	PageItem*          m_item;
 	ScribusMainWindow* m_ScMW;
 
-	void enableFromSelection(void);
+	void configureWidgets(void);
 	void setCurrentItem(PageItem *i);
 	
 private:

Modified: branches/ScribusOIF/scribus/ui/propertiespalette_text.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertiespalette_text.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertiespalette_text.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertiespalette_text.cpp Mon Mar 19 22:27:37 2012
@@ -120,6 +120,7 @@
 	advancedWidgets->setMainWindow(mw);
 	colorWidgets->setMainWindow(mw);
 	distanceWidgets->setMainWindow(mw);
+	dropcapsBox->setMainWindow(mw);
 	optMargins->setMainWindow(mw);
 	pathTextWidgets->setMainWindow(mw);
 
@@ -155,10 +156,10 @@
 	advancedWidgets->setDoc(m_doc);
 	colorWidgets->setDoc(m_doc);
 	distanceWidgets->setDoc(m_doc);
+	dropcapsBox->setDoc(m_doc);
 	flopBox->setDoc(m_doc);
 	optMargins->setDoc(m_doc);
 	orphanBox->setDoc(m_doc);
-	dropcapsBox->setDoc(m_doc);
 	pathTextWidgets->setDoc(m_doc);
 
 	fonts->RebuildList(m_doc);

Modified: branches/ScribusOIF/scribus/ui/propertiespalette_text.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertiespalette_text.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertiespalette_text.h (original)
+++ branches/ScribusOIF/scribus/ui/propertiespalette_text.h Mon Mar 19 22:27:37 2012
@@ -139,8 +139,6 @@
 
 	PropertyWidget_PathText* pathTextWidgets;
 	QTreeWidgetItem* pathTextItem;
-
-signals:
 };
 
 #endif

Modified: branches/ScribusOIF/scribus/ui/propertywidget_advanced.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_advanced.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_advanced.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_advanced.cpp Mon Mar 19 22:27:37 2012
@@ -99,7 +99,7 @@
 	m_item = item;
 
 	disconnectSignals();
-	enableFromSelection();
+	configureWidgets();
 
 	if (m_item)
 	{
@@ -140,7 +140,7 @@
 	disconnect(maxGlyphExtSpinBox     , SIGNAL(valueChanged(double)), this, SLOT(handleMaxGlyphExtension()) );
 }
 
-void PropertyWidget_Advanced::enableFromSelection(void)
+void PropertyWidget_Advanced::configureWidgets(void)
 {
 	bool enabled = false;
 	if (m_item && m_doc)

Modified: branches/ScribusOIF/scribus/ui/propertywidget_advanced.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_advanced.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_advanced.h (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_advanced.h Mon Mar 19 22:27:37 2012
@@ -35,7 +35,7 @@
 	PageItem*          m_item;
 	ScribusMainWindow* m_ScMW;
 
-	void enableFromSelection(void);
+	void configureWidgets(void);
 	void setCurrentItem(PageItem *i);
 
 	virtual void changeEvent(QEvent *e);

Modified: branches/ScribusOIF/scribus/ui/propertywidget_distance.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_distance.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_distance.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_distance.cpp Mon Mar 19 22:27:37 2012
@@ -18,6 +18,7 @@
 
 PropertyWidget_Distance::PropertyWidget_Distance(QWidget* parent) : QFrame(parent)
 {
+	m_item = 0;
 	m_ScMW = 0;
 
 	setupUi(this);
@@ -51,7 +52,8 @@
 {
 	m_ScMW = mw;
 
-	connect(m_ScMW, SIGNAL(UpdateRequest(int)), this  , SLOT(handleUpdateRequest(int)));
+	connect(m_ScMW, SIGNAL(AppModeChanged(int, int)), this, SLOT(handleAppModeChanged(int, int)));
+	connect(m_ScMW, SIGNAL(UpdateRequest(int))      , this, SLOT(handleUpdateRequest(int)));
 }
 
 void PropertyWidget_Distance::setDoc(ScribusDoc *d)
@@ -104,18 +106,14 @@
 	m_item = item;
 
 	disconnectSignals();
-	enableFromSelection();
+	configureWidgets();
 
 	if (!m_item) return;
 
-	PageItem_TextFrame *textItem = NULL;
+	PageItem_TextFrame *textItem = m_item->asTextFrame();
 	if (m_doc->appMode == modeEditTable)
 		textItem = m_item->asTable()->activeCell().textFrame();
-	else
-		textItem = m_item->asTextFrame();
-	
-	if (!textItem)
-		return;
+	if (!textItem) return;
 
 	columns->setMaximum(qMax(qRound(textItem->width() / qMax(textItem->ColGap, 10.0)), 1));
 	columns->setMinimum(1);
@@ -152,14 +150,14 @@
 
 void PropertyWidget_Distance::connectSignals()
 {
-	connect(columns       , SIGNAL(valueChanged(int))   , this, SLOT(handleColumns()));
-	connect(columnGap     , SIGNAL(valueChanged(double)), this, SLOT(handleColumnGap()));
-	connect(columnGapLabel, SIGNAL(activated(int))      , this, SLOT(handleGapSwitch()));
-	connect(topDistance   , SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances()));
-	connect(leftDistance  , SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances()));
-	connect(rightDistance , SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances()));
-	connect(bottomDistance, SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances()));
-	connect(tabsButton    , SIGNAL(clicked())           , this, SLOT(handleTabs()));
+	connect(columns       , SIGNAL(valueChanged(int))   , this, SLOT(handleColumns()), Qt::UniqueConnection);
+	connect(columnGap     , SIGNAL(valueChanged(double)), this, SLOT(handleColumnGap()), Qt::UniqueConnection);
+	connect(columnGapLabel, SIGNAL(activated(int))      , this, SLOT(handleGapSwitch()), Qt::UniqueConnection);
+	connect(topDistance   , SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances()), Qt::UniqueConnection);
+	connect(leftDistance  , SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances()), Qt::UniqueConnection);
+	connect(rightDistance , SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances()), Qt::UniqueConnection);
+	connect(bottomDistance, SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances()), Qt::UniqueConnection);
+	connect(tabsButton    , SIGNAL(clicked())           , this, SLOT(handleTabs()), Qt::UniqueConnection);
 }
 
 void PropertyWidget_Distance::disconnectSignals()
@@ -174,17 +172,21 @@
 	disconnect(tabsButton    , SIGNAL(clicked())           , this, SLOT(handleTabs()));
 }
 
-void PropertyWidget_Distance::enableFromSelection(void)
+void PropertyWidget_Distance::configureWidgets(void)
 {
 	bool enabled = false;
 	if (m_item && m_doc)
 	{
-		enabled  = m_item->isTextFrame();
+		PageItem_TextFrame *textItem = m_item->asTextFrame();
+		if (m_doc->appMode == modeEditTable)
+			textItem = m_item->asTable()->activeCell().textFrame();
+
+		enabled  = (textItem != NULL);
 		enabled &= (m_doc->m_Selection->count() == 1);
 
-		if (m_item->asTextFrame())
+		if (textItem)
 		{
-			int numCols = m_item->asTextFrame()->Cols;
+			int numCols = textItem->Cols;
 			
 			columnGap->setEnabled(numCols != 1);
 			columnGapLabel->setEnabled(numCols != 1);
@@ -193,6 +195,14 @@
 	setEnabled(enabled);
 }
 
+void PropertyWidget_Distance::handleAppModeChanged(int oldMode, int mode)
+{
+	if (oldMode == modeEditTable || mode == modeEditTable)
+	{
+		setCurrentItem(m_item);
+	}
+}
+
 void PropertyWidget_Distance::handleSelectionChanged()
 {
 	if (!m_doc || !m_ScMW || m_ScMW->scriptIsRunning())
@@ -222,6 +232,9 @@
 	if (m_item)
 	{
 		PageItem_TextFrame *textItem = m_item->asTextFrame();
+		if (m_doc->appMode == modeEditTable)
+			textItem = m_item->asTable()->activeCell().textFrame();
+
 		if (textItem != 0)
 		{
 			columns->setMaximum(qMax(qRound(textItem->width() / qMax(textItem->ColGap, 10.0)), 1));
@@ -258,46 +271,70 @@
 {
 	if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning())
 		return;
-	m_item->Cols = columns->value();
-	displayColumns(m_item->Cols, m_item->ColGap);
-	if (columns->value() == 1)
-	{
-		columnGap->setEnabled(false);
-		columnGapLabel->setEnabled(false);
-	}
+
+	PageItem *textItem = m_item;
+	if (m_doc->appMode == modeEditTable)
+		textItem = m_item->asTable()->activeCell().textFrame();
+
+	if (textItem)
+	{
+		textItem->Cols = columns->value();
+		displayColumns(textItem->Cols, textItem->ColGap);
+		if (columns->value() == 1)
+		{
+			columnGap->setEnabled(false);
+			columnGapLabel->setEnabled(false);
+		}
+		else
+		{
+			columnGap->setEnabled(true);
+			columnGapLabel->setEnabled(true);
+		}
+		textItem->update();
+		if (m_doc->appMode == modeEditTable)
+			m_item->asTable()->update();
+		m_doc->regionsChanged()->update(QRect());
+	}
+}
+
+void PropertyWidget_Distance::handleColumnGap()
+{
+	if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning())
+		return;
+
+	PageItem *textItem = m_item;
+	if (m_doc->appMode == modeEditTable)
+		textItem = m_item->asTable()->activeCell().textFrame();
+	if (!textItem) return;
+
+	if (columnGapLabel->currentIndex() == 0)
+		textItem->ColGap = columnGap->value() / m_unitRatio;
 	else
 	{
-		columnGap->setEnabled(true);
-		columnGapLabel->setEnabled(true);
-	}
-	m_item->update();
-}
-
-void PropertyWidget_Distance::handleColumnGap()
-{
-	if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	if (columnGapLabel->currentIndex() == 0)
-		m_item->ColGap = columnGap->value() / m_unitRatio;
-	else
-	{
 		double lineCorr;
-		if ((m_item->lineColor() != CommonStrings::None) || (!m_item->strokePattern().isEmpty()))
-			lineCorr = m_item->lineWidth();
+		if ((textItem->lineColor() != CommonStrings::None) || (!textItem->strokePattern().isEmpty()))
+			lineCorr = textItem->lineWidth();
 		else
 			lineCorr = 0;
 		double newWidth = columnGap->value() / m_unitRatio;
-		double newGap = qMax(((m_item->width() - m_item->textToFrameDistLeft() - m_item->textToFrameDistRight() - lineCorr) - (newWidth * m_item->Cols)) / (m_item->Cols - 1), 0.0);
-		m_item->ColGap = newGap;
-	}
-	m_item->update();
+		double newGap = qMax(((textItem->width() - textItem->textToFrameDistLeft() - textItem->textToFrameDistRight() - lineCorr) - (newWidth * textItem->Cols)) / (textItem->Cols - 1), 0.0);
+		textItem->ColGap = newGap;
+	}
+	textItem->update();
+	if (m_doc->appMode == modeEditTable)
+		m_item->asTable()->update();
+	m_doc->regionsChanged()->update(QRect());
 }
 
 void PropertyWidget_Distance::handleGapSwitch()
 {
 	if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning())
 		return;
-	displayColumns(m_item->Cols, m_item->ColGap);
+	PageItem *textItem = m_item;
+	if (m_doc->appMode == modeEditTable)
+		textItem = m_item->asTable()->activeCell().textFrame();
+	if (textItem != NULL)
+		displayColumns(textItem->Cols, textItem->ColGap);
 
 	int index = columnGapLabel->currentIndex();
 	columnGap->setToolTip((index == 0) ? tr( "Distance between columns" ) : tr( "Column width" ));
@@ -334,18 +371,25 @@
 
 void PropertyWidget_Distance::handleTextDistances()
 {
-	if (!m_ScMW || m_ScMW->scriptIsRunning())
-		return;
-	if (m_doc && m_item)
-	{
-		double left   = leftDistance->value() / m_unitRatio;
-		double right  = rightDistance->value() / m_unitRatio;
-		double top    = topDistance->value() / m_unitRatio;
-		double bottom = bottomDistance->value() / m_unitRatio;
-		m_item->setTextToFrameDist(left, right, top, bottom);
-		displayColumns(m_item->Cols, m_item->ColGap);
-		m_item->update();
-	}
+	if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning())
+		return;
+
+	PageItem *textItem = m_item;
+	if (m_doc->appMode == modeEditTable)
+		textItem = m_item->asTable()->activeCell().textFrame();
+	if (!textItem) return;
+
+	double left   = leftDistance->value() / m_unitRatio;
+	double right  = rightDistance->value() / m_unitRatio;
+	double top    = topDistance->value() / m_unitRatio;
+	double bottom = bottomDistance->value() / m_unitRatio;
+	textItem->setTextToFrameDist(left, right, top, bottom);
+	displayColumns(textItem->Cols, textItem->ColGap);
+
+	textItem->update();
+	if (m_doc->appMode == modeEditTable)
+		m_item->asTable()->update();
+	m_doc->regionsChanged()->update(QRect());
 }
 
 void PropertyWidget_Distance::changeEvent(QEvent *e)

Modified: branches/ScribusOIF/scribus/ui/propertywidget_distance.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_distance.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_distance.h (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_distance.h Mon Mar 19 22:27:37 2012
@@ -33,7 +33,7 @@
 	double m_unitRatio;
 	int    m_unitIndex;
 
-	void enableFromSelection(void);
+	void configureWidgets(void);
 	void setCurrentItem(PageItem *item);
 
 	virtual void changeEvent(QEvent *e);
@@ -42,6 +42,7 @@
 	void setMainWindow(ScribusMainWindow *mw);
 	void setDoc(ScribusDoc *d);
 
+	void handleAppModeChanged(int oldMode, int mode);
 	void handleSelectionChanged();
 	void handleUpdateRequest(int);
 

Modified: branches/ScribusOIF/scribus/ui/propertywidget_dropcap.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_dropcap.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_dropcap.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_dropcap.cpp Mon Mar 19 22:27:37 2012
@@ -5,15 +5,17 @@
 for which a new license (GPL+exception) is in place.
 */
 
-#include "pageitem_table.h"
+#include "pageitem.h"
+#include "pageitem_table.h"
 #include "propertywidget_dropcap.h"
 #include "scribus.h"
-#include "selection.h"
+#include "selection.h"
 #include "units.h"
 #include "util.h"
 
 PropertyWidget_DropCap::PropertyWidget_DropCap(QWidget *parent) : QFrame(parent)
 {
+	m_item = 0;
 	m_ScMW = 0;
 
     setupUi(this);
@@ -31,20 +33,61 @@
 {
 	m_ScMW = mw;
 
+	connect(m_ScMW, SIGNAL(AppModeChanged(int, int)), this, SLOT(handleAppModeChanged(int, int)));
 	connect(m_ScMW, SIGNAL(UpdateRequest(int)), this  , SLOT(handleUpdateRequest(int)));
 }
 
 void PropertyWidget_DropCap::setDoc(ScribusDoc *doc)
 {
+	if(doc == (ScribusDoc*) m_doc)
+		return;
+
+	if (m_doc)
+	{
+		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
+	}
+
 	m_doc = doc;
 	dropCapCharStyleCombo->setDoc(doc);
 
-	if (!m_doc)
-		return;
+	if (m_doc.isNull())
+	{
+		disconnectSignals();
+		return;
+	}
 
 	m_unitRatio   = m_doc->unitRatio();
 	m_unitIndex   = m_doc->unitIndex();
 	dropCapOffset->setSuffix(unitGetSuffixFromIndex(0));
+
+	connect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+	connect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
+}
+
+void PropertyWidget_DropCap::setCurrentItem(PageItem *item)
+{
+	if (item && m_doc.isNull())
+		setDoc(item->doc());
+
+	m_item = item;
+
+	disconnectSignals();
+	configureWidgets();
+
+	if (!m_item) return;
+
+	if (m_item->asTextFrame() || m_item->asPathText() || m_item->asTable())
+	{
+		ParagraphStyle parStyle =  m_item->itemText.defaultStyle();
+		if (m_doc->appMode == modeEdit)
+			m_item->currentTextProps(parStyle);
+		else if (m_doc->appMode == modeEditTable)
+			m_item->asTable()->activeCell().textFrame()->currentTextProps(parStyle);
+		updateStyle(parStyle);
+
+		connectSignals();
+	}
 }
 
 void PropertyWidget_DropCap::unitChange()
@@ -91,10 +134,10 @@
 
 void PropertyWidget_DropCap::connectSignals()
 {
-	connect(dropCapBox, SIGNAL(stateChanged(int)), this, SLOT(handleDropCapUse()));
-	connect(dropCapLines, SIGNAL(valueChanged(int)), this, SLOT(handleDropCapLines()));
-	connect(dropCapOffset, SIGNAL(valueChanged(double)), this, SLOT(handleDropCapOffset()));
-	connect(dropCapCharStyleCombo, SIGNAL(activated(int)), this, SLOT(handleDropCapCharStyle()));
+	connect(dropCapBox, SIGNAL(stateChanged(int)), this, SLOT(handleDropCapUse()), Qt::UniqueConnection);
+	connect(dropCapLines, SIGNAL(valueChanged(int)), this, SLOT(handleDropCapLines()), Qt::UniqueConnection);
+	connect(dropCapOffset, SIGNAL(valueChanged(double)), this, SLOT(handleDropCapOffset()), Qt::UniqueConnection);
+	connect(dropCapCharStyleCombo, SIGNAL(activated(int)), this, SLOT(handleDropCapCharStyle()), Qt::UniqueConnection);
 }
 
 void PropertyWidget_DropCap::disconnectSignals()
@@ -105,74 +148,37 @@
 	disconnect(dropCapCharStyleCombo, SIGNAL(activated(int)), this, SLOT(handleDropCapCharStyle()));
 }
 
-void PropertyWidget_DropCap::handleDropCapUse()
-{
-	if (!m_doc) return;
-	ParagraphStyle newStyle;
-	newStyle.setHasDropCap(dropCapBox->isChecked());
-	PageItem *i2 = m_doc->m_Selection->itemAt(0);
-	if (m_doc->appMode == modeEditTable)
-		i2 = i2->asTable()->activeCell().textFrame();
-	if (i2 != NULL)
-	{
-		Selection tempSelection(this, false);
-		tempSelection.addItem(i2, true);
-		m_doc->itemSelection_ApplyParagraphStyle(newStyle, &tempSelection);
-	}
-	enableDropCap(dropCapBox->isChecked());
-}
-
-void PropertyWidget_DropCap::handleDropCapLines()
-{
-	if (!m_doc) return;
-	ParagraphStyle newStyle;
-	newStyle.setDropCapLines(dropCapLines->value());
-	newStyle.setHasDropCap(dropCapBox->isChecked());
-	PageItem *i2 = m_doc->m_Selection->itemAt(0);
-	if (m_doc->appMode == modeEditTable)
-		i2 = i2->asTable()->activeCell().textFrame();
-	if (i2 != NULL)
-	{
-		Selection tempSelection(this, false);
-		tempSelection.addItem(i2, true);
-		m_doc->itemSelection_ApplyParagraphStyle(newStyle, &tempSelection);
-	}
-}
-
-void PropertyWidget_DropCap::handleDropCapOffset()
-{
-	if (!m_doc) return;
-	ParagraphStyle newStyle;
-	newStyle.setDropCapOffset(dropCapOffset->value());
-	newStyle.setHasDropCap(dropCapBox->isChecked());
-	PageItem *i2 = m_doc->m_Selection->itemAt(0);
-	if (m_doc->appMode == modeEditTable)
-		i2 = i2->asTable()->activeCell().textFrame();
-	if (i2 != NULL)
-	{
-		Selection tempSelection(this, false);
-		tempSelection.addItem(i2, true);
-		m_doc->itemSelection_ApplyParagraphStyle(newStyle, &tempSelection);
-	}
-}
-
-void PropertyWidget_DropCap::handleDropCapCharStyle()
-{
-	if (!m_doc) return;
-	ParagraphStyle newStyle;
-	QString name = dropCapCharStyleCombo->currentText();
-	if (!name.isEmpty())
-		newStyle.setDcCharStyleName(name);
-	newStyle.setHasDropCap(dropCapBox->isChecked());
-	PageItem *i2 = m_doc->m_Selection->itemAt(0);
-	if (m_doc->appMode == modeEditTable)
-		i2 = i2->asTable()->activeCell().textFrame();
-	if (i2 != NULL)
-	{
-		Selection tempSelection(this, false);
-		tempSelection.addItem(i2, true);
-		m_doc->itemSelection_ApplyParagraphStyle(newStyle, &tempSelection);
-	}
+void PropertyWidget_DropCap::configureWidgets(void)
+{
+	bool enabled = false;
+	if (m_item && m_doc)
+	{
+		PageItem_TextFrame *textItem = m_item->asTextFrame();
+		if (m_doc->appMode == modeEditTable)
+			textItem = m_item->asTable()->activeCell().textFrame();
+		if (textItem || m_item->asPathText())
+			enabled = true;
+	}
+	setEnabled(enabled);
+}
+
+void PropertyWidget_DropCap::handleAppModeChanged(int oldMode, int mode)
+{
+	if (oldMode == modeEditTable || mode == modeEditTable)
+	{
+		setCurrentItem(m_item);
+	}
+}
+
+void PropertyWidget_DropCap::handleSelectionChanged()
+{
+	if (!m_doc || !m_ScMW || m_ScMW->scriptIsRunning())
+		return;
+
+	PageItem* currItem = currentItemFromSelection();
+	setCurrentItem(currItem);
+	updateGeometry();
+	repaint();
 }
 
 void PropertyWidget_DropCap::handleUpdateRequest(int updateFlags)
@@ -181,6 +187,80 @@
 		updateCharStyles();
 	if (updateFlags & reqStyleComboDocUpdate)
 		setDoc(m_doc ? m_doc : 0);
+}
+
+void PropertyWidget_DropCap::handleDropCapUse()
+{
+	if (!m_doc || !m_item)
+		return;
+	ParagraphStyle newStyle;
+	newStyle.setHasDropCap(dropCapBox->isChecked());
+	PageItem *item = m_item;
+	if (m_doc->appMode == modeEditTable)
+		item = item->asTable()->activeCell().textFrame();
+	if (item != NULL)
+	{
+		Selection tempSelection(this, false);
+		tempSelection.addItem(item, true);
+		m_doc->itemSelection_ApplyParagraphStyle(newStyle, &tempSelection);
+	}
+	enableDropCap(dropCapBox->isChecked());
+}
+
+void PropertyWidget_DropCap::handleDropCapLines()
+{
+	if (!m_doc || !m_item)
+		return;
+	ParagraphStyle newStyle;
+	newStyle.setDropCapLines(dropCapLines->value());
+	newStyle.setHasDropCap(dropCapBox->isChecked());
+	PageItem *item = m_doc->m_Selection->itemAt(0);
+	if (m_doc->appMode == modeEditTable)
+		item = item->asTable()->activeCell().textFrame();
+	if (item != NULL)
+	{
+		Selection tempSelection(this, false);
+		tempSelection.addItem(item, true);
+		m_doc->itemSelection_ApplyParagraphStyle(newStyle, &tempSelection);
+	}
+}
+
+void PropertyWidget_DropCap::handleDropCapOffset()
+{
+	if (!m_doc || !m_item)
+		return;
+	ParagraphStyle newStyle;
+	newStyle.setDropCapOffset(dropCapOffset->value());
+	newStyle.setHasDropCap(dropCapBox->isChecked());
+	PageItem *item = m_item;
+	if (m_doc->appMode == modeEditTable)
+		item = item->asTable()->activeCell().textFrame();
+	if (item != NULL)
+	{
+		Selection tempSelection(this, false);
+		tempSelection.addItem(item, true);
+		m_doc->itemSelection_ApplyParagraphStyle(newStyle, &tempSelection);
+	}
+}
+
+void PropertyWidget_DropCap::handleDropCapCharStyle()
+{
+	if (!m_doc || !m_item)
+		return;
+	ParagraphStyle newStyle;
+	QString name = dropCapCharStyleCombo->currentText();
+	if (!name.isEmpty())
+		newStyle.setDcCharStyleName(name);
+	newStyle.setHasDropCap(dropCapBox->isChecked());
+	PageItem *item = m_item;
+	if (m_doc->appMode == modeEditTable)
+		item = item->asTable()->activeCell().textFrame();
+	if (item != NULL)
+	{
+		Selection tempSelection(this, false);
+		tempSelection.addItem(item, true);
+		m_doc->itemSelection_ApplyParagraphStyle(newStyle, &tempSelection);
+	}
 }
 
 void PropertyWidget_DropCap::changeEvent(QEvent *e)

Modified: branches/ScribusOIF/scribus/ui/propertywidget_dropcap.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_dropcap.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_dropcap.h (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_dropcap.h Mon Mar 19 22:27:37 2012
@@ -5,6 +5,7 @@
 
 #include "propertywidgetbase.h"
 
+class PageItem;
 class ParagraphStyle;
 class ScribusMainWindow;
 
@@ -25,7 +26,11 @@
 	double m_unitRatio;
 	int    m_unitIndex;
 
+	PageItem *         m_item;
 	ScribusMainWindow* m_ScMW;
+
+	void configureWidgets();
+	void setCurrentItem(PageItem *item);
 
 	virtual void changeEvent(QEvent *e);
 
@@ -33,6 +38,8 @@
 	void setMainWindow(ScribusMainWindow *mw);
 	void setDoc(ScribusDoc *doc);
 
+	void handleAppModeChanged(int oldMode, int mode);
+	void handleSelectionChanged();
 	void handleUpdateRequest(int);
 
 	void languageChange();

Modified: branches/ScribusOIF/scribus/ui/propertywidget_group.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_group.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_group.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_group.cpp Mon Mar 19 22:27:37 2012
@@ -110,7 +110,7 @@
 	m_item = item;
 
 	disconnectSignals();
-	enableFromSelection();
+	configureWidgets();
 
 	if (m_item)
 	{
@@ -146,7 +146,7 @@
 	disconnect(groupTransWidget, SIGNAL(NewSpecial(double, double, double, double, double, double, double, double, double, double)), this, SLOT(handleSpecialGradient(double, double, double, double, double, double, double, double )));
 }
 
-void PropertyWidget_Group::enableFromSelection(void)
+void PropertyWidget_Group::configureWidgets(void)
 {
 	bool widgetEnabled = false;
 	if (m_item && m_doc)

Modified: branches/ScribusOIF/scribus/ui/propertywidget_group.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_group.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_group.h (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_group.h Mon Mar 19 22:27:37 2012
@@ -41,7 +41,7 @@
 	void connectSignals();
 	void disconnectSignals();
 
-	void enableFromSelection(void);
+	void configureWidgets(void);
 	void setCurrentItem(PageItem *item);
 
 	virtual void changeEvent(QEvent *e);

Modified: branches/ScribusOIF/scribus/ui/propertywidget_groupshape.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_groupshape.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_groupshape.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_groupshape.cpp Mon Mar 19 22:27:37 2012
@@ -77,7 +77,7 @@
 	customShape->setEnabled(enabled);
 }
 
-void PropertyWidget_GroupShape::enableFromSelection(void)
+void PropertyWidget_GroupShape::configureWidgets(void)
 {
 	bool enabled = false;
 
@@ -184,7 +184,7 @@
 	m_item = item;
 
 	disconnectSignals();
-	enableFromSelection();
+	configureWidgets();
 
 	if (m_item)
 	{

Modified: branches/ScribusOIF/scribus/ui/propertywidget_groupshape.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_groupshape.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_groupshape.h (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_groupshape.h Mon Mar 19 22:27:37 2012
@@ -37,7 +37,7 @@
 protected:
 
 	void enableCustomShape();
-	void enableFromSelection(void);
+	void configureWidgets(void);
 	void setCurrentItem(PageItem *i);
 
 private slots:

Modified: branches/ScribusOIF/scribus/ui/propertywidget_image.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_image.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_image.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_image.cpp Mon Mar 19 22:27:37 2012
@@ -171,7 +171,7 @@
 	m_item = item;
 
 	disconnectSignals();
-	enableFromSelection();
+	configureWidgets();
 
 	if (m_item)
 	{
@@ -252,7 +252,7 @@
 	disconnect(compressionQuality , SIGNAL(activated(int))      , this, SLOT(handleCompressionQuality()));
 }
 
-void PropertyWidget_Image::enableFromSelection(void)
+void PropertyWidget_Image::configureWidgets(void)
 {
 	bool enabled = false;
 	if (m_item && m_doc)

Modified: branches/ScribusOIF/scribus/ui/propertywidget_image.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_image.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_image.h (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_image.h Mon Mar 19 22:27:37 2012
@@ -40,7 +40,7 @@
 	void connectSignals();
 	void disconnectSignals();
 
-	void enableFromSelection(void);
+	void configureWidgets(void);
 	void setCurrentItem(PageItem *item);
 
 	UserActionSniffer *userActionSniffer;

Modified: branches/ScribusOIF/scribus/ui/propertywidget_line.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_line.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_line.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_line.cpp Mon Mar 19 22:27:37 2012
@@ -214,7 +214,7 @@
 	m_item = item;
 
 	disconnectSignals();
-	enableFromSelection();
+	configureWidgets();
 
 	if (!m_item)
 	{
@@ -287,7 +287,7 @@
 	connectSignals();
 }
 
-void PropertyWidget_Line::enableFromSelection(void)
+void PropertyWidget_Line::configureWidgets(void)
 {
 	if (!m_item || !m_doc)
 	{

Modified: branches/ScribusOIF/scribus/ui/propertywidget_line.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_line.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_line.h (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_line.h Mon Mar 19 22:27:37 2012
@@ -43,7 +43,7 @@
 	void connectSignals();
 	void disconnectSignals();
 
-	void enableFromSelection(void);
+	void configureWidgets(void);
 	void setCurrentItem(PageItem *i);
 
 	virtual void changeEvent(QEvent *e);

Modified: branches/ScribusOIF/scribus/ui/propertywidget_optmargins.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_optmargins.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_optmargins.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_optmargins.cpp Mon Mar 19 22:27:37 2012
@@ -5,8 +5,8 @@
 for which a new license (GPL+exception) is in place.
 */
 
+#include "pageitem_table.h"
 #include "propertywidget_optmargins.h"
-
 #include "scribus.h"
 #include "scribusdoc.h"
 #include "selection.h"
@@ -15,6 +15,9 @@
 
 PropertyWidget_OptMargins::PropertyWidget_OptMargins(QWidget* parent) : QFrame(parent)
 {
+	m_item = 0;
+	m_ScMW = 0;
+
 	setupUi(this);
 
 	setFrameStyle(QFrame::Box | QFrame::Plain);
@@ -28,6 +31,7 @@
 {
 	m_ScMW = mw;
 
+	connect(m_ScMW, SIGNAL(AppModeChanged(int, int)), this, SLOT(handleAppModeChanged(int, int)));
 	connect(m_ScMW, SIGNAL(UpdateRequest(int)), this  , SLOT(handleUpdateRequest(int)));
 }
 
@@ -72,7 +76,7 @@
 	m_item = item;
 
 	disconnectSignals();
-	enableFromSelection();
+	configureWidgets();
 
 	if (m_item)
 	{
@@ -106,15 +110,27 @@
 	disconnect(optMarginResetButton, SIGNAL(clicked()), this, SLOT(resetOpticalMargins()) );
 }
 
-void PropertyWidget_OptMargins::enableFromSelection(void)
+void PropertyWidget_OptMargins::configureWidgets(void)
 {
 	bool enabled = false;
 	if (m_item && m_doc)
 	{
-		enabled  = (m_item->isPathText() || m_item->isTextFrame());
+		PageItem_TextFrame* textItem = m_item->asTextFrame();
+		if (m_doc->appMode == modeEditTable)
+			textItem = m_item->asTable()->activeCell().textFrame();
+
+		enabled  = (m_item->isPathText() || (textItem != NULL));
 		enabled &= (m_doc->m_Selection->count() == 1);
 	}
 	setEnabled(enabled);
+}
+
+void PropertyWidget_OptMargins::handleAppModeChanged(int oldMode, int mode)
+{
+	if (oldMode == modeEditTable || mode == modeEditTable)
+	{
+		setCurrentItem(m_item);
+	}
 }
 
 void PropertyWidget_OptMargins::handleSelectionChanged()
@@ -160,14 +176,30 @@
 	else if (optMarginRadioRight->isChecked())
 		omt = ParagraphStyle::OM_RightHangingPunct;
 
-	m_doc->itemSelection_SetOpticalMargins(omt);
+	PageItem *item = m_item;
+	if (m_doc->appMode == modeEditTable)
+		item = m_item->asTable()->activeCell().textFrame();
+	if (item != NULL)
+	{
+		Selection tempSelection(this, false);
+		tempSelection.addItem(item, true);
+		m_doc->itemSelection_SetOpticalMargins(omt, &tempSelection);
+	}
 }
 
 void PropertyWidget_OptMargins::resetOpticalMargins()
 {
 	if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning())
 		return;
-	m_doc->itemSelection_resetOpticalMargins();
+	PageItem *item = m_item;
+	if (m_doc->appMode == modeEditTable)
+		item = m_item->asTable()->activeCell().textFrame();
+	if (item != NULL)
+	{
+		Selection tempSelection(this, false);
+		tempSelection.addItem(item, true);
+		m_doc->itemSelection_resetOpticalMargins(&tempSelection);
+	}
 }
 
 void PropertyWidget_OptMargins::changeEvent(QEvent *e)

Modified: branches/ScribusOIF/scribus/ui/propertywidget_optmargins.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_optmargins.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_optmargins.h (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_optmargins.h Mon Mar 19 22:27:37 2012
@@ -33,7 +33,7 @@
 	void connectSignals();
 	void disconnectSignals();
 
-	void enableFromSelection(void);
+	void configureWidgets(void);
 	void setCurrentItem(PageItem *item);
 
 	virtual void changeEvent(QEvent *e);
@@ -42,6 +42,7 @@
 	void setMainWindow(ScribusMainWindow *mw);
 	void setDoc(ScribusDoc *d);
 
+	void handleAppModeChanged(int oldMode, int mode);
 	void handleSelectionChanged();
 	void handleUpdateRequest(int) {};
 

Modified: branches/ScribusOIF/scribus/ui/propertywidget_pathtext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_pathtext.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_pathtext.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_pathtext.cpp Mon Mar 19 22:27:37 2012
@@ -92,7 +92,7 @@
 	m_item = item;
 
 	disconnectSignals();
-	enableFromSelection();
+	configureWidgets();
 
 	if (m_item)
 	{
@@ -126,7 +126,7 @@
 	disconnect(distFromCurve    , SIGNAL(valueChanged(double)), this, SLOT(handlePathOffs()));
 }
 
-void PropertyWidget_PathText::enableFromSelection(void)
+void PropertyWidget_PathText::configureWidgets(void)
 {
 	bool enabled = false;
 	if (m_item && m_doc)

Modified: branches/ScribusOIF/scribus/ui/propertywidget_pathtext.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_pathtext.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_pathtext.h (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_pathtext.h Mon Mar 19 22:27:37 2012
@@ -33,7 +33,7 @@
 	void connectSignals();
 	void disconnectSignals();
 
-	void enableFromSelection(void);
+	void configureWidgets(void);
 	void setCurrentItem(PageItem *item);
 
 	virtual void changeEvent(QEvent *e);

Modified: branches/ScribusOIF/scribus/ui/propertywidget_pos.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_pos.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_pos.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_pos.cpp Mon Mar 19 22:27:37 2012
@@ -174,7 +174,7 @@
 	disconnect(doUngroup, SIGNAL(clicked()), this, SLOT(handleUngrouping()) );
 }
 
-void PropertyWidget_Position::enableFromSelection(void)
+void PropertyWidget_Position::configureWidgets(void)
 {
 	bool enabled = false;
 
@@ -312,7 +312,7 @@
 
 	if (m_doc.isNull())
 	{
-		enableFromSelection();
+		configureWidgets();
 		disconnectSignals();
 		return;
 	}
@@ -383,7 +383,7 @@
 	m_item = item;
 
 	disconnectSignals();
-	enableFromSelection();
+	configureWidgets();
 
 	if (m_item)
 	{

Modified: branches/ScribusOIF/scribus/ui/propertywidget_pos.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_pos.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_pos.h (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_pos.h Mon Mar 19 22:27:37 2012
@@ -50,7 +50,7 @@
 	void connectSignals();
 	void disconnectSignals();
 
-	void enableFromSelection(void);
+	void configureWidgets(void);
 	void setCurrentItem(PageItem *i);
 
 	bool      _userActionOn;

Modified: branches/ScribusOIF/scribus/ui/propertywidget_shape.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_shape.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_shape.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_shape.cpp Mon Mar 19 22:27:37 2012
@@ -112,7 +112,7 @@
 	customShape->setEnabled(enabled);
 }
 
-void PropertyWidget_Shape::enableFromSelection(void)
+void PropertyWidget_Shape::configureWidgets(void)
 {
 	bool enabled = false;
 
@@ -226,7 +226,7 @@
 
 	if (m_doc.isNull())
 	{
-		enableFromSelection();
+		configureWidgets();
 		disconnectSignals();
 		return;
 	}
@@ -304,7 +304,7 @@
 	m_item = item;
 
 	disconnectSignals();
-	enableFromSelection();
+	configureWidgets();
 
 	if (m_item)
 	{

Modified: branches/ScribusOIF/scribus/ui/propertywidget_shape.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_shape.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_shape.h (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_shape.h Mon Mar 19 22:27:37 2012
@@ -47,7 +47,7 @@
 	ScribusMainWindow *m_ScMW;
 
 	void enableCustomShape();
-	void enableFromSelection(void);
+	void configureWidgets(void);
 	void setCurrentItem(PageItem *i);
 
 public slots:

Modified: branches/ScribusOIF/scribus/ui/propertywidget_text.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_text.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_text.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_text.cpp Mon Mar 19 22:27:37 2012
@@ -146,7 +146,7 @@
 	m_item = item;
 
 	disconnectSignals();
-	enableFromSelection();
+	configureWidgets();
 
 	if (m_item)
 	{
@@ -195,7 +195,7 @@
 	
 }
 
-void PropertyWidget_Text::enableFromSelection(void)
+void PropertyWidget_Text::configureWidgets(void)
 {
 	bool enabled = false;
 	if (m_item && m_doc)

Modified: branches/ScribusOIF/scribus/ui/propertywidget_text.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_text.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_text.h (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_text.h Mon Mar 19 22:27:37 2012
@@ -40,7 +40,7 @@
 	void connectSignals();
 	void disconnectSignals();
 	
-	void enableFromSelection(void);
+	void configureWidgets(void);
 	void setCurrentItem(PageItem *item);
 
 	virtual void changeEvent(QEvent *e);

Modified: branches/ScribusOIF/scribus/ui/propertywidget_textcolor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_textcolor.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_textcolor.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_textcolor.cpp Mon Mar 19 22:27:37 2012
@@ -97,7 +97,7 @@
 	{
 		m_item = item;
 		disconnectSignals();
-		enableFromSelection();
+		configureWidgets();
 		if (m_item)
 		{
 			PageItem_TextFrame *i2;
@@ -157,7 +157,7 @@
 	disconnect(textEffects->StrikeVal->LWidth   , SIGNAL(valueChanged(double)), this, SLOT(handleStrikeThru()));
 }
 
-void PropertyWidget_TextColor::enableFromSelection(void)
+void PropertyWidget_TextColor::configureWidgets(void)
 {
 	bool enabled = false;
 	if (m_item && m_doc)

Modified: branches/ScribusOIF/scribus/ui/propertywidget_textcolor.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_textcolor.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_textcolor.h (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_textcolor.h Mon Mar 19 22:27:37 2012
@@ -32,7 +32,7 @@
 	void connectSignals();
 	void disconnectSignals();
 
-	void enableFromSelection(void);
+	void configureWidgets(void);
 	void setCurrentItem(PageItem *i);
 
 	virtual void changeEvent(QEvent *e);

Modified: branches/ScribusOIF/scribus/ui/propertywidget_textstyles.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_textstyles.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_textstyles.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_textstyles.cpp Mon Mar 19 22:27:37 2012
@@ -75,7 +75,7 @@
 	m_item = item;
 
 	disconnectSignals();
-	enableFromSelection();
+	configureWidgets();
 
 	if (m_item)
 	{
@@ -101,7 +101,7 @@
 	disconnect(charStyleCombo, SIGNAL(newStyle(const QString&)), m_ScMW, SLOT(setNewCharStyle(const QString&)));
 }
 
-void PropertyWidget_TextStyles::enableFromSelection(void)
+void PropertyWidget_TextStyles::configureWidgets(void)
 {
 	bool enabled = false;
 	if (m_item && m_doc)

Modified: branches/ScribusOIF/scribus/ui/propertywidget_textstyles.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/propertywidget_textstyles.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_textstyles.h (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_textstyles.h Mon Mar 19 22:27:37 2012
@@ -32,7 +32,7 @@
 	void connectSignals();
 	void disconnectSignals();
 
-	void enableFromSelection(void);
+	void configureWidgets(void);
 	void setCurrentItem(PageItem *item);
 
 	virtual void changeEvent(QEvent *e);

Modified: branches/ScribusOIF/scribus/ui/sctreewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17391&path=/branches/ScribusOIF/scribus/ui/sctreewidget.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/sctreewidget.cpp (original)
+++ branches/ScribusOIF/scribus/ui/sctreewidget.cpp Mon Mar 19 22:27:37 2012
@@ -50,12 +50,14 @@
 		buttonOption.state &= ~QStyle::State_HasFocus;
 		buttonOption.rect = option.rect;
 		buttonOption.palette = option.palette;
-		buttonOption.features = QStyleOptionButton::None;
 		m_view->style()->drawControl(QStyle::CE_PushButton, &buttonOption, painter, m_view);
 		static const int i = 9; // ### hardcoded in qcommonstyle.cpp
 		QRect r = option.rect;
 		painter->save();
-		painter->setBrush(Qt::black);
+		if (option.state & QStyle::State_Enabled)
+			painter->setBrush(Qt::black);
+		else
+			painter->setBrush(Qt::gray);
 		painter->setPen(Qt::NoPen);
 		QRect rect = QRect(r.left()+6, r.top()+6, r.height()-12, r.height()-12);
 		QPolygon pa(3);
@@ -99,6 +101,7 @@
 	header()->hide();
 	header()->setResizeMode(QHeaderView::Stretch);
 	viewport()->setBackgroundRole(QPalette::Window);
+	setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
 	m_toolbox_mode = false;
     connect(this, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(handleMousePress(QTreeWidgetItem*)));
 }
@@ -168,6 +171,9 @@
 		topLevelItem(index)->setFlags(Qt::ItemIsEnabled);
 	else
 		topLevelItem(index)->setFlags(0);
+	QTreeWidgetItem *child = topLevelItem(index)->child(0);
+	if (child != NULL)
+		itemWidget(child, 0)->setEnabled(enable);
 }
 
 bool ScTreeWidget::isItemEnabled(int index)




More information about the scribus-commit mailing list