r16248 by jghali - merge trunk revisions up to r16247

scribus-commit scribus-commit at lists.scribus.net
Thu Jan 13 14:19:45 CET 2011


Author: jghali
Date: Thu Jan 13 13:19:45 2011
New Revision: 16248

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16248
Log:
merge trunk revisions up to r16247

Added:
    branches/ScribusOIF/scribus/canvasmode_editpolygon.cpp
      - copied unchanged from r16247, trunk/Scribus/scribus/canvasmode_editpolygon.cpp
    branches/ScribusOIF/scribus/canvasmode_editpolygon.h
      - copied unchanged from r16247, trunk/Scribus/scribus/canvasmode_editpolygon.h
Modified:
    branches/ScribusOIF/scribus/CMakeLists.txt
    branches/ScribusOIF/scribus/canvas.h
    branches/ScribusOIF/scribus/canvasmode.cpp
    branches/ScribusOIF/scribus/canvasmode_normal.cpp
    branches/ScribusOIF/scribus/fileloader.cpp
    branches/ScribusOIF/scribus/pageitem_regularpolygon.cpp
    branches/ScribusOIF/scribus/pageitem_regularpolygon.h
    branches/ScribusOIF/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
    branches/ScribusOIF/scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp
    branches/ScribusOIF/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
    branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
    branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
    branches/ScribusOIF/scribus/prefsmanager.cpp
    branches/ScribusOIF/scribus/prefsstructs.h
    branches/ScribusOIF/scribus/scribus.cpp
    branches/ScribusOIF/scribus/scribusstructs.h
    branches/ScribusOIF/scribus/scribusview.h
    branches/ScribusOIF/scribus/ui/modetoolbar.cpp
    branches/ScribusOIF/scribus/ui/polygonwidget.cpp
    branches/ScribusOIF/scribus/ui/polygonwidget.h
    branches/ScribusOIF/scribus/ui/polyprops.cpp
    branches/ScribusOIF/scribus/ui/polyprops.h
    branches/ScribusOIF/scribus/ui/prefs.cpp
    branches/ScribusOIF/scribus/ui/propertiespalette_shape.cpp
    branches/ScribusOIF/scribus/ui/propertywidget_shape.cpp
    branches/ScribusOIF/scribus/ui/reformdoc.cpp
    branches/ScribusOIF/scribus/ui/tabtools.cpp
    branches/ScribusOIF/win32/vc8/Scribus.vcproj

Modified: branches/ScribusOIF/scribus/CMakeLists.txt
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/scribus/CMakeLists.txt
==============================================================================
--- branches/ScribusOIF/scribus/CMakeLists.txt (original)
+++ branches/ScribusOIF/scribus/CMakeLists.txt Thu Jan 13 13:19:45 2011
@@ -486,6 +486,7 @@
   canvasmode_editarc.cpp
   canvasmode_editgradient.cpp
   canvasmode_editmeshgradient.cpp
+  canvasmode_editpolygon.cpp
 #  canvasmode_legacy.cpp
   canvasmode_magnifier.cpp
   canvasmode_measurements.cpp

Modified: branches/ScribusOIF/scribus/canvas.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/scribus/canvas.h
==============================================================================
--- branches/ScribusOIF/scribus/canvas.h (original)
+++ branches/ScribusOIF/scribus/canvas.h Thu Jan 13 13:19:45 2011
@@ -93,6 +93,7 @@
 	friend class CanvasMode_EditArc;
 	friend class CanvasMode_EditGradient;
 	friend class CanvasMode_EditMeshGradient;
+	friend class CanvasMode_EditPolygon;
 	friend class CanvasMode_EyeDropper;
 	friend class CanvasMode_FrameLinks;
 	friend class CanvasMode_Magnifier;

Modified: branches/ScribusOIF/scribus/canvasmode.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/scribus/canvasmode.cpp
==============================================================================
--- branches/ScribusOIF/scribus/canvasmode.cpp (original)
+++ branches/ScribusOIF/scribus/canvasmode.cpp Thu Jan 13 13:19:45 2011
@@ -27,6 +27,7 @@
 #include "canvasmode_editarc.h"
 #include "canvasmode_editgradient.h"
 #include "canvasmode_editmeshgradient.h"
+#include "canvasmode_editpolygon.h"
 #include "canvasmode_eyedropper.h"
 #include "canvasmode_framelinks.h"
 #include "canvasmode_magnifier.h"
@@ -173,6 +174,9 @@
 		case modeEditArc:
 			result = new CanvasMode_EditArc(view);
 			break;
+		case modeEditPolygon:
+			result = new CanvasMode_EditPolygon(view);
+			break;
 			// more modes as they are defined...
 			
 		default:
