r16228 by jghali - less direct calls to PP from mainWindow

scribus-commit scribus-commit at lists.scribus.net
Sat Jan 8 16:48:45 CET 2011


Author: jghali
Date: Sat Jan  8 15:48:44 2011
New Revision: 16228

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16228
Log:
less direct calls to PP from mainWindow

Modified:
    branches/ScribusOIF/scribus/scribus.cpp
    branches/ScribusOIF/scribus/scribusstructs.h
    branches/ScribusOIF/scribus/scribusview.cpp
    branches/ScribusOIF/scribus/ui/propertiespalette_image.cpp
    branches/ScribusOIF/scribus/ui/propertiespalette_image.h
    branches/ScribusOIF/scribus/ui/propertiespalette_shape.cpp
    branches/ScribusOIF/scribus/ui/propertiespalette_shape.h
    branches/ScribusOIF/scribus/ui/propertiespalette_text.cpp
    branches/ScribusOIF/scribus/ui/propertywidget_shape.cpp
    branches/ScribusOIF/scribus/ui/propertywidget_shape.h

Modified: branches/ScribusOIF/scribus/scribus.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16228&path=/branches/ScribusOIF/scribus/scribus.cpp
==============================================================================
--- branches/ScribusOIF/scribus/scribus.cpp (original)
+++ branches/ScribusOIF/scribus/scribus.cpp Sat Jan  8 15:48:44 2011
@@ -504,7 +504,7 @@
 	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->textPal->fonts->RebuildList(0);
+	emit UpdateRequest(reqDefFontListUpdate);
 	propertiesPalette->installEventFilter(this);
 
 	framePropsPalette = new PropertiesPalette_Frame(this);
@@ -2308,7 +2308,6 @@
 	propertiesPalette->setDoc(doc);
 	//propertiesPalette->Cpal->displayGradient(0);
 	pagePalette->setView(view);
-	propertiesPalette->textPal->fonts->RebuildList(doc);
 	layerPalette->setDoc(doc);
 	guidePalette->setDoc(doc);
 	charPalette->setDoc(doc);
@@ -3657,9 +3656,7 @@
 //		if ((docItemsCount - oldItemsCount) > 1)
 //			doc->GroupCounter++;
 		propertiesPalette->updateColorList();
-		propertiesPalette->textPal->paraStyleCombo->setDoc(doc);
-		propertiesPalette->textPal->charStyleCombo->setDoc(doc);
-		emit UpdateRequest(reqArrowStylesUpdate | reqLineStylesUpdate);
+		emit UpdateRequest(reqArrowStylesUpdate | reqLineStylesUpdate | reqStyleComboDocUpdate);
 		symbolPalette->updateSymbolList();
 		if (!Mpa)
 		{
@@ -4114,8 +4111,7 @@
 				propertiesPalette->imagePal->displayScaleAndOffset(currItem->imageXScale(), currItem->imageYScale(), currItem->imageXOffset(), currItem->imageYOffset());
 				qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
 				view->DrawNew();
-				propertiesPalette->updateColorList();
-				propertiesPalette->imagePal->showCMSOptions();
+				emit UpdateRequest(reqColorsUpdate | reqCmsOptionsUpdate);
 				currItem->emitAllToGUI();
 			}
 		}
@@ -4203,8 +4199,7 @@
 					propertiesPalette->imagePal->displayScaleAndOffset(currItem->imageXScale(), currItem->imageYScale(), currItem->imageXOffset(), currItem->imageYOffset());
 					qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
 					view->DrawNew();
-					propertiesPalette->updateColorList();
-					propertiesPalette->imagePal->showCMSOptions();
+					emit UpdateRequest(reqColorsUpdate | reqCmsOptionsUpdate);
 					currItem->emitAllToGUI();
 				}
 			}
@@ -6509,7 +6504,7 @@
 			doc->SubMode = modeToolBar->SubMode;
 			doc->ShapeValues = modeToolBar->ShapeVals;
 			doc->ValCount = modeToolBar->ValCount;
-			propertiesPalette->shapePal->setCustomShapeIcon(doc->SubMode);
+			emit UpdateRequest(reqCustomShapeUpdate);
 		}
 		else
 			doc->SubMode = -1;
@@ -7637,7 +7632,7 @@
 			apf.setPointSize(newUIFontSize);
 			qApp->setFont(apf);
 		}
-		propertiesPalette->textPal->fonts->RebuildList(0);
+		emit UpdateRequest(reqDefFontListUpdate);
 		if (prefsManager->appPrefs.uiPrefs.useTabs)
 			mdiArea->setViewMode(QMdiArea::TabbedView);
 		else
@@ -7797,7 +7792,7 @@
 			view->previewQualitySwitcher->setCurrentIndex(doc->itemToolPrefs().imageLowResType);
 			view->previewQualitySwitcher->blockSignals(false);
 		}
