r14027 by fschmid - Reintroduced the prefs variable polyFd as polyFactorGuiVal because it is important for the PolygonWidget

scribus-commit scribus-commit at lists.scribus.net
Tue Sep 22 11:40:43 CEST 2009


Revision: 14027
Author: fschmid
Date: 2009-09-22T09:38:48.251309Z
Commit message: Reintroduced the prefs variable polyFd as polyFactorGuiVal because it is important for the PolygonWidget

Changeset: 
M  /trunk/Scribus/scribus/ui/polyprops.h
M  /trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp
M  /trunk/Scribus/scribus/ui/prefs.cpp
M  /trunk/Scribus/scribus/ui/reformdoc.cpp
M  /trunk/Scribus/scribus/ui/tabtools.cpp
M  /trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
M  /trunk/Scribus/scribus/fileloader.cpp
M  /trunk/Scribus/scribus/ui/polygonwidget.cpp
M  /trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
M  /trunk/Scribus/scribus/prefsmanager.cpp
M  /trunk/Scribus/scribus/prefsstructs.h
M  /trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
M  /trunk/Scribus/scribus/ui/polygonwidget.h
M  /trunk/Scribus/scribus/ui/modetoolbar.cpp
M  /trunk/Scribus/scribus/ui/polyprops.cpp
M  /trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp

Diffs:
Index: scribus/fileloader.cpp
===================================================================
--- scribus/fileloader.cpp	(revision 14026)
+++ scribus/fileloader.cpp	(revision 14027)
@@ -264,7 +264,7 @@
 	currDoc->itemToolPrefs.polyFactor = prefsManager->appPrefs.itemToolPrefs.polyFactor;
 	currDoc->itemToolPrefs.polyRotation = prefsManager->appPrefs.itemToolPrefs.polyRotation;
 	currDoc->itemToolPrefs.polyCurvature = prefsManager->appPrefs.itemToolPrefs.polyCurvature;
-//	currDoc->itemToolPrefs.polyFactorValue = prefsManager->appPrefs.itemToolPrefs.polyFactorValue;
+	currDoc->itemToolPrefs.polyFactorGuiVal = prefsManager->appPrefs.itemToolPrefs.polyFactorGuiVal;
 	currDoc->itemToolPrefs.polyUseFactor = prefsManager->appPrefs.itemToolPrefs.polyUseFactor;
 	currDoc->AutoSave = prefsManager->appPrefs.docSetupPrefs.AutoSave;
 	currDoc->AutoSaveTime = prefsManager->appPrefs.docSetupPrefs.AutoSaveTime;
Index: scribus/prefsmanager.cpp
===================================================================
--- scribus/prefsmanager.cpp	(revision 14026)
+++ scribus/prefsmanager.cpp	(revision 14027)
@@ -286,7 +286,7 @@
 	appPrefs.itemToolPrefs.polyCorners = 4;
 	appPrefs.itemToolPrefs.polyFactor = 0.5;
 	appPrefs.itemToolPrefs.polyUseFactor = false;
-//	appPrefs.itemToolPrefs.polyFactorValue = 0;
+	appPrefs.itemToolPrefs.polyFactorGuiVal = 0;
 	appPrefs.itemToolPrefs.polyRotation = 0.0;
 	appPrefs.itemToolPrefs.polyCurvature = 0.0;
 //	appPrefs.PSize = 40;
@@ -1357,7 +1357,7 @@
 	dc9.setAttribute("POLYC", appPrefs.itemToolPrefs.polyCorners);
 	dc9.setAttribute("POLYF", ScCLocale::toQStringC(appPrefs.itemToolPrefs.polyFactor));
 	dc9.setAttribute("POLYR", ScCLocale::toQStringC(appPrefs.itemToolPrefs.polyRotation));