@@ -599,6 +603,7 @@
 		case modeInsertPDFLinkAnnotation:
 		case modeInsertPDF3DAnnotation:
 		case modeEditArc:
+		case modeEditPolygon:
 			qApp->changeOverrideCursor(QCursor(Qt::CrossCursor));
 			break;
 		default:

Modified: branches/ScribusOIF/scribus/canvasmode_normal.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/scribus/canvasmode_normal.cpp
==============================================================================
--- branches/ScribusOIF/scribus/canvasmode_normal.cpp (original)
+++ branches/ScribusOIF/scribus/canvasmode_normal.cpp Thu Jan 13 13:19:45 2011
@@ -243,21 +243,25 @@
 			if (!m_doc->symbolEditMode())
 				m_view->requestMode(submodeEditSymbol);
 		}
-		else if (currItem->asRegularPolygon())
+	/*	else if (currItem->asRegularPolygon())
 		{
 			PageItem_RegularPolygon* item = currItem->asRegularPolygon();
-			PolygonProps* dia = new PolygonProps(m_ScMW, item->polyCorners, item->polyFactorGuiVal, item->polyFactor, item->polyUseFactor, item->polyRotation, item->polyCurvature, item->polyInnerRot, item->polyOuterCurvature);
+			PolygonProps* dia = new PolygonProps(m_ScMW, item->polyCorners, item->polyFactor, item->polyUseFactor, item->polyRotation, item->polyCurvature, item->polyInnerRot, item->polyOuterCurvature);
 			if (dia->exec())
 			{
-				dia->getValues(&item->polyCorners, &item->polyFactorGuiVal, &item->polyFactor, &item->polyUseFactor, &item->polyRotation, &item->polyCurvature, &item->polyInnerRot, &item->polyOuterCurvature);
+				dia->getValues(&item->polyCorners, &item->polyFactor, &item->polyUseFactor, &item->polyRotation, &item->polyCurvature, &item->polyInnerRot, &item->polyOuterCurvature);
 				item->recalcPath();
 			}
 			delete dia;
 			m_view->updateContents();
-		}
+		} */
 		else if (currItem->asArc())
 		{
 			m_view->requestMode(modeEditArc);
+		}
+		else if (currItem->asRegularPolygon())
+		{
+			m_view->requestMode(modeEditPolygon);
 		}
 	}
 }

Modified: branches/ScribusOIF/scribus/fileloader.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/scribus/fileloader.cpp
==============================================================================
--- branches/ScribusOIF/scribus/fileloader.cpp (original)
+++ branches/ScribusOIF/scribus/fileloader.cpp Thu Jan 13 13:19:45 2011
@@ -287,7 +287,6 @@
 	currDoc->itemToolPrefs().polyCurvature = prefsManager->appPrefs.itemToolPrefs.polyCurvature;
 	currDoc->itemToolPrefs().polyOuterCurvature = prefsManager->appPrefs.itemToolPrefs.polyOuterCurvature;
 	currDoc->itemToolPrefs().polyInnerRot = prefsManager->appPrefs.itemToolPrefs.polyInnerRot;
-	currDoc->itemToolPrefs().polyFactorGuiVal = prefsManager->appPrefs.itemToolPrefs.polyFactorGuiVal;
 	currDoc->itemToolPrefs().polyUseFactor = prefsManager->appPrefs.itemToolPrefs.polyUseFactor;
 	currDoc->setAutoSave(prefsManager->appPrefs.docSetupPrefs.AutoSave);
 	currDoc->setAutoSaveTime(prefsManager->appPrefs.docSetupPrefs.AutoSaveTime);

