r21304 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Fri May 13 15:47:00 UTC 2016


Author: jghali
Date: Fri May 13 15:47:00 2016
New Revision: 21304

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21304
Log:
#12329 related: fix some changes being incorrectly applied to document on UI language change

Modified:
    trunk/Scribus/scribus/ui/propertiespalette_image.cpp
    trunk/Scribus/scribus/ui/propertiespalette_line.cpp
    trunk/Scribus/scribus/ui/propertiespalette_text.cpp
    trunk/Scribus/scribus/ui/propertywidget_distance.cpp
    trunk/Scribus/scribus/ui/propertywidget_pathtext.cpp

Modified: trunk/Scribus/scribus/ui/propertiespalette_image.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21304&path=/trunk/Scribus/scribus/ui/propertiespalette_image.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_image.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_image.cpp	Fri May 13 15:47:00 2016
@@ -12,12 +12,13 @@
 #define _USE_MATH_DEFINES
 #endif
 #include <cmath>
+#include <QSignalBlocker>
+
 #include "commonstrings.h"
-#include "sccolorengine.h"
 #include "pageitem.h"
 #include "propertiespalette_utils.h"
+#include "sccolorengine.h"
 #include "sccombobox.h"
-
 #include "scribuscore.h"
 #include "scraction.h"
 #include "scribusview.h"
@@ -794,15 +795,17 @@
 
 	imagePageNumber->setSpecialValueText( tr( "Auto" ));
 
-	int oldMonitorI=renderIntent->currentIndex();
+	QSignalBlocker renderIntentBlocker(renderIntent);
+	int oldRenderI = renderIntent->currentIndex();
 	renderIntent->clear();
 	renderIntent->addItem( tr("Perceptual"));
 	renderIntent->addItem( tr("Relative Colorimetric"));
 	renderIntent->addItem( tr("Saturation"));
 	renderIntent->addItem( tr("Absolute Colorimetric"));
-	renderIntent->setCurrentIndex(oldMonitorI);
-
-	int oldCompressionMethod=compressionMethod->currentIndex();
+	renderIntent->setCurrentIndex(oldRenderI);
+
+	QSignalBlocker compressionMethodBlocker(compressionMethod);
+	int oldCompressionMethod = compressionMethod->currentIndex();
 	compressionMethod->clear();
 	compressionMethod->addItem( tr( "Global" ) );
 	compressionMethod->addItem( tr( "Automatic" ) );
@@ -811,7 +814,8 @@
 	compressionMethod->addItem( tr( "None" ) );
 	compressionMethod->setCurrentIndex(oldCompressionMethod);
 
-	int oldCompressionQuality=compressionQuality->currentIndex();
+	QSignalBlocker compressionQualityBlocker(compressionQuality);
+	int oldCompressionQuality = compressionQuality->currentIndex();
 	compressionQuality->clear();
 	compressionQuality->addItem( tr( "Global" ) );
 	compressionQuality->addItem( tr( "Maximum" ) );

Modified: trunk/Scribus/scribus/ui/propertiespalette_line.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21304&path=/trunk/Scribus/scribus/ui/propertiespalette_line.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_line.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_line.cpp	Fri May 13 15:47:00 2016
@@ -11,6 +11,7 @@
 #define _USE_MATH_DEFINES
 #endif
 #include <cmath>
+#include <QSignalBlocker>
 
 #include "arrowchooser.h"
 #include "commonstrings.h"