-//	dc9.setAttribute("POLYFD", appPrefs.itemToolPrefs.polyFactorValue);
+	dc9.setAttribute("POLYFD", appPrefs.itemToolPrefs.polyFactorGuiVal);
 	dc9.setAttribute("POLYCUR", ScCLocale::toQStringC(appPrefs.itemToolPrefs.polyCurvature));
 	dc9.setAttribute("POLYS", static_cast<int>(appPrefs.itemToolPrefs.polyUseFactor));
 	dc9.setAttribute("PSCALE", static_cast<int>(appPrefs.itemToolPrefs.imageScaleType));
@@ -1929,7 +1929,7 @@
 			appPrefs.itemToolPrefs.polyFactor = ScCLocale::toDoubleC(dc.attribute("POLYF"), 0.5);
 			appPrefs.itemToolPrefs.polyRotation = ScCLocale::toDoubleC(dc.attribute("POLYR"), 0.0);
 			appPrefs.itemToolPrefs.polyCurvature = ScCLocale::toDoubleC(dc.attribute("POLYCUR"), 0.0);
-//			appPrefs.itemToolPrefs.polyFactorValue = dc.attribute("POLYFD", "0").toInt();
+			appPrefs.itemToolPrefs.polyFactorGuiVal = dc.attribute("POLYFD", "0").toInt();
 			appPrefs.itemToolPrefs.polyUseFactor  = static_cast<bool>(dc.attribute("POLYS", "0").toInt());
 			appPrefs.itemToolPrefs.lineStartArrow = dc.attribute("StartArrow", "0").toInt();
 			appPrefs.itemToolPrefs.lineEndArrow   = dc.attribute("EndArrow", "0").toInt();
Index: scribus/prefsstructs.h
===================================================================
--- scribus/prefsstructs.h	(revision 14026)
+++ scribus/prefsstructs.h	(revision 14027)
@@ -180,7 +180,7 @@
 	int lineEndArrow; //! Ending arrow, 0 = none
 	/* Regular Polygon Tool */
 	int polyCorners;  //! Number of corners for a polygon
-//	int polyFactorValue; //! Factor as an integer????
+	int polyFactorGuiVal; //! Factor value suitable for our GUI
 	double polyFactor; //! Convex/Concave factor as a double
 	bool polyUseFactor; //! Whether to use a factor for shaping
 	double polyRotation; //! Rotation of a polygon
Index: scribus/ui/polygonwidget.h
===================================================================
--- scribus/ui/polygonwidget.h	(revision 14026)
+++ scribus/ui/polygonwidget.h	(revision 14027)
@@ -16,11 +16,11 @@
 	Q_OBJECT
 
 public:
-	PolygonWidget(QWidget* parent, int polyC, /*int polyFd, */double polyF, bool polyS, double polyR, double polyCurvature);
+	PolygonWidget(QWidget* parent, int polyC, int polyFd, double polyF, bool polyS, double polyR, double polyCurvature);
 	~PolygonWidget() {};
 	double GetZeroFaktor();
 	double GetMaxFaktor();
-	void getValues(int* polyC, /*int* polyFd, */double* polyF, bool* polyS, double* polyR, double* polyCurvature);
+	void getValues(int* polyC, int* polyFd, double* polyF, bool* polyS, double* polyR, double* polyCurvature);
 	void restoreDefaults(struct ItemToolPrefs *prefsData);
 	double PFactor;
 
Index: scribus/ui/polygonwidget.cpp
===================================================================
--- scribus/ui/polygonwidget.cpp	(revision 14026)
+++ scribus/ui/polygonwidget.cpp	(revision 14027)
@@ -22,7 +22,7 @@
 
 using namespace std;
 