Modified: branches/ScribusOIF/scribus/pageitem_regularpolygon.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/scribus/pageitem_regularpolygon.cpp
==============================================================================
--- branches/ScribusOIF/scribus/pageitem_regularpolygon.cpp (original)
+++ branches/ScribusOIF/scribus/pageitem_regularpolygon.cpp Thu Jan 13 13:19:45 2011
@@ -52,7 +52,6 @@
 {
 	polyCorners = m_Doc->itemToolPrefs().polyCorners;
 	polyFactor = m_Doc->itemToolPrefs().polyFactor;
-	polyFactorGuiVal = m_Doc->itemToolPrefs().polyFactorGuiVal;
 	polyUseFactor = m_Doc->itemToolPrefs().polyUseFactor;
 	polyRotation = m_Doc->itemToolPrefs().polyRotation;
 	polyCurvature = m_Doc->itemToolPrefs().polyCurvature;

Modified: branches/ScribusOIF/scribus/pageitem_regularpolygon.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/scribus/pageitem_regularpolygon.h
==============================================================================
--- branches/ScribusOIF/scribus/pageitem_regularpolygon.h (original)
+++ branches/ScribusOIF/scribus/pageitem_regularpolygon.h Thu Jan 13 13:19:45 2011
@@ -49,7 +49,6 @@
 	/* Regular Polygon Tool */
 	int polyCorners;  //! Number of corners for a polygon
 	double polyFactor; //! Convex/Concave factor as a double
-	int polyFactorGuiVal; //! Factor value suitable for our GUI
 	bool polyUseFactor; //! Whether to use a factor for shaping
 	double polyRotation; //! Rotation of a polygon
 	double polyCurvature; //! Curvature of polygon

Modified: branches/ScribusOIF/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/fileloader/scribus134format/scribus134format.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/fileloader/scribus134format/scribus134format.cpp Thu Jan 13 13:19:45 2011
@@ -961,7 +961,6 @@
 	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().polyFactorGuiVal  = attrs.valueAsInt("POLYFD", 0);
 	doc->itemToolPrefs().polyUseFactor   = attrs.valueAsBool("POLYS", false);
 
 	doc->itemToolPrefs().lineStartArrow = attrs.valueAsInt("StartArrow", 0);

Modified: branches/ScribusOIF/scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp Thu Jan 13 13:19:45 2011
@@ -178,7 +178,6 @@
 	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().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());

Modified: branches/ScribusOIF/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/fileloader/scribus13format/scribus13format.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/fileloader/scribus13format/scribus13format.cpp Thu Jan 13 13:19:45 2011
@@ -357,7 +357,6 @@
 		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().polyFactorGuiVal = dc.attribute("POLYFD", "0").toInt();
 		m_Doc->itemToolPrefs().polyUseFactor = static_cast<bool>(dc.attribute("POLYS", "0").toInt());
 		m_Doc->setAutoSave(static_cast<bool>(dc.attribute("AutoSave", "0").toInt()));
 		m_Doc->setAutoSaveTime(dc.attribute("AutoSaveTime", "600000").toInt());

Modified: branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.cpp Thu Jan 13 13:19:45 2011
@@ -1712,7 +1712,6 @@
 	doc->itemToolPrefs().polyInnerRot     = attrs.valueAsDouble("POLYIR", 0.0);
 	doc->itemToolPrefs().polyCurvature    = attrs.valueAsDouble("POLYCUR", 0.0);
 	doc->itemToolPrefs().polyOuterCurvature    = attrs.valueAsDouble("POLYOCUR", 0.0);
-	doc->itemToolPrefs().polyFactorGuiVal = attrs.valueAsInt("POLYFD", 0);
 	doc->itemToolPrefs().polyUseFactor    = attrs.valueAsBool("POLYS", false);
 
 	doc->itemToolPrefs().arcStartAngle = attrs.valueAsDouble("arcStartAngle", 30.0);
@@ -3695,7 +3694,6 @@
 		regitem->polyInnerRot     = attrs.valueAsDouble("POLYIR", 0.0);
 		regitem->polyCurvature    = attrs.valueAsDouble("POLYCUR", 0.0);
 		regitem->polyOuterCurvature    = attrs.valueAsDouble("POLYOCUR", 0.0);
-		regitem->polyFactorGuiVal = attrs.valueAsInt("POLYFD", 0);
 		regitem->polyUseFactor    = attrs.valueAsBool("POLYS", false);
 	}
 	if (currItem->asArc())

Modified: branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp Thu Jan 13 13:19:45 2011
@@ -261,7 +261,6 @@
 	docu.writeAttribute("POLYIR", m_Doc->itemToolPrefs().polyInnerRot);
 	docu.writeAttribute("POLYCUR", m_Doc->itemToolPrefs().polyCurvature);
 	docu.writeAttribute("POLYOCUR", m_Doc->itemToolPrefs().polyOuterCurvature);
-	docu.writeAttribute("POLYFD", m_Doc->itemToolPrefs().polyFactorGuiVal);
 	docu.writeAttribute("POLYS", static_cast<int>(m_Doc->itemToolPrefs().polyUseFactor));
 	docu.writeAttribute("arcStartAngle", m_Doc->itemToolPrefs().arcStartAngle);
 	docu.writeAttribute("arcSweepAngle", m_Doc->itemToolPrefs().polyInnerRot);
@@ -1825,7 +1824,6 @@
 		docu.writeAttribute("POLYIR", regitem->polyInnerRot);
 		docu.writeAttribute("POLYCUR", regitem->polyCurvature);
 		docu.writeAttribute("POLYOCUR", regitem->polyOuterCurvature);
-		docu.writeAttribute("POLYFD", regitem->polyFactorGuiVal);
 		docu.writeAttribute("POLYS", static_cast<int>(regitem->polyUseFactor));
 	}
 	if (item->asArc())