@@ -647,16 +648,20 @@
 
 void PropertiesPalette_Line::languageChange()
 {
+	QSignalBlocker lineTypeBlocker(lineType);
 	int oldLineStyle = lineType->currentIndex();
 	lineType->clear();
 	lineType->updateList();
 	lineType->addItem( tr("Custom"));
 	lineType->setCurrentIndex(oldLineStyle);
+
+	QSignalBlocker lineModeBlocker(lineMode);
 	int oldLineMode = lineMode->currentIndex();
 	lineMode->clear();
 	lineMode->addItem( tr("Left Point"));
 	lineMode->addItem( tr("End Points"));
 	lineMode->setCurrentIndex(oldLineMode);
+
 	lineModeLabel->setText( tr("&Basepoint:"));
 	lineTypeLabel->setText( tr("T&ype of Line:"));
 	startArrowLabel->setText( tr("Start Arrow:"));
@@ -665,9 +670,11 @@
 	endArrowScaleLabel->setText( tr("Scaling:"));
 	if (m_haveDoc)
 	{
+		QSignalBlocker startArrowBlocker(startArrow);
 		int arrowItem = startArrow->currentIndex();
 		startArrow->rebuildList(&m_doc->arrowStyles());
 		startArrow->setCurrentIndex(arrowItem);
+		QSignalBlocker endArrowBlocker(endArrow);
 		arrowItem = endArrow->currentIndex();
 		endArrow->rebuildList(&m_doc->arrowStyles());
 		endArrow->setCurrentIndex(arrowItem);
@@ -675,7 +682,8 @@
 	lineWidthLabel->setText( tr("Line &Width:"));
 	lineJoinLabel->setText( tr("Ed&ges:"));
 
-	int oldLJoinStyle=lineJoinStyle->currentIndex();
+	QSignalBlocker lineJoinStyleBlocker(lineJoinStyle);
+	int oldLJoinStyle = lineJoinStyle->currentIndex();
 	lineJoinStyle->clear();
 	IconManager* im=IconManager::instance();
 	lineJoinStyle->addItem(im->loadIcon("16/stroke-join-miter.png"), tr("Miter Join"));
@@ -683,7 +691,8 @@
 	lineJoinStyle->addItem(im->loadIcon("16/stroke-join-round.png"), tr("Round Join"));
 	lineJoinStyle->setCurrentIndex(oldLJoinStyle);
 
-	int oldLEndStyle=lineEndStyle->currentIndex();
+	QSignalBlocker lineEndStyleBlocker(lineEndStyle);
+	int oldLEndStyle = lineEndStyle->currentIndex();
 	lineEndStyle->clear();
 	lineEndStyle->addItem(im->loadIcon("16/stroke-cap-butt.png"), tr("Flat Cap"));
 	lineEndStyle->addItem(im->loadIcon("16/stroke-cap-square.png"), tr("Square Cap"));

Modified: trunk/Scribus/scribus/ui/propertiespalette_text.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21304&path=/trunk/Scribus/scribus/ui/propertiespalette_text.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_text.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_text.cpp	Fri May 13 15:47:00 2016
@@ -12,6 +12,7 @@
 #define _USE_MATH_DEFINES
 #endif
 #include <cmath>
+#include <QSignalBlocker>
 
 #include "appmodes.h"
 #include "colorcombo.h"
@@ -642,7 +643,8 @@
 	advancedWidgetsItem->setText(0, tr("Advanced Settings"));
 	pathTextItem->setText(0, tr("Path Text Properties"));
 
-	int oldLineSpacingMode = lineSpacingModeCombo->currentIndex();
+	QSignalBlocker lineSpacingModeBlocker(lineSpacingModeCombo);
+	int  oldLineSpacingMode = lineSpacingModeCombo->currentIndex();
 	lineSpacingModeCombo->clear();
 	lineSpacingModeCombo->addItem( tr("Fixed Linespacing"));
 	lineSpacingModeCombo->addItem( tr("Automatic Linespacing"));

Modified: trunk/Scribus/scribus/ui/propertywidget_distance.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21304&path=/trunk/Scribus/scribus/ui/propertywidget_distance.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_distance.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertywidget_distance.cpp	Fri May 13 15:47:00 2016
@@ -6,6 +6,8 @@
 */
 
 #include "propertywidget_distance.h"
+
+#include <QSignalBlocker>
 
 #include "appmodehelper.h"
 #include "appmodes.h"
@@ -438,18 +440,21 @@
 	columnsLabel->setText( tr("Colu&mns:"));
 
 	verticalAlignLabel->setText( tr("Vertical Alignment:"));
-	int oldAliLabel = verticalAlign->currentIndex();
+
+	QSignalBlocker verticalAlignBlocker(verticalAlign);
+	int oldAlignIndex = verticalAlign->currentIndex();
 	verticalAlign->clear();
 	verticalAlign->addItem( tr("Top"));
 	verticalAlign->addItem( tr("Middle"));
 	verticalAlign->addItem( tr("Bottom"));
-	verticalAlign->setCurrentIndex(oldAliLabel);
-
-	int oldcolgapLabel = columnGapLabel->currentIndex();
+	verticalAlign->setCurrentIndex(oldAlignIndex);
+
+	QSignalBlocker columnGapLabelBlocker(columnGapLabel);
+	int oldColGapLabel = columnGapLabel->currentIndex();
 	columnGapLabel->clear();
 	columnGapLabel->addItem( tr("Gap:"));
 	columnGapLabel->addItem( tr("Width:"));
-	columnGapLabel->setCurrentIndex(oldcolgapLabel);
+	columnGapLabel->setCurrentIndex(oldColGapLabel);
 
 	topLabel->setText( tr("To&p:"));
 	bottomLabel->setText( tr("&Bottom:"));

Modified: trunk/Scribus/scribus/ui/propertywidget_pathtext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21304&path=/trunk/Scribus/scribus/ui/propertywidget_pathtext.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_pathtext.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertywidget_pathtext.cpp	Fri May 13 15:47:00 2016
@@ -7,11 +7,12 @@
 
 #include "propertywidget_pathtext.h"
 
+#include <QSignalBlocker>
+
 #include "scribus.h"
 #include "scribusdoc.h"
 #include "selection.h"
 #include "units.h"
-
 
 PropertyWidget_PathText::PropertyWidget_PathText(QWidget* parent) : QFrame(parent)
 {
@@ -224,6 +225,7 @@
 
 void PropertyWidget_PathText::languageChange()
 {
+	QSignalBlocker pathTextTypeBlocker(pathTextType);
 	int oldPathType = pathTextType->currentIndex();
 	pathTextType->clear();
 	pathTextType->addItem( tr("Default"));




More information about the scribus-commit mailing list