-PolygonWidget::PolygonWidget(QWidget* parent, int polyC, /*int polyFd, */double polyF, bool polyS, double polyR, double polyCurvature) : QWidget( parent )
+PolygonWidget::PolygonWidget(QWidget* parent, int polyC, int polyFd, double polyF, bool polyS, double polyR, double polyCurvature) : QWidget( parent )
 {
 	setupUi(this);
 	PFactor = polyF;
@@ -30,10 +30,9 @@
 	Faktor2->setValue(static_cast<int>(polyR));
 	Slider2->setValue(static_cast<int>(polyR));
 	Konvex->setChecked(polyS);
-	Faktor->setValue(polyF);
-	Slider1->setValue(polyF);
-	if (polyF == 0.0)
-		Konvex->setChecked(false);
+	Faktor->setValue(polyFd);
+	Slider1->setValue(polyFd);
+	Konvex->setChecked(polyS);
 	CurvatureSpin->setValue(qRound(polyCurvature * 100));
 	CurvatureSlider->setValue(qRound(polyCurvature * 100));
 
@@ -70,10 +69,9 @@
 	Faktor2->setValue(static_cast<int>(prefsData->polyRotation));
 	Slider2->setValue(static_cast<int>(prefsData->polyRotation));
 	Konvex->setChecked(prefsData->polyUseFactor);
-	Faktor->setValue(prefsData->polyFactor);
-	Slider1->setValue(prefsData->polyFactor);
-	if (prefsData->polyFactor == 0.0)
-		Konvex->setChecked(false);
+	Faktor->setValue(prefsData->polyFactorGuiVal);
+	Slider1->setValue(prefsData->polyFactorGuiVal);
+	Konvex->setChecked(prefsData->polyUseFactor);
 	CurvatureSpin->setValue(qRound(prefsData->polyCurvature * 100));
 	CurvatureSlider->setValue(qRound(prefsData->polyCurvature * 100));
 	UpdatePreView();
@@ -90,12 +88,12 @@
 	connect(CurvatureSlider, SIGNAL(valueChanged(int)), this, SLOT(UpdatePreView()));
 }
 
-void PolygonWidget::getValues(int* polyC, /*int* polyFd, */double* polyF, bool* polyS, double* polyR, double* polyCurvature)
+void PolygonWidget::getValues(int* polyC, int* polyFd, double* polyF, bool* polyS, double* polyR, double* polyCurvature)
 {
 	*polyC = Ecken->value();
-	*polyF = Slider1->value();
+	*polyF = PFactor;
 	*polyS = Konvex->isChecked();
-//	*polyFd = Slider1->value();
+	*polyFd = Slider1->value();
 	*polyR = Faktor2->value();
 	*polyCurvature = CurvatureSpin->value() / 100.0;
 }