-		propertiesPalette->textPal->fonts->RebuildList(doc);
+		emit UpdateRequest(reqDocFontListUpdate);
 		scrActions["viewShowMargins"]->setChecked(doc->guidesPrefs().marginsShown);
 		scrActions["viewShowBleeds"]->setChecked(doc->guidesPrefs().showBleed);
 		scrActions["viewShowFrames"]->setChecked(doc->guidesPrefs().framesShown);
@@ -7820,8 +7815,8 @@
 		view->reformPages();
 		view->GotoPage(doc->currentPage()->pageNr());
 		view->DrawNew();
-		propertiesPalette->imagePal->showCMSOptions();
 		pagePalette->rebuildPages();
+		emit UpdateRequest(reqCmsOptionsUpdate);
 	}
 }
 int ScribusMainWindow::ShowSubs()
@@ -9842,7 +9837,7 @@
 				qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
 				view->DrawNew();
 				propertiesPalette->updateColorList();
-				propertiesPalette->imagePal->showCMSOptions();
+				emit UpdateRequest(reqCmsOptionsUpdate);
 				currItem->emitAllToGUI();
 			}
 		}

Modified: branches/ScribusOIF/scribus/scribusstructs.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16228&path=/branches/ScribusOIF/scribus/scribusstructs.h
==============================================================================
--- branches/ScribusOIF/scribus/scribusstructs.h (original)
+++ branches/ScribusOIF/scribus/scribusstructs.h Sat Jan  8 15:48:44 2011
@@ -345,6 +345,11 @@
 	reqArrowStylesUpdate = 8,
 	reqLineStylesUpdate  = 16,
 	reqSymbolsUpdate     = 32,
+	reqDefFontListUpdate = 64,
+	reqDocFontListUpdate = 128,
+	reqStyleComboDocUpdate = 256,
+	reqCmsOptionsUpdate  = 512,
+	reqCustomShapeUpdate = 1024,
 	reqUpdateAll = 65535
 };
 

Modified: branches/ScribusOIF/scribus/scribusview.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16228&path=/branches/ScribusOIF/scribus/scribusview.cpp
==============================================================================
--- branches/ScribusOIF/scribus/scribusview.cpp (original)
+++ branches/ScribusOIF/scribus/scribusview.cpp Sat Jan  8 15:48:44 2011
@@ -384,7 +384,7 @@
 void ScribusView::toggleCMS()
 {
 	Doc->enableCMS(!Doc->HasCMS);
-	m_ScMW->propertiesPalette->imagePal->showCMSOptions();
+	m_ScMW->requestUpdate(reqCmsOptionsUpdate);
 	DrawNew();
 }
 
@@ -398,7 +398,7 @@
 		{
 			Doc->enableCMS(Doc->cmsSettings().CMSinUse);
 			cmsToolbarButton->setChecked(Doc->HasCMS);
-			m_ScMW->propertiesPalette->imagePal->showCMSOptions();
+			m_ScMW->requestUpdate(reqCmsOptionsUpdate);;
 			DrawNew();
 		}
 	}

Modified: branches/ScribusOIF/scribus/ui/propertiespalette_image.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16228&path=/branches/ScribusOIF/scribus/ui/propertiespalette_image.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertiespalette_image.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertiespalette_image.cpp Sat Jan  8 15:48:44 2011
@@ -121,7 +121,8 @@
 {
 	m_ScMW = mw;
 
-	connect(this, SIGNAL(DocChanged()), m_ScMW, SLOT(slotDocCh()));
+	connect(this  , SIGNAL(DocChanged())      , m_ScMW, SLOT(slotDocCh()));
+	connect(m_ScMW, SIGNAL(UpdateRequest(int)), this  , SLOT(handleUpdateRequest(int)));
 }
 
 void PropertiesPalette_Image::setDoc(ScribusDoc *d)
@@ -397,6 +398,12 @@
 	repaint();
 }
 
