r19282 by jghali - #12389: Snap Distance/Grab Radius do not store values inserted from keyboard

scribus-commit scribus-commit at lists.scribus.net
Wed Jun 25 22:41:11 UTC 2014


Author: jghali
Date: Wed Jun 25 22:41:11 2014
New Revision: 19282

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19282
Log:
#12389: Snap Distance/Grab Radius do not store values inserted from keyboard

Modified:
    trunk/Scribus/scribus/commonstrings.cpp
    trunk/Scribus/scribus/commonstrings.h
    trunk/Scribus/scribus/ui/prefs_guides.cpp
    trunk/Scribus/scribus/ui/scrspinbox.cpp

Modified: trunk/Scribus/scribus/commonstrings.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19282&path=/trunk/Scribus/scribus/commonstrings.cpp
==============================================================================
--- trunk/Scribus/scribus/commonstrings.cpp (original)
+++ trunk/Scribus/scribus/commonstrings.cpp Wed Jun 25 22:41:11 2014
@@ -185,12 +185,14 @@
 QString CommonStrings::trStrP  = "";
 QString CommonStrings::trStrCM = "";
 QString CommonStrings::trStrC  = "";
+QString CommonStrings::trStrPX = "";
 QString CommonStrings::strPT   = "";
 QString CommonStrings::strMM   = "";
 QString CommonStrings::strIN   = "";
 QString CommonStrings::strP    = "";
 QString CommonStrings::strCM   = "";
 QString CommonStrings::strC    = "";
+QString CommonStrings::strPX   = "";
 
 QString CommonStrings::controlModifier = "";
 QString CommonStrings::altModifier     = "";
@@ -451,12 +453,14 @@
 	CommonStrings::trStrP =unitGetStrFromIndex(SC_P);
 	CommonStrings::trStrCM=unitGetStrFromIndex(SC_CM);
 	CommonStrings::trStrC =unitGetStrFromIndex(SC_C);
+	CommonStrings::trStrPX=tr("px");
 	CommonStrings::strPT=unitGetUntranslatedStrFromIndex(SC_PT);
 	CommonStrings::strMM=unitGetUntranslatedStrFromIndex(SC_MM);
 	CommonStrings::strIN=unitGetUntranslatedStrFromIndex(SC_IN);
 	CommonStrings::strP =unitGetUntranslatedStrFromIndex(SC_P);
 	CommonStrings::strCM=unitGetUntranslatedStrFromIndex(SC_CM);
 	CommonStrings::strC =unitGetUntranslatedStrFromIndex(SC_C);
+	CommonStrings::strPX="px";
 
 	//Keyboard Modifiers
 	CommonStrings::altModifier=tr("Alt");

Modified: trunk/Scribus/scribus/commonstrings.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19282&path=/trunk/Scribus/scribus/commonstrings.h
==============================================================================
--- trunk/Scribus/scribus/commonstrings.h (original)
+++ trunk/Scribus/scribus/commonstrings.h Wed Jun 25 22:41:11 2014
@@ -275,12 +275,14 @@
 	static QString trStrP;
 	static QString trStrCM;
 	static QString trStrC;
+	static QString trStrPX;
 	static QString strPT;
 	static QString strMM;
 	static QString strIN;
 	static QString strP;
 	static QString strCM;
 	static QString strC;
+	static QString strPX;
 
 	//Keyboard Modifiers
 	static QString controlModifier;

Modified: trunk/Scribus/scribus/ui/prefs_guides.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19282&path=/trunk/Scribus/scribus/ui/prefs_guides.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_guides.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_guides.cpp Wed Jun 25 22:41:11 2014
@@ -6,6 +6,8 @@
 */
 
 #include <QColorDialog>
+
+#include "commonstrings.h"
 #include "ui/prefs_guides.h"
 #include "prefsstructs.h"
 #include "scribusdoc.h"
@@ -22,6 +24,13 @@
 	buttonUp->setEnabled(false);
 	buttonDown->setIcon(loadIcon("16/go-down.png"));
 	buttonDown->setEnabled(false);
+
+	QString pxSuffix = QString(" %1").arg(CommonStrings::trStrPX);
+	guideSnapDistanceSpinBox->setSuffix(pxSuffix);
+	guideGrabRadiusSpinBox->setSuffix(pxSuffix);
+
+	guideSnapDistanceSpinBox->setDecimals(0);
+	guideGrabRadiusSpinBox->setDecimals(0);
 
 	connect(guideColorPushButton, SIGNAL(clicked()), this, SLOT(changeGuideColor()));
 	connect(marginColorPushButton, SIGNAL(clicked()), this, SLOT(changeMarginColor()));
@@ -67,6 +76,11 @@
 	gridTypeCombo->addItem( tr("Lines"));
 	gridTypeCombo->addItem( tr("Crosses and Dots"));
 	gridTypeCombo->setCurrentIndex(grTy);
+
+	QString pxSuffix = QString(" %1").arg(CommonStrings::trStrPX);
+	guideSnapDistanceSpinBox->setSuffix(pxSuffix);
+	guideGrabRadiusSpinBox->setSuffix(pxSuffix);
+
 	guidePlacementListBox->setToolTip( tr( "Place guides in front of or behind objects on the page" ) );
 	minorGridSpacingSpinBox->setToolTip( tr( "Distance between the minor grid lines" ) );
 	majorGridSpacingSpinBox->setToolTip( tr( "Distance between the major grid lines" ) );

Modified: trunk/Scribus/scribus/ui/scrspinbox.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19282&path=/trunk/Scribus/scribus/ui/scrspinbox.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scrspinbox.cpp (original)
+++ trunk/Scribus/scribus/ui/scrspinbox.cpp Wed Jun 25 22:41:11 2014
@@ -173,6 +173,7 @@
 	ts.remove(crtSepGroup);
 	ts.replace(crtSepDecimal, cSepDecimal);
 	
+	ts.replace(CommonStrings::trStrPX, "");
 	ts.replace("%", "");
 	ts.replace("°", "");
 	ts.replace(FinishTag, "");
@@ -213,7 +214,7 @@
 		ts.replace(CommonStrings::trStrIN, CommonStrings::strIN);
 	if (CommonStrings::trStrCM.localeAwareCompare(CommonStrings::strCM)!=0)
 		ts.replace(CommonStrings::trStrCM, CommonStrings::strCM);
-	if (CommonStrings::trStrC.localeAwareCompare(CommonStrings::trStrC)!=0)
+	if (CommonStrings::trStrC.localeAwareCompare(CommonStrings::strC)!=0)
 		ts.replace(CommonStrings::trStrC, CommonStrings::strC);
 	//Replace in our typed text all of the units strings with *unitstring
 	QRegExp rx("\\b(\\d+)\\s*("+CommonStrings::strPT+"|"+CommonStrings::strMM+"|"+CommonStrings::strC+"|"+CommonStrings::strCM+"|"+CommonStrings::strIN+")\\b");




More information about the scribus-commit mailing list