Modified: branches/ScribusOIF/scribus/prefsmanager.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/scribus/prefsmanager.cpp
==============================================================================
--- branches/ScribusOIF/scribus/prefsmanager.cpp (original)
+++ branches/ScribusOIF/scribus/prefsmanager.cpp Thu Jan 13 13:19:45 2011
@@ -265,7 +265,6 @@
 	appPrefs.itemToolPrefs.polyCorners = 4;
 	appPrefs.itemToolPrefs.polyFactor = 0.5;
 	appPrefs.itemToolPrefs.polyUseFactor = false;
-	appPrefs.itemToolPrefs.polyFactorGuiVal = 0;
 	appPrefs.itemToolPrefs.polyRotation = 0.0;
 	appPrefs.itemToolPrefs.polyInnerRot = 0.0;
 	appPrefs.itemToolPrefs.polyCurvature = 0.0;
@@ -1471,7 +1470,6 @@
 	dcItemTools.setAttribute("PolygonFactor", ScCLocale::toQStringC(appPrefs.itemToolPrefs.polyFactor));
 	dcItemTools.setAttribute("PolygonRotation", ScCLocale::toQStringC(appPrefs.itemToolPrefs.polyRotation));
 	dcItemTools.setAttribute("PolygonInnerRotation", ScCLocale::toQStringC(appPrefs.itemToolPrefs.polyInnerRot));
-	dcItemTools.setAttribute("PolygonFactorGUI", appPrefs.itemToolPrefs.polyFactorGuiVal);
 	dcItemTools.setAttribute("PolygonCurvature", ScCLocale::toQStringC(appPrefs.itemToolPrefs.polyCurvature));
 	dcItemTools.setAttribute("PolygonOuterCurvature", ScCLocale::toQStringC(appPrefs.itemToolPrefs.polyOuterCurvature));
 	dcItemTools.setAttribute("arcStartAngle", ScCLocale::toQStringC(appPrefs.itemToolPrefs.arcStartAngle));
@@ -2065,7 +2063,6 @@
 			appPrefs.itemToolPrefs.polyInnerRot = ScCLocale::toDoubleC(dc.attribute("PolygonInnerRotation"), 0.0);
 			appPrefs.itemToolPrefs.polyCurvature = ScCLocale::toDoubleC(dc.attribute("PolygonCurvature"), 0.0);
 			appPrefs.itemToolPrefs.polyOuterCurvature = ScCLocale::toDoubleC(dc.attribute("PolygonOuterCurvature"), 0.0);
-			appPrefs.itemToolPrefs.polyFactorGuiVal = dc.attribute("PolygonFactorGUI", "0").toInt();
 			appPrefs.itemToolPrefs.polyUseFactor  = static_cast<bool>(dc.attribute("PolygonUseFactor", "0").toInt());
 			appPrefs.itemToolPrefs.lineStartArrow = dc.attribute("LineStartArrow", "0").toInt();
 			appPrefs.itemToolPrefs.lineEndArrow   = dc.attribute("LineEndArrow", "0").toInt();

Modified: branches/ScribusOIF/scribus/prefsstructs.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/scribus/prefsstructs.h
==============================================================================
--- branches/ScribusOIF/scribus/prefsstructs.h (original)
+++ branches/ScribusOIF/scribus/prefsstructs.h Thu Jan 13 13:19:45 2011
@@ -201,7 +201,6 @@
 	int lineEndArrow; //! Ending arrow, 0 = none
 	/* Regular Polygon Tool */
 	int polyCorners;  //! Number of corners for a polygon
-	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

Modified: branches/ScribusOIF/scribus/scribus.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/scribus/scribus.cpp
==============================================================================
--- branches/ScribusOIF/scribus/scribus.cpp (original)
+++ branches/ScribusOIF/scribus/scribus.cpp Thu Jan 13 13:19:45 2011
@@ -6493,6 +6493,7 @@
 			case modeEditGradientVectors:
 			case modeEditMeshGradient:
 			case modeEditArc:
+			case modeEditPolygon:
 				qApp->changeOverrideCursor(QCursor(Qt::CrossCursor));
 				break;
 			default:

Modified: branches/ScribusOIF/scribus/scribusstructs.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/scribus/scribusstructs.h
==============================================================================
--- branches/ScribusOIF/scribus/scribusstructs.h (original)
+++ branches/ScribusOIF/scribus/scribusstructs.h Thu Jan 13 13:19:45 2011
@@ -312,7 +312,8 @@
 	modeEditMeshGradient,
 	modeDrawCalligraphicLine,
 	modeDrawArc,
-	modeEditArc
+	modeEditArc,
+	modeEditPolygon
 };
 
 struct AlignObjs