+void PropertiesPalette_Image::handleUpdateRequest(int updateFlags)
+{
+	if (updateFlags & reqCmsOptionsUpdate)
+		showCMSOptions();
+}
+
 void PropertiesPalette_Image::setCurrentItem(PageItem *item)
 {
 	if (!m_ScMW || m_ScMW->scriptIsRunning())

Modified: branches/ScribusOIF/scribus/ui/propertiespalette_image.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16228&path=/branches/ScribusOIF/scribus/ui/propertiespalette_image.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertiespalette_image.h (original)
+++ branches/ScribusOIF/scribus/ui/propertiespalette_image.h Sat Jan  8 15:48:44 2011
@@ -65,6 +65,7 @@
 	void unsetItem();
 
 	void handleSelectionChanged();
+	void handleUpdateRequest(int updateFlags);
 
 	void displayImageRotation(double rot);
 	void displayScaleAndOffset(double scx, double scy, double x, double y);

Modified: branches/ScribusOIF/scribus/ui/propertiespalette_shape.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16228&path=/branches/ScribusOIF/scribus/ui/propertiespalette_shape.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertiespalette_shape.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertiespalette_shape.cpp Sat Jan  8 15:48:44 2011
@@ -86,7 +86,8 @@
 {
 	m_ScMW = mw;
 
-	connect(this, SIGNAL(DocChanged()), m_ScMW, SLOT(slotDocCh()));
+	connect(this  , SIGNAL(DocChanged())      , m_ScMW, SLOT(slotDocCh()));
+	connect(m_ScMW, SIGNAL(UpdateRequest(int)), this  , SLOT(handleUpdateRequest(int)));
 }
 
 void PropertiesPalette_Shape::setDoc(ScribusDoc *d)
@@ -287,6 +288,14 @@
 	repaint();
 }
 
+void PropertiesPalette_Shape::handleUpdateRequest(int updateFlags)
+{
+	if ((updateFlags & reqCustomShapeUpdate) && (m_haveDoc && m_doc))
+	{
+		setCustomShapeIcon(m_doc->SubMode);
+	}
+}
+
 void PropertiesPalette_Shape::setCurrentItem(PageItem *item)
 {
 	if (!m_ScMW || m_ScMW->scriptIsRunning())

Modified: branches/ScribusOIF/scribus/ui/propertiespalette_shape.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16228&path=/branches/ScribusOIF/scribus/ui/propertiespalette_shape.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertiespalette_shape.h (original)
+++ branches/ScribusOIF/scribus/ui/propertiespalette_shape.h Sat Jan  8 15:48:44 2011
@@ -64,6 +64,7 @@
 	void unsetItem();
 
 	void handleSelectionChanged();
+	void handleUpdateRequest(int);
 
 	void languageChange();
 	void unitChange();

Modified: branches/ScribusOIF/scribus/ui/propertiespalette_text.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16228&path=/branches/ScribusOIF/scribus/ui/propertiespalette_text.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertiespalette_text.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertiespalette_text.cpp Sat Jan  8 15:48:44 2011
@@ -280,6 +280,15 @@
 		charStyleCombo->updateFormatList();
 	if (updateFlags & reqParaStylesUpdate)
 		paraStyleCombo->updateFormatList();
+	if (updateFlags & reqDefFontListUpdate)
+		fonts->RebuildList(0);
+	if (updateFlags & reqDocFontListUpdate)
+		fonts->RebuildList(m_haveDoc ? m_doc : 0);
+	if (updateFlags & reqStyleComboDocUpdate)
+	{
+		paraStyleCombo->setDoc(m_haveDoc ? m_doc : 0);
+		charStyleCombo->setDoc(m_haveDoc ? m_doc : 0);
+	}
 }
 
 void PropertiesPalette_Text::setCurrentItem(PageItem *i)

Modified: branches/ScribusOIF/scribus/ui/propertywidget_shape.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16228&path=/branches/ScribusOIF/scribus/ui/propertywidget_shape.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_shape.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_shape.cpp Sat Jan  8 15:48:44 2011
@@ -196,7 +196,8 @@
 {
 	m_ScMW = mw;
 
-	connect(this, SIGNAL(DocChanged()), m_ScMW, SLOT(slotDocCh()));
+	connect(this  , SIGNAL(DocChanged())      , m_ScMW, SLOT(slotDocCh()));
+	connect(m_ScMW, SIGNAL(UpdateRequest(int)), this  , SLOT(handleUpdateRequest(int)));
 }
 
 void PropertyWidget_Shape::setDoc(ScribusDoc *d)
@@ -266,6 +267,14 @@
 	setCurrentItem(currItem);
 	updateGeometry();
 	repaint();
+}
+
+void PropertyWidget_Shape::handleUpdateRequest(int updateFlags)
+{
+	if ((updateFlags & reqCustomShapeUpdate) && m_doc)
+	{
+		setCustomShapeIcon(m_doc->SubMode);
+	}
 }
 
 void PropertyWidget_Shape::setCurrentItem(PageItem *item)

Modified: branches/ScribusOIF/scribus/ui/propertywidget_shape.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16228&path=/branches/ScribusOIF/scribus/ui/propertywidget_shape.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_shape.h (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_shape.h Sat Jan  8 15:48:44 2011
@@ -55,6 +55,7 @@
 	void setDoc(ScribusDoc *d);
 
 	void handleSelectionChanged();
+	void handleUpdateRequest(int);
 
 	void languageChange();
 	void unitChange();




More information about the scribus-commit mailing list