r19960 by craig - #12972: Fix updating of calligraphy pen values after doc setup is used

scribus-commit scribus-commit at lists.scribus.net
Thu Apr 2 21:57:54 UTC 2015


Author: craig
Date: Thu Apr  2 21:57:54 2015
New Revision: 19960

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19960
Log:
#12972: Fix updating of calligraphy pen values after doc setup is used

Modified:
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/ui/modetoolbar.cpp
    trunk/Scribus/scribus/ui/modetoolbar.h

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19960&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Thu Apr  2 21:57:54 2015
@@ -2545,8 +2545,7 @@
 	nsEditor->setDoc(doc);
 	symbolPalette->setDoc(doc);
 	inlinePalette->setDoc(doc);
-	modeToolBar->Angle->setValue(doc->itemToolPrefs().calligraphicPenAngle);
-	modeToolBar->PWidth->setValue(doc->itemToolPrefs().calligraphicPenWidth);
+	modeToolBar->setDoc(doc);
 	// Give plugins a chance to react on changing the current document
 	PluginManager& pluginManager(PluginManager::instance());
 	QStringList pluginNames(pluginManager.pluginNames(false));
@@ -6566,7 +6565,7 @@
 		doc->setNewPrefs(newDocPrefs, oldDocPrefs, resizePages, resizeMasterPages, resizePageMargins, resizeMasterPageMargins);
 
 		slotChangeUnit(doc->unitIndex(), false);
-		//dia->updateDocumentSettings();
+
 		if (oldDocPrefs.itemToolPrefs.imageLowResType!=newDocPrefs.itemToolPrefs.imageLowResType)
 		{
 			setStatusBarInfoText( tr("Updating Images"));
@@ -6610,6 +6609,7 @@
 		pagePalette->rebuildPages();
 		emit UpdateRequest(reqCmsOptionsUpdate);
 		doc->changed();
+		modeToolBar->setDoc(doc);
 	}
 }
 

Modified: trunk/Scribus/scribus/ui/modetoolbar.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19960&path=/trunk/Scribus/scribus/ui/modetoolbar.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/modetoolbar.cpp (original)
+++ trunk/Scribus/scribus/ui/modetoolbar.cpp Thu Apr  2 21:57:54 2015
@@ -150,6 +150,12 @@
 		QWidget::changeEvent(e);
 }
 
+void ModeToolBar::setDoc(ScribusDoc* doc)
+{
+	Angle->setValue(doc->itemToolPrefs().calligraphicPenAngle);
+	PWidth->setValue(doc->itemToolPrefs().calligraphicPenWidth);
+}
+
 void ModeToolBar::languageChange()
 {
 	AngleTxt->setText(tr("Angle:"));

Modified: trunk/Scribus/scribus/ui/modetoolbar.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19960&path=/trunk/Scribus/scribus/ui/modetoolbar.h
==============================================================================
--- trunk/Scribus/scribus/ui/modetoolbar.h (original)
+++ trunk/Scribus/scribus/ui/modetoolbar.h Thu Apr  2 21:57:54 2015
@@ -34,12 +34,14 @@
 #include <QWidget>
 
 class QEvent;
+class QToolButton;
 
-class QToolButton;
 class AutoformButtonGroup;
+class ScrSpinBox;
+class ScribusDoc;
 class ScribusMainWindow;
 class WidgetPopupMenu2;
-class ScrSpinBox;
+
 
 /**
   *@author Franz Schmid
@@ -53,18 +55,17 @@
 	ModeToolBar(ScribusMainWindow* parent);
 	~ModeToolBar() {};
 
+	virtual void changeEvent(QEvent *e);
+	void setDoc(ScribusDoc* doc);
 	int SubMode;
 	int ValCount;
 	double *ShapeVals;
-	ScrSpinBox *Angle;
-	ScrSpinBox *PWidth;
-	
-	virtual void changeEvent(QEvent *e);
 
 public slots:
 	void newCalValues();
 	void GetPolyProps();
 	void SelShape(int s, int c, qreal *vals);
+	void getShapeValues(int& mode, double* values, int& count);
 	void languageChange();
 		
 protected:
@@ -80,6 +81,9 @@
 	QWidgetAction* calValAct;
 	QLabel *AngleTxt;
 	QLabel *PWidthTxt;
+	ScrSpinBox *Angle;
+	ScrSpinBox *PWidth;
+
 };
 
 #endif




More information about the scribus-commit mailing list