Modified: branches/ScribusOIF/scribus/scribusview.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/scribus/scribusview.h
==============================================================================
--- branches/ScribusOIF/scribus/scribusview.h (original)
+++ branches/ScribusOIF/scribus/scribusview.h Thu Jan 13 13:19:45 2011
@@ -101,6 +101,7 @@
 	friend class CanvasMode_Edit;
 	friend class CanvasMode_EditGradient;
 	friend class CanvasMode_EditMeshGradient;
+	friend class CanvasMode_EditPolygon;
 	friend class CanvasMode_EditArc;
 	friend class CanvasMode_FrameLinks;
 	friend class CanvasMode_Magnifier;

Modified: branches/ScribusOIF/scribus/ui/modetoolbar.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/scribus/ui/modetoolbar.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/modetoolbar.cpp (original)
+++ branches/ScribusOIF/scribus/ui/modetoolbar.cpp Thu Jan 13 13:19:45 2011
@@ -124,10 +124,10 @@
 
 void ModeToolBar::GetPolyProps()
 {
-	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, m_ScMW->doc->itemToolPrefs().polyInnerRot, m_ScMW->doc->itemToolPrefs().polyOuterCurvature);
+	PolygonProps* dia = new PolygonProps(this, m_ScMW->doc->itemToolPrefs().polyCorners, m_ScMW->doc->itemToolPrefs().polyFactor, m_ScMW->doc->itemToolPrefs().polyUseFactor, m_ScMW->doc->itemToolPrefs().polyRotation, m_ScMW->doc->itemToolPrefs().polyCurvature, m_ScMW->doc->itemToolPrefs().polyInnerRot, m_ScMW->doc->itemToolPrefs().polyOuterCurvature);
 	if (dia->exec())
 	{
-		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, &m_ScMW->doc->itemToolPrefs().polyInnerRot, &m_ScMW->doc->itemToolPrefs().polyOuterCurvature);
+		dia->getValues(&m_ScMW->doc->itemToolPrefs().polyCorners, &m_ScMW->doc->itemToolPrefs().polyFactor, &m_ScMW->doc->itemToolPrefs().polyUseFactor, &m_ScMW->doc->itemToolPrefs().polyRotation, &m_ScMW->doc->itemToolPrefs().polyCurvature, &m_ScMW->doc->itemToolPrefs().polyInnerRot, &m_ScMW->doc->itemToolPrefs().polyOuterCurvature);
 		m_ScMW->scrActions["toolsInsertPolygon"]->trigger();
 	}
 	delete dia;

Modified: branches/ScribusOIF/scribus/ui/polygonwidget.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/scribus/ui/polygonwidget.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/polygonwidget.cpp (original)
+++ branches/ScribusOIF/scribus/ui/polygonwidget.cpp Thu Jan 13 13:19:45 2011
@@ -27,10 +27,10 @@
 }
 
 
-PolygonWidget::PolygonWidget(QWidget* parent, int polyCorners, int polyFd, double polyF, bool polyUseConvexFactor, double polyRotation, double polyCurvature, double polyInnerRot, double polyOuterCurvature) : QWidget( parent )
+PolygonWidget::PolygonWidget(QWidget* parent, int polyCorners, double polyF, bool polyUseConvexFactor, double polyRotation, double polyCurvature, double polyInnerRot, double polyOuterCurvature) : QWidget( parent )
 {
 	setupUi(this);
-	setValues(polyCorners, polyFd, polyF, polyUseConvexFactor, polyRotation, polyCurvature, polyInnerRot, polyOuterCurvature);
+	setValues(polyCorners, polyF, polyUseConvexFactor, polyRotation, polyCurvature, polyInnerRot, polyOuterCurvature);
 	updatePreview();
 	// signals and slots connections
 	connectSignals(true);
@@ -87,11 +87,12 @@
 	connectSignals(false);
 	PFactor = prefsData->polyFactor;
 	cornersSpinBox->setValue(prefsData->polyCorners);
+	int fGui = qRound(getUserValFromFactor(prefsData->polyFactor));
 	rotationSpinBox->setValue(static_cast<int>(prefsData->polyRotation));
 	rotationSlider->setValue(static_cast<int>(prefsData->polyRotation));
 	applyConvexGroupBox->setChecked(prefsData->polyUseFactor);
-	factorSpinBox->setValue(prefsData->polyFactorGuiVal);
-	factorSlider->setValue(prefsData->polyFactorGuiVal);
+	factorSpinBox->setValue(fGui);
+	factorSlider->setValue(fGui);
 	applyConvexGroupBox->setChecked(prefsData->polyUseFactor);
 	curvatureSpinBox->setValue(qRound(prefsData->polyCurvature * 100));
 	curvatureSlider->setValue(qRound(prefsData->polyCurvature * 100));
@@ -108,24 +109,24 @@
 	prefsData->polyCorners = cornersSpinBox->value();
 	prefsData->polyFactor = PFactor;
 	prefsData->polyUseFactor = applyConvexGroupBox->isChecked();
-	prefsData->polyFactorGuiVal = factorSlider->value();
 	prefsData->polyRotation = rotationSpinBox->value();
 	prefsData->polyInnerRot = innerRotationspinBox->value();
 	prefsData->polyCurvature = curvatureSpinBox->value() / 100.0;
 	prefsData->polyOuterCurvature = OuterCurvatureSpinBox->value() / 100.0;
 }
 