Index: scribus/ui/prefs.cpp
===================================================================
--- scribus/ui/prefs.cpp	(revision 14026)
+++ scribus/ui/prefs.cpp	(revision 14027)
@@ -392,7 +392,7 @@
 	prefsManager->appPrefs.scrapbookPrefs.numScrapbookCopies = tabScrapbook->numScrapCopies->value();
 
 	tabTools->polyWidget->getValues(&prefsManager->appPrefs.itemToolPrefs.polyCorners,
-//									&prefsManager->appPrefs.itemToolPrefs.polyFactorValue,
+									&prefsManager->appPrefs.itemToolPrefs.polyFactorGuiVal,
 									&prefsManager->appPrefs.itemToolPrefs.polyFactor,
 									&prefsManager->appPrefs.itemToolPrefs.polyUseFactor,
 									&prefsManager->appPrefs.itemToolPrefs.polyRotation,
Index: scribus/ui/modetoolbar.cpp
===================================================================
--- scribus/ui/modetoolbar.cpp	(revision 14026)
+++ scribus/ui/modetoolbar.cpp	(revision 14027)
@@ -89,9 +89,9 @@
 
 void ModeToolBar::GetPolyProps()
 {
-	PolygonProps* dia = new PolygonProps(this, m_ScMW->doc->itemToolPrefs.polyCorners, /*m_ScMW->doc->itemToolPrefs.polyFactorValue,*/ m_ScMW->doc->itemToolPrefs.polyFactor, m_ScMW->doc->itemToolPrefs.polyUseFactor, m_ScMW->doc->itemToolPrefs.polyRotation, m_ScMW->doc->itemToolPrefs.polyCurvature);
+	PolygonProps* dia = new PolygonProps(this, m_ScMW->doc->itemToolPrefs.polyCorners, m_ScMW->doc->itemToolPrefs.polyFactorGuiVal, m_ScMW->doc->itemToolPrefs.polyFactor, m_ScMW->doc->itemToolPrefs.polyUseFactor, m_ScMW->doc->itemToolPrefs.polyRotation, m_ScMW->doc->itemToolPrefs.polyCurvature);
 	if (dia->exec())
-		dia->getValues(&m_ScMW->doc->itemToolPrefs.polyCorners, /*&m_ScMW->doc->itemToolPrefs.polyFactorValue,*/ &m_ScMW->doc->itemToolPrefs.polyFactor, &m_ScMW->doc->itemToolPrefs.polyUseFactor, &m_ScMW->doc->itemToolPrefs.polyRotation, &m_ScMW->doc->itemToolPrefs.polyCurvature);
+		dia->getValues(&m_ScMW->doc->itemToolPrefs.polyCorners, &m_ScMW->doc->itemToolPrefs.polyFactorGuiVal, &m_ScMW->doc->itemToolPrefs.polyFactor, &m_ScMW->doc->itemToolPrefs.polyUseFactor, &m_ScMW->doc->itemToolPrefs.polyRotation, &m_ScMW->doc->itemToolPrefs.polyCurvature);
 	delete dia;
 }
 
Index: scribus/ui/polyprops.h
===================================================================
--- scribus/ui/polyprops.h	(revision 14026)
+++ scribus/ui/polyprops.h	(revision 14027)
@@ -20,9 +20,9 @@
 	Q_OBJECT
 
 public:
-	PolygonProps(QWidget* parent, int polyC, /*int polyFd,*/ double polyF, bool polyS, double polyR, double polyCurvature);
+	PolygonProps(QWidget* parent, int polyC, int polyFd, double polyF, bool polyS, double polyR, double polyCurvature);
 	~PolygonProps() {};
-	void getValues(int* polyC, /*int* polyFd,*/ double* polyF, bool* polyS, double* polyR, double* polyCurvature);
+	void getValues(int* polyC, int* polyFd, double* polyF, bool* polyS, double* polyR, double* polyCurvature);
 	PolygonWidget* polyWidget;
 	QPushButton* okButton;
 	QPushButton* cancelButton;
Index: scribus/ui/reformdoc.cpp
===================================================================
--- scribus/ui/reformdoc.cpp	(revision 14026)
+++ scribus/ui/reformdoc.cpp	(revision 14027)
@@ -430,7 +430,7 @@
 	currDoc->opToolPrefs.dispY = tabTools->genDispY->value();
 	currDoc->opToolPrefs.constrain = tabTools->genRot->value();
 	tabTools->polyWidget->getValues(&currDoc->itemToolPrefs.polyCorners,
-//									&currDoc->itemToolPrefs.polyFactorValue,
+									&currDoc->itemToolPrefs.polyFactorGuiVal,
 									&currDoc->itemToolPrefs.polyFactor,
 									&currDoc->itemToolPrefs.polyUseFactor,
 									&currDoc->itemToolPrefs.polyRotation,
Index: scribus/ui/tabtools.cpp
===================================================================
--- scribus/ui/tabtools.cpp	(revision 14026)
+++ scribus/ui/tabtools.cpp	(revision 14027)
@@ -426,7 +426,7 @@
 	polygonHeadLine->setFont(f);
 	subTabPolygonLayout->addWidget( polygonHeadLine, 0, 0, Qt::AlignHCenter | Qt::AlignTop );
 	polyWidget = new PolygonWidget(subTabPolygon, prefsData->polyCorners,
-//								   prefsData->polyFactorValue,
+								   prefsData->polyFactorGuiVal,
 								   prefsData->polyFactor,
 								   prefsData->polyUseFactor,
 								   prefsData->polyRotation,
Index: scribus/ui/polyprops.cpp
===================================================================
--- scribus/ui/polyprops.cpp	(revision 14026)
+++ scribus/ui/polyprops.cpp	(revision 14027)
@@ -14,7 +14,7 @@
 #include "commonstrings.h"
 #include "util_icon.h"
 
-PolygonProps::PolygonProps(QWidget* parent, int polyC, /*int polyFd,*/ double polyF, bool polyS, double polyR, double polyCurvature) : QDialog( parent )
+PolygonProps::PolygonProps(QWidget* parent, int polyC, int polyFd, double polyF, bool polyS, double polyR, double polyCurvature) : QDialog( parent )
 {
 	setModal(true);
 	setWindowTitle( tr( "Polygon Properties" ) );
@@ -22,7 +22,7 @@
 	PolygonPropsLayout = new QVBoxLayout( this );
 	PolygonPropsLayout->setMargin(10);
 	PolygonPropsLayout->setSpacing(5);
-	polyWidget = new PolygonWidget(this, polyC, /*polyFd,*/ polyF, polyS, polyR, polyCurvature);
+	polyWidget = new PolygonWidget(this, polyC, polyFd, polyF, polyS, polyR, polyCurvature);
 	PolygonPropsLayout->addWidget( polyWidget );
 	Layout1 = new QHBoxLayout;
 	Layout1->setMargin(0);
@@ -42,7 +42,7 @@
 	connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
 }
 
-void PolygonProps::getValues(int* polyC, /*int* polyFd,*/ double* polyF, bool* polyS, double* polyR, double* polyCurvature)
+void PolygonProps::getValues(int* polyC, int* polyFd, double* polyF, bool* polyS, double* polyR, double* polyCurvature)
 {
-	polyWidget->getValues(polyC, /*polyFd,*/ polyF, polyS, polyR, polyCurvature);
+	polyWidget->getValues(polyC, polyFd, polyF, polyS, polyR, polyCurvature);
 }
Index: scribus/plugins/fileloader/scribus13format/scribus13format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus13format/scribus13format.cpp	(revision 14026)
+++ scribus/plugins/fileloader/scribus13format/scribus13format.cpp	(revision 14027)
@@ -354,7 +354,7 @@
 		m_Doc->itemToolPrefs.polyFactor = ScCLocale::toDoubleC(dc.attribute("POLYF"), 0.5);
 		m_Doc->itemToolPrefs.polyRotation = ScCLocale::toDoubleC(dc.attribute("POLYR"), 0.0);
 		m_Doc->itemToolPrefs.polyCurvature = 0.0;
-//		m_Doc->itemToolPrefs.polyFactorValue = dc.attribute("POLYFD", "0").toInt();
+		m_Doc->itemToolPrefs.polyFactorGuiVal = dc.attribute("POLYFD", "0").toInt();
 		m_Doc->itemToolPrefs.polyUseFactor = static_cast<bool>(dc.attribute("POLYS", "0").toInt());
 		m_Doc->AutoSave = static_cast<bool>(dc.attribute("AutoSave", "0").toInt());
 		m_Doc->AutoSaveTime = dc.attribute("AutoSaveTime", "600000").toInt();
@@ -1270,7 +1270,7 @@
 	dc.setAttribute("POLYC", m_Doc->itemToolPrefs.polyCorners);
 	dc.setAttribute("POLYF", m_Doc->itemToolPrefs.polyFactor);
 	dc.setAttribute("POLYR", m_Doc->itemToolPrefs.polyRotation);
-//	dc.setAttribute("POLYFD", m_Doc->itemToolPrefs.polyFactorValue);
+	dc.setAttribute("POLYFD", m_Doc->itemToolPrefs.polyFactorGuiVal);
 	dc.setAttribute("POLYS", static_cast<int>(m_Doc->itemToolPrefs.polyUseFactor));
 	dc.setAttribute("AutoSave", static_cast<int>(m_Doc->AutoSave));
 	dc.setAttribute("AutoSaveTime", m_Doc->AutoSaveTime);
Index: scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
===================================================================
--- scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp	(revision 14026)
+++ scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp	(revision 14027)
@@ -180,7 +180,7 @@
 	docu.writeAttribute("POLYF", m_Doc->itemToolPrefs.polyFactor);
 	docu.writeAttribute("POLYR", m_Doc->itemToolPrefs.polyRotation);
 	docu.writeAttribute("POLYCUR", m_Doc->itemToolPrefs.polyCurvature);
-//	docu.writeAttribute("POLYFD", m_Doc->itemToolPrefs.polyFactorValue);
+	docu.writeAttribute("POLYFD", m_Doc->itemToolPrefs.polyFactorGuiVal);
 	docu.writeAttribute("POLYS", static_cast<int>(m_Doc->itemToolPrefs.polyUseFactor));
 	docu.writeAttribute("AutoSave", static_cast<int>(m_Doc->AutoSave));
 	docu.writeAttribute("AutoSaveTime", m_Doc->AutoSaveTime);
Index: scribus/plugins/fileloader/scribus150format/scribus150format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus150format/scribus150format.cpp	(revision 14026)
+++ scribus/plugins/fileloader/scribus150format/scribus150format.cpp	(revision 14027)
@@ -863,7 +863,7 @@
 	doc->itemToolPrefs.polyFactor = attrs.valueAsDouble("POLYF", 0.5);
 	doc->itemToolPrefs.polyRotation     = attrs.valueAsDouble("POLYR", 0.0);
 	doc->itemToolPrefs.polyCurvature    = attrs.valueAsDouble("POLYCUR", 0.0);
-//	doc->itemToolPrefs.polyFactorValue  = attrs.valueAsInt("POLYFD", 0);
+	doc->itemToolPrefs.polyFactorGuiVal = attrs.valueAsInt("POLYFD", 0);
 	doc->itemToolPrefs.polyUseFactor    = attrs.valueAsBool("POLYS", false);
 
 	doc->itemToolPrefs.lineStartArrow = attrs.valueAsInt("StartArrow", 0);
Index: scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp
===================================================================
--- scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp	(revision 14026)
+++ scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp	(revision 14027)
@@ -177,7 +177,7 @@
 	docu.writeAttribute("POLYF", m_Doc->itemToolPrefs.polyFactor);
 	docu.writeAttribute("POLYR", m_Doc->itemToolPrefs.polyRotation);
 	docu.writeAttribute("POLYCUR", m_Doc->itemToolPrefs.polyCurvature);
-//	docu.writeAttribute("POLYFD", m_Doc->itemToolPrefs.polyFactorValue);
+	docu.writeAttribute("POLYFD", m_Doc->itemToolPrefs.polyFactorGuiVal);
 	docu.writeAttribute("POLYS", static_cast<int>(m_Doc->itemToolPrefs.polyUseFactor));
 	docu.writeAttribute("AutoSave", static_cast<int>(m_Doc->AutoSave));
 	docu.writeAttribute("AutoSaveTime", m_Doc->AutoSaveTime);
Index: scribus/plugins/fileloader/scribus134format/scribus134format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus134format/scribus134format.cpp	(revision 14026)
+++ scribus/plugins/fileloader/scribus134format/scribus134format.cpp	(revision 14027)
@@ -871,7 +871,7 @@
 	doc->itemToolPrefs.polyFactor   = attrs.valueAsDouble("POLYF", 0.5);
 	doc->itemToolPrefs.polyRotation   = attrs.valueAsDouble("POLYR", 0.0);
 	doc->itemToolPrefs.polyCurvature = attrs.valueAsDouble("POLYCUR", 0.0);
-//	doc->itemToolPrefs.polyFactorValue  = attrs.valueAsInt("POLYFD", 0);
+	doc->itemToolPrefs.polyFactorGuiVal  = attrs.valueAsInt("POLYFD", 0);
 	doc->itemToolPrefs.polyUseFactor   = attrs.valueAsBool("POLYS", false);
 
 	doc->itemToolPrefs.lineStartArrow = attrs.valueAsInt("StartArrow", 0);




More information about the scribus-commit mailing list