-void PolygonWidget::setValues(int polyCorners, int polyFd, double polyF, bool polyUseConvexFactor, double polyRotation, double polyCurvature, double polyInnerRot, double polyOuterCurvature)
+void PolygonWidget::setValues(int polyCorners, double polyF, bool polyUseConvexFactor, double polyRotation, double polyCurvature, double polyInnerRot, double polyOuterCurvature)
 {
 	PFactor = polyF;
 	cornersSpinBox->setValue(polyCorners);
+	int fGui = qRound(getUserValFromFactor(polyF));
 	rotationSpinBox->setValue(static_cast<int>(polyRotation));
 	rotationSlider->setValue(static_cast<int>(polyRotation));
 	innerRotationspinBox->setValue(static_cast<int>(polyInnerRot));
 	innerRotationSlider->setValue(static_cast<int>(polyInnerRot));
 	applyConvexGroupBox->setChecked(polyUseConvexFactor);
-	factorSpinBox->setValue(polyFd);
-	factorSlider->setValue(polyFd);
+	factorSpinBox->setValue(fGui);
+	factorSlider->setValue(fGui);
 	applyConvexGroupBox->setChecked(polyUseConvexFactor);
 	curvatureSpinBox->setValue(qRound(polyCurvature * 100));
 	curvatureSlider->setValue(qRound(polyCurvature * 100));
@@ -133,12 +134,11 @@
 	OuterCurvatureSlider->setValue(qRound(polyOuterCurvature * 100));
 }
 
-void PolygonWidget::getValues(int* polyCorners, int* polyFd, double* polyF, bool* polyUseConvexFactor, double* polyRotation, double* polyCurvature, double* polyInnerRot, double* polyOuterCurvature)
+void PolygonWidget::getValues(int* polyCorners, double* polyF, bool* polyUseConvexFactor, double* polyRotation, double* polyCurvature, double* polyInnerRot, double* polyOuterCurvature)
 {
 	*polyCorners = cornersSpinBox->value();
 	*polyF = PFactor;
 	*polyUseConvexFactor = applyConvexGroupBox->isChecked();
-	*polyFd = factorSlider->value();
 	*polyRotation = rotationSpinBox->value();
 	*polyInnerRot = innerRotationspinBox->value();
 	*polyCurvature = curvatureSpinBox->value() / 100.0;
@@ -217,6 +217,18 @@
 	Preview->setPixmap(pm);
 }
 
+double PolygonWidget::getUserValFromFactor(double factor)
+{
+	double userVal = 0.0;
+	double mi = GetZeroFactor();
+	double ma = GetMaxFactor();
+	if ((factor / mi * 100.0 - 100.0) > 0)
+		userVal = (factor - mi) / (ma - mi) * 100.0;
+	else
+		userVal = factor / mi * 100.0 - 100.0;
+	return userVal;
+}
+
 double PolygonWidget::GetZeroFactor()
 {
 	return sqrt(pow(1.0,2.0)-pow(((sin((360.0/(cornersSpinBox->value()*2))/180* M_PI)* 2.0)/2.0),2.0));

Modified: branches/ScribusOIF/scribus/ui/polygonwidget.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/scribus/ui/polygonwidget.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/polygonwidget.h (original)
+++ branches/ScribusOIF/scribus/ui/polygonwidget.h Thu Jan 13 13:19:45 2011
@@ -17,11 +17,11 @@
 
 	public:
 		PolygonWidget(QWidget* parent);
-		PolygonWidget(QWidget* parent, int polyCorners, int polyFd, double polyF, bool polyUseConvexFactor, double polyRotation, double polyCurvature, double polyInnerRot, double polyOuterCurvature);
+		PolygonWidget(QWidget* parent, int polyCorners, double polyF, bool polyUseConvexFactor, double polyRotation, double polyCurvature, double polyInnerRot, double polyOuterCurvature);
 		~PolygonWidget() {};
 
-		void setValues(int polyCorners, int polyFd, double polyF, bool polyUseConvexFactor, double polyRotation, double polyCurvature, double polyInnerRot, double polyOuterCurvature);
-		void getValues(int* polyCorners, int* polyFd, double* polyF, bool* polyUseConvexFactor, double* polyRotation, double* polyCurvature, double* polyInnerRot, double* polyOuterCurvature);
+		void setValues(int polyCorners, double polyF, bool polyUseConvexFactor, double polyRotation, double polyCurvature, double polyInnerRot, double polyOuterCurvature);
+		void getValues(int* polyCorners, double* polyF, bool* polyUseConvexFactor, double* polyRotation, double* polyCurvature, double* polyInnerRot, double* polyOuterCurvature);
 		void restoreDefaults(struct ItemToolPrefs *prefsData);
 		void saveGuiToPrefs(struct ItemToolPrefs *prefsData);
 
@@ -37,6 +37,7 @@
 		double GetFactor();
 
 	protected:
+		double getUserValFromFactor(double factor);
 		double PFactor;
 		void connectSignals(bool);
 };

Modified: branches/ScribusOIF/scribus/ui/polyprops.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/scribus/ui/polyprops.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/polyprops.cpp (original)
+++ branches/ScribusOIF/scribus/ui/polyprops.cpp Thu Jan 13 13:19:45 2011
@@ -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, double polyInnerRot, double polyOuterCurvature) : QDialog( parent )
+PolygonProps::PolygonProps(QWidget* parent, int polyC, double polyF, bool polyS, double polyR, double polyCurvature, double polyInnerRot, double polyOuterCurvature) : 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, polyInnerRot, polyOuterCurvature);
+	polyWidget = new PolygonWidget(this, polyC, polyF, polyS, polyR, polyCurvature, polyInnerRot, polyOuterCurvature);
 	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, double* polyInnerRot, double* polyOuterCurvature)
+void PolygonProps::getValues(int* polyC, double* polyF, bool* polyS, double* polyR, double* polyCurvature, double* polyInnerRot, double* polyOuterCurvature)
 {
-	polyWidget->getValues(polyC, polyFd, polyF, polyS, polyR, polyCurvature, polyInnerRot, polyOuterCurvature);
+	polyWidget->getValues(polyC, polyF, polyS, polyR, polyCurvature, polyInnerRot, polyOuterCurvature);
 }

Modified: branches/ScribusOIF/scribus/ui/polyprops.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/scribus/ui/polyprops.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/polyprops.h (original)
+++ branches/ScribusOIF/scribus/ui/polyprops.h Thu Jan 13 13:19:45 2011
@@ -20,9 +20,9 @@
 	Q_OBJECT
 
 public:
-	PolygonProps(QWidget* parent, int polyC, int polyFd, double polyF, bool polyS, double polyR, double polyCurvature, double polyInnerRot, double polyOuterCurvature);
+	PolygonProps(QWidget* parent, int polyC, double polyF, bool polyS, double polyR, double polyCurvature, double polyInnerRot, double polyOuterCurvature);
 	~PolygonProps() {};
-	void getValues(int* polyC, int* polyFd, double* polyF, bool* polyS, double* polyR, double* polyCurvature, double* polyInnerRot, double* polyOuterCurvature);
+	void getValues(int* polyC, double* polyF, bool* polyS, double* polyR, double* polyCurvature, double* polyInnerRot, double* polyOuterCurvature);
 	PolygonWidget* polyWidget;
 	QPushButton* okButton;
 	QPushButton* cancelButton;

Modified: branches/ScribusOIF/scribus/ui/prefs.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/scribus/ui/prefs.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/prefs.cpp (original)
+++ branches/ScribusOIF/scribus/ui/prefs.cpp Thu Jan 13 13:19:45 2011
@@ -394,7 +394,6 @@
 	prefsManager->appPrefs.scrapbookPrefs.numScrapbookCopies = tabScrapbook->numScrapCopies->value();
 
 	tabTools->polyWidget->getValues(&prefsManager->appPrefs.itemToolPrefs.polyCorners,
-									&prefsManager->appPrefs.itemToolPrefs.polyFactorGuiVal,
 									&prefsManager->appPrefs.itemToolPrefs.polyFactor,
 									&prefsManager->appPrefs.itemToolPrefs.polyUseFactor,
 									&prefsManager->appPrefs.itemToolPrefs.polyRotation,

Modified: branches/ScribusOIF/scribus/ui/propertiespalette_shape.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/scribus/ui/propertiespalette_shape.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertiespalette_shape.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertiespalette_shape.cpp Thu Jan 13 13:19:45 2011
@@ -402,10 +402,10 @@
 		if (m_item->asRegularPolygon())
 		{
 			PageItem_RegularPolygon* item = m_item->asRegularPolygon();
-			PolygonProps* dia = new PolygonProps(m_ScMW, item->polyCorners, item->polyFactorGuiVal, item->polyFactor, item->polyUseFactor, item->polyRotation, item->polyCurvature, item->polyInnerRot, item->polyOuterCurvature);
+			PolygonProps* dia = new PolygonProps(m_ScMW, item->polyCorners, item->polyFactor, item->polyUseFactor, item->polyRotation, item->polyCurvature, item->polyInnerRot, item->polyOuterCurvature);
 			if (dia->exec())
 			{
-				dia->getValues(&item->polyCorners, &item->polyFactorGuiVal, &item->polyFactor, &item->polyUseFactor, &item->polyRotation, &item->polyCurvature, &item->polyInnerRot, &item->polyOuterCurvature);
+				dia->getValues(&item->polyCorners, &item->polyFactor, &item->polyUseFactor, &item->polyRotation, &item->polyCurvature, &item->polyInnerRot, &item->polyOuterCurvature);
 				item->recalcPath();
 			}
 			delete dia;

Modified: branches/ScribusOIF/scribus/ui/propertywidget_shape.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/scribus/ui/propertywidget_shape.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_shape.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_shape.cpp Thu Jan 13 13:19:45 2011
@@ -352,10 +352,10 @@
 		if (m_item->asRegularPolygon())
 		{
 			PageItem_RegularPolygon* item = m_item->asRegularPolygon();
-			PolygonProps* dia = new PolygonProps(m_ScMW, item->polyCorners, item->polyFactorGuiVal, item->polyFactor, item->polyUseFactor, item->polyRotation, item->polyCurvature, item->polyInnerRot, item->polyOuterCurvature);
+			PolygonProps* dia = new PolygonProps(m_ScMW, item->polyCorners, item->polyFactor, item->polyUseFactor, item->polyRotation, item->polyCurvature, item->polyInnerRot, item->polyOuterCurvature);
 			if (dia->exec())
 			{
-				dia->getValues(&item->polyCorners, &item->polyFactorGuiVal, &item->polyFactor, &item->polyUseFactor, &item->polyRotation, &item->polyCurvature, &item->polyInnerRot, &item->polyOuterCurvature);
+				dia->getValues(&item->polyCorners, &item->polyFactor, &item->polyUseFactor, &item->polyRotation, &item->polyCurvature, &item->polyInnerRot, &item->polyOuterCurvature);
 				item->recalcPath();
 			}
 			delete dia;

Modified: branches/ScribusOIF/scribus/ui/reformdoc.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/scribus/ui/reformdoc.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/reformdoc.cpp (original)
+++ branches/ScribusOIF/scribus/ui/reformdoc.cpp Thu Jan 13 13:19:45 2011
@@ -431,7 +431,6 @@
 	currDoc->opToolPrefs().dispY = tabTools->genDispY->value();
 	currDoc->opToolPrefs().constrain = tabTools->genRot->value();
 	tabTools->polyWidget->getValues(&currDoc->itemToolPrefs().polyCorners,
-									&currDoc->itemToolPrefs().polyFactorGuiVal,
 									&currDoc->itemToolPrefs().polyFactor,
 									&currDoc->itemToolPrefs().polyUseFactor,
 									&currDoc->itemToolPrefs().polyRotation,

Modified: branches/ScribusOIF/scribus/ui/tabtools.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/scribus/ui/tabtools.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/tabtools.cpp (original)
+++ branches/ScribusOIF/scribus/ui/tabtools.cpp Thu Jan 13 13:19:45 2011
@@ -426,7 +426,6 @@
 	polygonHeadLine->setFont(f);
 	subTabPolygonLayout->addWidget( polygonHeadLine, 0, 0, Qt::AlignHCenter | Qt::AlignTop );
 	polyWidget = new PolygonWidget(subTabPolygon, prefsData->polyCorners,
-								   prefsData->polyFactorGuiVal,
 								   prefsData->polyFactor,
 								   prefsData->polyUseFactor,
 								   prefsData->polyRotation,

Modified: branches/ScribusOIF/win32/vc8/Scribus.vcproj
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16248&path=/branches/ScribusOIF/win32/vc8/Scribus.vcproj
==============================================================================
--- branches/ScribusOIF/win32/vc8/Scribus.vcproj (original)
+++ branches/ScribusOIF/win32/vc8/Scribus.vcproj Thu Jan 13 13:19:45 2011
@@ -663,6 +663,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\scribus\canvasmode_editpolygon.cpp"
+				>
+			</File>
+			<File
 				RelativePath="..\..\scribus\canvasmode_eyedropper.cpp"
 				>
 			</File>
@@ -2964,6 +2968,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\scribus\canvasmode_editpolygon.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\scribus\canvasmode_eyedropper.h"
 				>
 			</File>




More information about the scribus-commit mailing list