r23607 by craig - Related to #15656, introduce ability to switch between Qt detected

scribus-commit scribus-commit at lists.scribus.net
Tue Apr 14 08:34:13 UTC 2020


Author: craig
Date: Tue Apr 14 08:34:13 2020
New Revision: 23607

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23607
Log:
Related to #15656, introduce ability to switch between Qt detected
system numerical separators and separators as default for the UI
language locale. Implement (and therefore harmonise) the display of
separators across the application. Adjust ScrSpinBox workings,
definitely needs more testing.

Modified:
    trunk/Scribus/scribus/localemgr.cpp
    trunk/Scribus/scribus/localemgr.h
    trunk/Scribus/scribus/prefsmanager.cpp
    trunk/Scribus/scribus/prefsstructs.h
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribus.h
    trunk/Scribus/scribus/scribusapp.cpp
    trunk/Scribus/scribus/scribusapp.h
    trunk/Scribus/scribus/scribuscore.cpp
    trunk/Scribus/scribus/scribusview.cpp
    trunk/Scribus/scribus/ui/aligndistribute.cpp
    trunk/Scribus/scribus/ui/aligndistribute.h
    trunk/Scribus/scribus/ui/measurements.cpp
    trunk/Scribus/scribus/ui/measurements.h
    trunk/Scribus/scribus/ui/prefs_userinterface.cpp
    trunk/Scribus/scribus/ui/prefs_userinterfacebase.ui
    trunk/Scribus/scribus/ui/propertiespalette_image.cpp
    trunk/Scribus/scribus/ui/propertiespalette_image.h
    trunk/Scribus/scribus/ui/propertiespalette_line.cpp
    trunk/Scribus/scribus/ui/propertiespalette_line.h
    trunk/Scribus/scribus/ui/propertiespalette_shadow.cpp
    trunk/Scribus/scribus/ui/propertiespalette_shadow.h
    trunk/Scribus/scribus/ui/propertiespalette_shape.cpp
    trunk/Scribus/scribus/ui/propertiespalette_shape.h
    trunk/Scribus/scribus/ui/propertiespalette_text.cpp
    trunk/Scribus/scribus/ui/propertiespalette_text.h
    trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp
    trunk/Scribus/scribus/ui/propertiespalette_xyz.h
    trunk/Scribus/scribus/ui/propertywidget_advanced.cpp
    trunk/Scribus/scribus/ui/propertywidget_advanced.h
    trunk/Scribus/scribus/ui/propertywidget_distance.cpp
    trunk/Scribus/scribus/ui/propertywidget_distance.h
    trunk/Scribus/scribus/ui/propertywidget_pareffect.cpp
    trunk/Scribus/scribus/ui/propertywidget_pareffect.h
    trunk/Scribus/scribus/ui/propertywidget_pathtext.cpp
    trunk/Scribus/scribus/ui/propertywidget_pathtext.h
    trunk/Scribus/scribus/ui/propertywidget_textcolor.cpp
    trunk/Scribus/scribus/ui/propertywidget_textcolor.h
    trunk/Scribus/scribus/ui/proptree.cpp
    trunk/Scribus/scribus/ui/proptree.h
    trunk/Scribus/scribus/ui/scrspinbox.cpp
    trunk/Scribus/scribus/units.cpp

Modified: trunk/Scribus/scribus/localemgr.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/localemgr.cpp
==============================================================================
--- trunk/Scribus/scribus/localemgr.cpp	(original)
+++ trunk/Scribus/scribus/localemgr.cpp	Tue Apr 14 08:34:13 2020
@@ -29,6 +29,7 @@
 #include <QStringList> 
 
 #include "scconfig.h"
+#include "scribuscore.h"
 #include "localemgr.h"
 #include "scpaths.h"
 
@@ -125,4 +126,14 @@
 	//	return "";
 }
 
+void LocaleManager::setUserPreferredLocale(const QString& userLocale)
+{
+	m_userPreferredLocale = (userLocale == "System") ? QLocale::system() : QLocale(ScCore->getGuiLanguage());
+	QLocale::setDefault(m_userPreferredLocale);
+}
 
+void LocaleManager::setUserPreferredLocale(const QLocale& userLocale)
+{
+	m_userPreferredLocale = userLocale;
+	QLocale::setDefault(m_userPreferredLocale);
+}

Modified: trunk/Scribus/scribus/localemgr.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/localemgr.h
==============================================================================
--- trunk/Scribus/scribus/localemgr.h	(original)
+++ trunk/Scribus/scribus/localemgr.h	Tue Apr 14 08:34:13 2020
@@ -22,6 +22,7 @@
 #ifndef LOCALEMANAGER_H
 #define LOCALEMANAGER_H
 
+#include <QDebug>
 #include <QLocale>
 #include <QMap>
 #include <QString>
@@ -62,11 +63,16 @@
 	QString pageSizeForLocale(const QString &locale);
 	QString unitForLocale(const QString &locale);
 
-private:
+	const QLocale userPreferredLocale() const { return m_userPreferredLocale; }
+	void setUserPreferredLocale(const QString& userLocale);
+	void setUserPreferredLocale(const QLocale& userLocale);
+
+	private:
 	LocaleManager() = default;
 	~LocaleManager() = default;
 	QList <LocaleDef> m_localeTable;
 	QLocale m_sysLocale;
+	QLocale m_userPreferredLocale;
 	void generateLocaleList();
 };
 

Modified: trunk/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsmanager.cpp	(original)
+++ trunk/Scribus/scribus/prefsmanager.cpp	Tue Apr 14 08:34:13 2020
@@ -177,6 +177,7 @@
 	appPrefs.uiPrefs.language = ScQApp->currGUILanguage();
 	if (appPrefs.uiPrefs.language.isEmpty())
 		appPrefs.uiPrefs.language = "en_GB";
+	appPrefs.uiPrefs.userPreferredLocale = "System";
 	appPrefs.uiPrefs.showStartupDialog = true;
 	appPrefs.uiPrefs.showSplashOnStartup = true;
 	appPrefs.uiPrefs.useSmallWidgets = false;
@@ -911,58 +912,57 @@
 
 void PrefsManager::ReadPrefsXML()
 {
-	if (prefsFile)
-	{
-		PrefsContext* userprefsContext = prefsFile->getContext("user_preferences");
-		if (userprefsContext)
-		{
-			QString guiLanguage = userprefsContext->get("gui_language", "");
-			if (!guiLanguage.isEmpty())
-				appPrefs.uiPrefs.language = guiLanguage;
+	if (!prefsFile)
+		return;
+	PrefsContext* userprefsContext = prefsFile->getContext("user_preferences");
+	if (userprefsContext)
+	{
+		QString guiLanguage = userprefsContext->get("gui_language", "");
+		if (!guiLanguage.isEmpty())
+			appPrefs.uiPrefs.language = guiLanguage;
+		if (appPrefs.uiPrefs.language.isEmpty())
+		{
+			appPrefs.uiPrefs.language = ScQApp->currGUILanguage();
 			if (appPrefs.uiPrefs.language.isEmpty())
+				appPrefs.uiPrefs.language = "en_GB"; // If we get here, Houston, we have a problem!
+		}
+		if (!LanguageManager::instance()->isAvailableTranslation(appPrefs.uiPrefs.language))
+		{
+			appPrefs.uiPrefs.language = ScQApp->currGUILanguage();
+			if (!LanguageManager::instance()->isAvailableTranslation(appPrefs.uiPrefs.language))
+				appPrefs.uiPrefs.language = "en_GB"; // If we get here, Houston, we have a problem!
+		}
+		appPrefs.uiPrefs.mainWinState = QByteArray::fromBase64(userprefsContext->get("mainwinstate","").toLatin1());
+		appPrefs.uiPrefs.tabbedPalettes.clear();
+		PrefsTable *tabsTable = userprefsContext->getTable("tabbedPalettes");
+		PrefsTable *actTabsTable = userprefsContext->getTable("activeTabs");
+		if (tabsTable)
+		{
+			for (int r = 0; r < tabsTable->getRowCount(); r++)
 			{
-				appPrefs.uiPrefs.language = ScQApp->currGUILanguage();
-				if (appPrefs.uiPrefs.language.isEmpty())
-					appPrefs.uiPrefs.language = "en_GB"; // If we get here, Houston, we have a problem!
+				tabPrefs tabs;
+				for (int c = 0; c < tabsTable->getColCount(); c++)
+				{
+					QString tabName = tabsTable->get(r, c);
+					if (!tabName.isEmpty())
+						tabs.palettes.append(tabsTable->get(r, c));
+				}
+				if (actTabsTable)
+					tabs.activeTab = actTabsTable->getInt(r, 0);
+				else
+					tabs.activeTab = -1;
+				appPrefs.uiPrefs.tabbedPalettes.append(tabs);
 			}
-			if (!LanguageManager::instance()->isAvailableTranslation(appPrefs.uiPrefs.language))
-			{
-				appPrefs.uiPrefs.language = ScQApp->currGUILanguage();
-				if (!LanguageManager::instance()->isAvailableTranslation(appPrefs.uiPrefs.language))
-					appPrefs.uiPrefs.language = "en_GB"; // If we get here, Houston, we have a problem!
-			}
-			appPrefs.uiPrefs.mainWinState = QByteArray::fromBase64(userprefsContext->get("mainwinstate","").toLatin1());
-			appPrefs.uiPrefs.tabbedPalettes.clear();
-			PrefsTable *tabsTable = userprefsContext->getTable("tabbedPalettes");
-			PrefsTable *actTabsTable = userprefsContext->getTable("activeTabs");
-			if (tabsTable)
-			{
-				for (int r = 0; r < tabsTable->getRowCount(); r++)
-				{
-					tabPrefs tabs;
-					for (int c = 0; c < tabsTable->getColCount(); c++)
-					{
-						QString tabName = tabsTable->get(r, c);
-						if (!tabName.isEmpty())
-							tabs.palettes.append(tabsTable->get(r, c));
-					}
-					if (actTabsTable)
-						tabs.activeTab = actTabsTable->getInt(r, 0);
-					else
-						tabs.activeTab = -1;
-					appPrefs.uiPrefs.tabbedPalettes.append(tabs);
-				}
-			}
-			//continue here...
-			//Prefs."blah blah" =...
-		}
-		if (prefsFile->hasContext("print_options"))
-		{
-			// Reset copies number to 1 when user start new session
-			PrefsContext* printOptionsContext = prefsFile->getContext("print_options");
-			if (printOptionsContext)
-				printOptionsContext->set("Copies", 1);
-		}
+		}
+		//continue here...
+		//Prefs."blah blah" =...
+	}
+	if (prefsFile->hasContext("print_options"))
+	{
+		// Reset copies number to 1 when user start new session
+		PrefsContext* printOptionsContext = prefsFile->getContext("print_options");
+		if (printOptionsContext)
+			printOptionsContext->set("Copies", 1);
 	}
 }
 
@@ -1362,6 +1362,7 @@
 	dcUI.setAttribute("RecentDocumentCount", appPrefs.uiPrefs.recentDocCount);
 	dcUI.setAttribute("UseGrayscaleIcons", appPrefs.uiPrefs.grayscaleIcons);
 	dcUI.setAttribute("IconSet", appPrefs.uiPrefs.iconSet);
+	dcUI.setAttribute("UserPreferredLocale", appPrefs.uiPrefs.userPreferredLocale);
 	elem.appendChild(dcUI);
 
 	QDomElement deDocumentSetup=docu.createElement("DocumentSetup");
@@ -1971,6 +1972,7 @@
 			appPrefs.uiPrefs.stickyTools = static_cast<bool>(dc.attribute("StickyTools", "0").toInt());
 			appPrefs.uiPrefs.grayscaleIcons = static_cast<bool>(dc.attribute("UseGrayscaleIcons",nullptr).toInt());
 			appPrefs.uiPrefs.iconSet = dc.attribute("IconSet", "1_5_0");
+			appPrefs.uiPrefs.userPreferredLocale = dc.attribute("UserPreferredLocale","System");
 		}
 
 		if (dc.tagName()=="DocumentSetup")

Modified: trunk/Scribus/scribus/prefsstructs.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/prefsstructs.h
==============================================================================
--- trunk/Scribus/scribus/prefsstructs.h	(original)
+++ trunk/Scribus/scribus/prefsstructs.h	Tue Apr 14 08:34:13 2020
@@ -119,6 +119,7 @@
 	int recentDocCount {5}; //! Number of recent documents to remember
 	QStringList RecentDocs; //! List of recent documents
 	QString language; //! Language of the user interface
+	QString userPreferredLocale; //! System or interface language number formats
 	bool useSmallWidgets {false}; //! Use small widgets in the palettes
 	bool useTabs {false}; //! Use a tabbed MainWidget a la FireFox
 	bool showStartupDialog {true}; //! Whether to show the startup dialog or not

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp	(original)
+++ trunk/Scribus/scribus/scribus.cpp	Tue Apr 14 08:34:13 2020
@@ -115,6 +115,7 @@
 #include "hyphenator.h"
 #include "iconmanager.h"
 #include "langmgr.h"
+#include "localemgr.h"
 #include "loadsaveplugin.h"
 #include "marks.h"
 #include "nfttemplate.h"
@@ -425,6 +426,7 @@
 		scrActions["SaveAsDocumentTemplate"]->setEnabled(false);
 
 	connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange()));
+	connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange()));
 	connect(ScCore->fileWatcher, SIGNAL(fileDeleted(QString)), this, SLOT(removeRecentFromWatcher(QString)));
 	connect(ClipB, SIGNAL(dataChanged()), this, SLOT(ClipChange()));
 	setAcceptDrops(true);
@@ -6738,7 +6740,8 @@
 	if (oldPrefs.uiPrefs.language != newUILanguage || ScQApp->currGUILanguage() != newUILanguage)
 		ScQApp->changeGUILanguage(newUILanguage);
 	m_prefsManager.appPrefs.uiPrefs.language = ScQApp->currGUILanguage();
-
+	LocaleManager::instance().setUserPreferredLocale(m_prefsManager.appPrefs.uiPrefs.userPreferredLocale);
+	ScQApp->setLocale();
 	QString newUIStyle = m_prefsManager.guiStyle();
 	if (oldPrefs.uiPrefs.style != newUIStyle)
 	{
@@ -6831,6 +6834,7 @@
 	icm.setCompressionLevel(newPrefs.imageCachePrefs.compressionLevel);
 
 	m_prefsManager.SavePrefs();
+	m_mainWindowStatusLabel->setText( tr("Ready"));
 }
 
 void ScribusMainWindow::slotDocSetup()
@@ -8735,6 +8739,14 @@
 		m_undoManager->languageChange();
 	statusBarLanguageChange();
 	viewToolBar->languageChange();
+}
+
+void ScribusMainWindow::localeChange()
+{
+	const QLocale& l(LocaleManager::instance().userPreferredLocale());
+	zoomSpinBox->setLocale(l);
+	mainWindowXPosDataLabel->setText("         ");
+	mainWindowYPosDataLabel->setText("         ");
 }
 
 void ScribusMainWindow::statusBarLanguageChange()

Modified: trunk/Scribus/scribus/scribus.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/scribus.h
==============================================================================
--- trunk/Scribus/scribus/scribus.h	(original)
+++ trunk/Scribus/scribus/scribus.h	Tue Apr 14 08:34:13 2020
@@ -277,6 +277,7 @@
 public slots:
 	void iconSetChange();
 	void languageChange();
+	void localeChange();
 	void statusBarLanguageChange();
 	void specialActionKeyEvent(int unicodevalue);
 	void newView();

Modified: trunk/Scribus/scribus/scribusapp.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/scribusapp.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusapp.cpp	(original)
+++ trunk/Scribus/scribus/scribusapp.cpp	Tue Apr 14 08:34:13 2020
@@ -355,14 +355,13 @@
 	processEvents(QEventLoop::ExcludeUserInputEvents|QEventLoop::ExcludeSocketNotifiers, 1000);
 	ScCore->init(useGUI, m_filesToLoad);
 	processEvents();
-	int retVal=EXIT_SUCCESS;
 	/* TODO:
 	 * When Scribus is truly able to run without GUI
 	 * we should uncomment if (useGUI)
 	 * and delete if (true)
 	 */
 	// if (useGUI)
-	retVal=ScCore->startGUI(m_showSplash, m_showFontInfo, m_showProfileInfo, m_lang);
+	int retVal=ScCore->startGUI(m_showSplash, m_showFontInfo, m_showProfileInfo, m_lang);
 	// A hook for plugins and scripts to trigger on. Some plugins and scripts
 	// require the app to be fully set up (in particular, the main window to be
 	// built and shown) before running their setup.
@@ -562,6 +561,12 @@
 	iconManager.clearCache();
 	iconManager.setActiveFromPrefs(newIconSet);
 	emit iconSetChanged();
+}
+
+void ScribusQApp::setLocale()
+{
+	QLocale::setDefault(LocaleManager::instance().userPreferredLocale());
+	emit localeChanged();
 }
 
 /*! \brief Format an arguments line for printing

Modified: trunk/Scribus/scribus/scribusapp.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/scribusapp.h
==============================================================================
--- trunk/Scribus/scribus/scribusapp.h	(original)
+++ trunk/Scribus/scribus/scribusapp.h	Tue Apr 14 08:34:13 2020
@@ -48,6 +48,7 @@
 
 		void changeGUILanguage(const QString & newGUILang);
 		void changeIconSet(const QString& newIconSet);
+		void setLocale();
 
 		/*!
 		\author Franz Schmid
@@ -102,6 +103,7 @@
 		ScribusCore* m_ScCore {nullptr};
 		QString m_lang;
 		QString m_GUILang {"en_GB"};
+		QLocale m_locale;
 		bool m_showSplash;
 		bool m_showFontInfo;
 		bool m_showProfileInfo;
@@ -121,6 +123,7 @@
 	signals:
 		void appStarted();
 		void iconSetChanged();
+		void localeChanged();
 };
 
 extern SCRIBUS_API ScribusQApp * ScQApp;

Modified: trunk/Scribus/scribus/scribuscore.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/scribuscore.cpp
==============================================================================
--- trunk/Scribus/scribus/scribuscore.cpp	(original)
+++ trunk/Scribus/scribus/scribuscore.cpp	Tue Apr 14 08:34:13 2020
@@ -87,10 +87,7 @@
 	return 0;
 }
 
-const QString& ScribusCore::getGuiLanguage() const
-{
-	return ScQApp->currGUILanguage();
-}
+
 
 int ScribusCore::startGUI(bool showSplash, bool showFontInfo, bool showProfileInfo, const QString& newGuiLanguage)
 {
@@ -99,7 +96,6 @@
 	if (!scribus)
 		return(EXIT_FAILURE);
 	m_ScMWList.append(scribus);
-	m_currScMW=0;
 	int retVal=initScribusCore(showSplash, showFontInfo, showProfileInfo, newGuiLanguage);
 	if (retVal == EXIT_FAILURE)
 		return(EXIT_FAILURE);
@@ -175,6 +171,7 @@
 	m_prefsManager.initDefaultActionKeys();
 	setSplashStatus( tr("Reading Preferences") );
 	m_prefsManager.ReadPrefs();
+	LocaleManager::instance().setUserPreferredLocale(m_prefsManager.appPrefs.uiPrefs.userPreferredLocale);
 	m_prefsManager.appPrefs.uiPrefs.showSplashOnStartup=showSplash;
 	if (!m_iconManager.setActiveFromPrefs(m_prefsManager.appPrefs.uiPrefs.iconSet))
 	{
@@ -201,6 +198,11 @@
 	icm.setCompressionLevel(m_prefsManager.appPrefs.imageCachePrefs.compressionLevel);
 	icm.initialize();
 	return 0;
+}
+
+const QString &ScribusCore::getGuiLanguage() const
+{
+	return ScQApp->currGUILanguage();
 }
 
 void ScribusCore::initSplash(bool showSplash)

Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp	(original)
+++ trunk/Scribus/scribus/scribusview.cpp	Tue Apr 14 08:34:13 2020
@@ -2117,8 +2117,8 @@
 	}
 	//	horizRuler->offs += qRound(Doc->minCanvasCoordinate.x() - 1 - Doc->rulerXoffset);
 	//	vertRuler->offs += qRound(Doc->minCanvasCoordinate.y() - 1 - Doc->rulerYoffset);
-	horizRuler->shiftRel(0*m_doc->minCanvasCoordinate.x()  - m_doc->rulerXoffset);
-	vertRuler->shiftRel(0*m_doc->minCanvasCoordinate.y()  - m_doc->rulerYoffset);
+	horizRuler->shiftRel(0*m_doc->minCanvasCoordinate.x() - m_doc->rulerXoffset);
+	vertRuler->shiftRel(0*m_doc->minCanvasCoordinate.y() - m_doc->rulerYoffset);
 	horizRuler->update();
 	vertRuler->update();
 	//	evSpon = true;

Modified: trunk/Scribus/scribus/ui/aligndistribute.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/aligndistribute.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/aligndistribute.cpp	(original)
+++ trunk/Scribus/scribus/ui/aligndistribute.cpp	Tue Apr 14 08:34:13 2020
@@ -27,6 +27,7 @@
 #include <QLabel>
 #include <QLayout>
 #include <QLineEdit>
+#include <QLocale>
 #include <QMessageBox>
 #include <QPixmap>
 #include <QPushButton>
@@ -37,6 +38,7 @@
 
 #include "commonstrings.h"
 #include "iconmanager.h"
+#include "localemgr.h"
 #include "scpage.h"
 #include "scribusapp.h"
 #include "scribusdoc.h"
@@ -52,8 +54,6 @@
 {
 	setupUi(this);
 	setSizePolicy( QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
-	currDoc = nullptr;
-	guideDirection = -1;
 	setObjectName(name);
 	
 	//hide spare controls 
@@ -61,7 +61,7 @@
 	toolButtonDummy2->hide();
 
 	//set up scrspinboxes
-	distributeDistSpinBox->setValues(-1000.0, 1000.0, 2, 0.0);
+	distributeDistSpinBox->setValues(-10000.0, 10000.0, 2, 0.0);
 
 	// buddies
 	alignRelativeToLabel->setBuddy( alignRelativeToCombo );
@@ -74,6 +74,7 @@
 	setDoc(nullptr);
 
 	connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange()));
+	connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange()));
 }
 
 AlignDistributePalette::~AlignDistributePalette()
@@ -497,6 +498,13 @@
 	guideDirection = direction;
 	guidePosition = position;
 	enableGuideButtons();
+}
+
+
+void AlignDistributePalette::localeChange()
+{
+	const QLocale& l(LocaleManager::instance().userPreferredLocale());
+	distributeDistSpinBox->setLocale(l);
 }
 
 void AlignDistributePalette::enableGuideButtons()

Modified: trunk/Scribus/scribus/ui/aligndistribute.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/aligndistribute.h
==============================================================================
--- trunk/Scribus/scribus/ui/aligndistribute.h	(original)
+++ trunk/Scribus/scribus/ui/aligndistribute.h	Tue Apr 14 08:34:13 2020
@@ -61,11 +61,12 @@
 
 	virtual void setDoc( ScribusDoc* newDoc );
 	void unitChange();
-	
+
 	virtual void changeEvent(QEvent *e);
 	
 public slots:
 	void setGuide(int, qreal);
+	void localeChange();
 
 protected:
 	ScribusView *currView;
@@ -110,9 +111,9 @@
 	ScribusDoc::AlignTo currAlignTo;
 	ScribusDoc::AlignMethod currAlignMethod;
 	QList<AlignObjs> *alignObjects;
-	ScribusDoc *currDoc;
+	ScribusDoc *currDoc {nullptr};
 	qreal unitRatio;
-	int guideDirection;
+	int guideDirection {-1};
 	qreal guidePosition;
 	QString guideInfoText, guideInfoTextNone;
 	void enableGuideButtons();

Modified: trunk/Scribus/scribus/ui/measurements.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/measurements.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/measurements.cpp	(original)
+++ trunk/Scribus/scribus/ui/measurements.cpp	Tue Apr 14 08:34:13 2020
@@ -7,7 +7,11 @@
 
 #include <cmath>
 
+#include <QLocale>
+
+#include "localemgr.h"
 #include "measurements.h"
+#include "scribusapp.h"
 #include "scribusdoc.h"
 #include "scribusview.h"
 #include "units.h"
@@ -19,13 +23,8 @@
 {
 	setupUi(this);
 
-	mX1 = mY1 = 0;
-	mX2 = mY2 = 0;
-	mDX = mDY = 0;
-	mLength = 0;
-
 	const QString widthString="10000.0000";
-	int textWidth = fontMetrics().width(widthString);
+	int textWidth = fontMetrics().horizontalAdvance(widthString);
 	x1Data->setMinimumSize(textWidth, 12);
 	y1Data->setMinimumSize(textWidth, 12);
 	x2Data->setMinimumSize(textWidth, 12);
@@ -56,6 +55,7 @@
 	setValues(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
 	
 	connect(unitSwitch, SIGNAL(currentIndexChanged(int)), this, SLOT(unitChanged()));
+	connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localChange()));
 }
 
 void Measurements::setValues(double x1, double y1, double x2, double y2, double angle, double len)
@@ -85,13 +85,14 @@
 	int uPrec = unitGetPrecisionFromIndex(uInd);
 	double uRatio = unitGetRatioFromIndex(uInd);
 	QString uStr  = unitGetStrFromIndex(uInd);
-	x1Data->setText(tmp.setNum(qRound(mX1 * uRatio * uDec) / static_cast<double>(uDec), 'f', uPrec) + " " + uStr);
-	y1Data->setText(tmp.setNum(qRound(mY1 * uRatio * uDec) / static_cast<double>(uDec), 'f', uPrec) + " " + uStr);
-	x2Data->setText(tmp.setNum(qRound(mX2 * uRatio * uDec) / static_cast<double>(uDec), 'f', uPrec) + " " + uStr);
-	y2Data->setText(tmp.setNum(qRound(mY2 * uRatio * uDec) / static_cast<double>(uDec), 'f', uPrec) + " " + uStr);
-	dXData->setText(tmp.setNum(qRound(mDX * uRatio * uDec) / static_cast<double>(uDec), 'f', uPrec) + " " + uStr);
-	dYData->setText(tmp.setNum(qRound(mDY * uRatio * uDec) / static_cast<double>(uDec), 'f', uPrec) + " " + uStr);
-	lengthData->setText(tmp.setNum(qRound(mLength * uRatio * uDec) / static_cast<double>(uDec), 'f', uPrec) + " " + uStr);
+	const QLocale& l = LocaleManager::instance().userPreferredLocale();
+	x1Data->setText(l.toString(qRound(mX1 * uRatio * uDec) / static_cast<double>(uDec), 'f', uPrec) + " " + uStr);
+	y1Data->setText(l.toString(qRound(mY1 * uRatio * uDec) / static_cast<double>(uDec), 'f', uPrec) + " " + uStr);
+	x2Data->setText(l.toString(qRound(mX2 * uRatio * uDec) / static_cast<double>(uDec), 'f', uPrec) + " " + uStr);
+	y2Data->setText(l.toString(qRound(mY2 * uRatio * uDec) / static_cast<double>(uDec), 'f', uPrec) + " " + uStr);
+	dXData->setText(l.toString(qRound(mDX * uRatio * uDec) / static_cast<double>(uDec), 'f', uPrec) + " " + uStr);
+	dYData->setText(l.toString(qRound(mDY * uRatio * uDec) / static_cast<double>(uDec), 'f', uPrec) + " " + uStr);
+	lengthData->setText(l.toString(qRound(mLength * uRatio * uDec) / static_cast<double>(uDec), 'f', uPrec) + " " + uStr);
 }
 
 void Measurements::changeEvent(QEvent *e)
@@ -108,3 +109,9 @@
 {
 	retranslateUi(this);
 }
+
+void Measurements::localChange()
+{
+	//We can just call unitChanged as it already needs to use the locale for the conversions
+	unitChanged();
+}

Modified: trunk/Scribus/scribus/ui/measurements.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/measurements.h
==============================================================================
--- trunk/Scribus/scribus/ui/measurements.h	(original)
+++ trunk/Scribus/scribus/ui/measurements.h	Tue Apr 14 08:34:13 2020
@@ -27,15 +27,16 @@
 	void unitChanged();
 	/** @brief Sets GUI strings on language change */
 	void languageChange();
+	void localChange();
 	
 private:
-	double mX1;
-	double mY1;
-	double mX2;
-	double mY2;
-	double mDX;
-	double mDY;
-	double mLength;
+	double mX1 {0.0};
+	double mY1 {0.0};
+	double mX2 {0.0};
+	double mY2 {0.0};
+	double mDX {0.0};
+	double mDY {0.0};
+	double mLength {0.0};
 };
 
 #endif // MEASUREMENTS_H

Modified: trunk/Scribus/scribus/ui/prefs_userinterface.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/prefs_userinterface.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_userinterface.cpp	(original)
+++ trunk/Scribus/scribus/ui/prefs_userinterface.cpp	Tue Apr 14 08:34:13 2020
@@ -27,6 +27,14 @@
 	m_caption = tr("User Interface");
 	m_icon = "scribus16.png";
 
+	// qt styles
+	QStringList styleList = QStyleFactory::keys();
+	themeComboBox->addItem("");
+	themeComboBox->addItems(styleList);
+	QStringList iconSetList;
+	iconSetList = IconManager::instance().nameList(ScQApp->currGUILanguage());
+	iconSetComboBox->addItems(iconSetList);
+
 	QStringList languageList;
 	LanguageManager::instance()->fillInstalledGUIStringList(&languageList);
 	if (languageList.isEmpty())
@@ -40,13 +48,8 @@
 	std::sort(languageList.begin(), languageList.end(), localeAwareLessThan);
 	languageComboBox->addItems(languageList);
 
-	// qt styles
-	QStringList styleList = QStyleFactory::keys();
-	themeComboBox->addItem("");
-	themeComboBox->addItems(styleList);
-	QStringList iconSetList;
-	iconSetList = IconManager::instance().nameList(ScQApp->currGUILanguage());
-	iconSetComboBox->addItems(iconSetList);
+	numberFormatComboBox->addItem(tr("Use System Format"),"System");
+	numberFormatComboBox->addItem(tr("Use Interface Language Format"),"Language");
 
 	connect(languageComboBox, SIGNAL(activated(const QString &)), this, SLOT(setSelectedGUILang(const QString &)));
 	connect(storyEditorFontPushButton, SIGNAL(clicked()), this, SLOT(changeStoryEditorFont()));
@@ -57,11 +60,12 @@
 
 void Prefs_UserInterface::languageChange()
 {
-	languageComboBox->setToolTip( "<qt>" + tr( "Select your default language for Scribus to run with. Leave this blank to choose based on environment variables. You can still override this by passing a command line option when starting Scribus." )+"</qt>");
 	themeComboBox->setToolTip( "<qt>" + tr( "Choose the default window decoration and looks. Scribus inherits any available KDE or Qt themes, if Qt is configured to search KDE plugins." ) + "</qt>");
 	iconSetComboBox->setToolTip( "<qt>" + tr( "Choose the default icon set" ) + "</qt>");
 	useSmallWidgetsCheckBox->setToolTip( "<qt>" + tr( "Palette windows will use smaller (space savy) widgets. Requires application restart." ) + "</qt>");
 	recentDocumentsSpinBox->setToolTip( "<qt>" + tr( "Number of recently edited documents to show in the File menu" ) + "</qt>");
+	languageComboBox->setToolTip( "<qt>" + tr( "Select your default language for Scribus to run with. Leave this blank to choose based on environment variables. You can still override this by passing a command line option when starting Scribus." )+"</qt>");
+	numberFormatComboBox->setToolTip( "<qt>" + tr( "Use either the system or selected language related definition for number formats for decimals for numbers in the interface" ) + "</qt>");
 	fontSizeMenuSpinBox->setToolTip( "<qt>" + tr( "Default font size for the menus and windows" ) + "</qt>");
 	fontSizePaletteSpinBox->setToolTip( "<qt>" + tr( "Default font size for the tool windows" ) + "</qt>");
 	resizeMoveDelaySpinBox->setToolTip( "<qt>" + tr( "Time before resize or move starts allows for a slight delay between when you click and the operation happens to avoid unintended moves. This can be helpful when dealing with mouse sensitivity settings or accessibility issues related to ergonomic mice, touch pads or moveability of the wrists and hands." ) + "</qt>");
@@ -88,6 +92,7 @@
 		langString = LanguageManager::instance()->getLangFromAbbrev(selectedGUILang);
 	}
 	setCurrentComboItem(languageComboBox, langString);
+	numberFormatComboBox->setCurrentIndex(prefsData->uiPrefs.userPreferredLocale == "System" ? 0 : 1);
 	setCurrentComboItem(themeComboBox, prefsData->uiPrefs.style);
 	setCurrentComboItem(iconSetComboBox, prefsData->uiPrefs.iconSet);
 	fontSizeMenuSpinBox->setValue( prefsData->uiPrefs.applicationFontSize );
@@ -112,6 +117,7 @@
 void Prefs_UserInterface::saveGuiToPrefs(struct ApplicationPrefs *prefsData) const
 {
 	prefsData->uiPrefs.language=selectedGUILang;
+	prefsData->uiPrefs.userPreferredLocale=numberFormatComboBox->currentData().toString();
 	prefsData->uiPrefs.style=themeComboBox->currentText();
 	prefsData->uiPrefs.iconSet=IconManager::instance().baseNameForTranslation(iconSetComboBox->currentText());
 	prefsData->uiPrefs.applicationFontSize=fontSizeMenuSpinBox->value();

Modified: trunk/Scribus/scribus/ui/prefs_userinterfacebase.ui
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/prefs_userinterfacebase.ui
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_userinterfacebase.ui	(original)
+++ trunk/Scribus/scribus/ui/prefs_userinterfacebase.ui	Tue Apr 14 08:34:13 2020
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>803</width>
-    <height>481</height>
+    <height>744</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -71,6 +71,96 @@
           <enum>QFormLayout::FieldsStayAtSizeHint</enum>
          </property>
          <item row="0" column="0">
+          <widget class="QLabel" name="themeLabel">
+           <property name="text">
+            <string>&Theme:</string>
+           </property>
+           <property name="buddy">
+            <cstring>themeComboBox</cstring>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="QComboBox" name="themeComboBox"/>
+         </item>
+         <item row="1" column="0">
+          <widget class="QLabel" name="label_3">
+           <property name="text">
+            <string>Icon Set:</string>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="1">
+          <widget class="QComboBox" name="iconSetComboBox"/>
+         </item>
+         <item row="2" column="1">
+          <widget class="QCheckBox" name="useSmallWidgetsCheckBox">
+           <property name="text">
+            <string>Use Small Widgets on Palettes</string>
+           </property>
+          </widget>
+         </item>
+         <item row="3" column="1">
+          <widget class="QCheckBox" name="useTabsForDocumentsCheckBox">
+           <property name="text">
+            <string>Use Tabs for Documents</string>
+           </property>
+          </widget>
+         </item>
+         <item row="4" column="0">
+          <widget class="QLabel" name="recentDocumentsLabel">
+           <property name="text">
+            <string>&Recent Documents:</string>
+           </property>
+           <property name="buddy">
+            <cstring>recentDocumentsSpinBox</cstring>
+           </property>
+          </widget>
+         </item>
+         <item row="4" column="1">
+          <widget class="QSpinBox" name="recentDocumentsSpinBox"/>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <spacer name="verticalSpacer_6">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Fixed</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QLabel" name="label_4">
+         <property name="font">
+          <font>
+           <weight>75</weight>
+           <bold>true</bold>
+          </font>
+         </property>
+         <property name="text">
+          <string>Language and Regionalization</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="Line" name="line_4">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <layout class="QFormLayout" name="formLayout_6">
+         <item row="0" column="0">
           <widget class="QLabel" name="languageLabel">
            <property name="text">
             <string>&Language:</string>
@@ -84,54 +174,17 @@
           <widget class="QComboBox" name="languageComboBox"/>
          </item>
          <item row="1" column="0">
-          <widget class="QLabel" name="themeLabel">
-           <property name="text">
-            <string>&Theme:</string>
-           </property>
-           <property name="buddy">
-            <cstring>themeComboBox</cstring>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="1">
-          <widget class="QComboBox" name="themeComboBox"/>
-         </item>
-         <item row="3" column="1">
-          <widget class="QCheckBox" name="useSmallWidgetsCheckBox">
-           <property name="text">
-            <string>Use Small Widgets on Palettes</string>
-           </property>
-          </widget>
-         </item>
-         <item row="4" column="1">
-          <widget class="QCheckBox" name="useTabsForDocumentsCheckBox">
-           <property name="text">
-            <string>Use Tabs for Documents</string>
-           </property>
-          </widget>
-         </item>
-         <item row="5" column="0">
-          <widget class="QLabel" name="recentDocumentsLabel">
-           <property name="text">
-            <string>&Recent Documents:</string>
-           </property>
-           <property name="buddy">
-            <cstring>recentDocumentsSpinBox</cstring>
-           </property>
-          </widget>
-         </item>
-         <item row="5" column="1">
-          <widget class="QSpinBox" name="recentDocumentsSpinBox"/>
-         </item>
-         <item row="2" column="1">
-          <widget class="QComboBox" name="iconSetComboBox"/>
-         </item>
-         <item row="2" column="0">
-          <widget class="QLabel" name="label_3">
-           <property name="text">
-            <string>Icon Set:</string>
-           </property>
-          </widget>
+          <widget class="QLabel" name="numberFormatLabel">
+           <property name="text">
+            <string>Number Format:</string>
+           </property>
+           <property name="buddy">
+            <cstring>numberFormatComboBox</cstring>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="1">
+          <widget class="QComboBox" name="numberFormatComboBox"/>
          </item>
         </layout>
        </item>
@@ -390,7 +443,6 @@
  </widget>
  <tabstops>
   <tabstop>tabWidget</tabstop>
-  <tabstop>languageComboBox</tabstop>
   <tabstop>themeComboBox</tabstop>
   <tabstop>iconSetComboBox</tabstop>
   <tabstop>useSmallWidgetsCheckBox</tabstop>

Modified: trunk/Scribus/scribus/ui/propertiespalette_image.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/propertiespalette_image.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_image.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_image.cpp	Tue Apr 14 08:34:13 2020
@@ -12,14 +12,17 @@
 #define _USE_MATH_DEFINES
 #endif
 #include <cmath>
+#include <QLocale>
 #include <QSignalBlocker>
 
 #include "commonstrings.h"
+#include "localemgr.h"
 #include "pageitem.h"
 #include "propertiespalette_utils.h"
 #include "sccolorengine.h"
 #include "scribuscore.h"
 #include "scraction.h"
+#include "scribusapp.h"
 #include "scribusview.h"
 #include "selection.h"
 #include "units.h"
@@ -93,7 +96,7 @@
 
 	languageChange();
 
-	connect(imagePageNumber    , SIGNAL(valueChanged(double))   , this, SLOT(handleImagePageNumber()));
+	connect(imagePageNumber    , SIGNAL(valueChanged(double)), this, SLOT(handleImagePageNumber()));
 	connect(imageXScaleSpinBox , SIGNAL(valueChanged(double)), this, SLOT(handleXScale()));
 	connect(imageYScaleSpinBox , SIGNAL(valueChanged(double)), this, SLOT(handleYScale()));
 	connect(imageXOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(handleLocalXY()));
@@ -112,6 +115,8 @@
 	connect(renderIntent       , SIGNAL(activated(int))      , this, SLOT(handleIntent()));
 	connect(compressionMethod  , SIGNAL(activated(int))      , this, SLOT(handleCompressionMethod()));
 	connect(compressionQuality , SIGNAL(activated(int))      , this, SLOT(handleCompressionQuality()));
+	connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange()));
+
 }
 
 void PropertiesPalette_Image::updateSpinBoxConstants()
@@ -853,6 +858,19 @@
 	imageYOffsetSpinBox->blockSignals(false);
 }
 
+void PropertiesPalette_Image::localeChange()
+{
+	const QLocale& l(LocaleManager::instance().userPreferredLocale());
+	imagePageNumber->setLocale(l);
+	imageXScaleSpinBox->setLocale(l);
+	imageYScaleSpinBox->setLocale(l);
+	imageXOffsetSpinBox->setLocale(l);
+	imageYOffsetSpinBox->setLocale(l);
+	imageRotation->setLocale(l);
+	imgDpiX->setLocale(l);
+	imgDpiY->setLocale(l);
+}
+
 bool PropertiesPalette_Image::userActionOn()
 {
 	return m_userActionOn;;

Modified: trunk/Scribus/scribus/ui/propertiespalette_image.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/propertiespalette_image.h
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_image.h	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_image.h	Tue Apr 14 08:34:13 2020
@@ -72,6 +72,7 @@
 
 	void languageChange();
 	void unitChange();
+	void localeChange();
 
 protected slots:
 	void spinboxStartUserAction();

Modified: trunk/Scribus/scribus/ui/propertiespalette_line.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/propertiespalette_line.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_line.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_line.cpp	Tue Apr 14 08:34:13 2020
@@ -17,6 +17,7 @@
 #include "commonstrings.h"
 #include "dasheditor.h"
 #include "iconmanager.h"
+#include "localemgr.h"
 #include "pageitem.h"
 #include "pageitem_textframe.h"
 #include "sccolorengine.h"
@@ -73,6 +74,7 @@
 	languageChange();
 
 	connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange()));
+	connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange()));
 
 	connect(lineWidth, SIGNAL(valueChanged(double)), this, SLOT(handleLineWidth()));
 	connect(lineType, SIGNAL(activated(int)), this, SLOT(handleLineStyle()));
@@ -761,3 +763,9 @@
 	lineWidth->setNewUnit( m_unitIndex );
 	lineWidth->blockSignals(false);
 }
+
+void PropertiesPalette_Line::localeChange()
+{
+	const QLocale& l(LocaleManager::instance().userPreferredLocale());
+	lineWidth->setLocale(l);
+}

Modified: trunk/Scribus/scribus/ui/propertiespalette_line.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/propertiespalette_line.h
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_line.h	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_line.h	Tue Apr 14 08:34:13 2020
@@ -34,11 +34,11 @@
 
 protected:
 
-	bool      m_haveDoc;
-	bool      m_haveItem;
-	bool      m_lineMode;
-	double    m_unitRatio;
-	int       m_unitIndex;
+	bool m_haveDoc;
+	bool m_haveItem;
+	bool m_lineMode;
+	double m_unitRatio;
+	int m_unitIndex;
 
 	PageItem *m_item;
 	ScribusMainWindow*       m_ScMW;
@@ -67,6 +67,7 @@
 	void iconSetChange();
 	void languageChange();
 	void unitChange();
+	void localeChange();
 
 private slots:
 

Modified: trunk/Scribus/scribus/ui/propertiespalette_shadow.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/propertiespalette_shadow.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_shadow.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_shadow.cpp	Tue Apr 14 08:34:13 2020
@@ -11,17 +11,18 @@
 #define _USE_MATH_DEFINES
 #endif
 #include <cmath>
+
 #include "commonstrings.h"
-#include "sccolorengine.h"
+#include "localemgr.h"
 #include "pageitem.h"
 #include "propertiespalette_utils.h"
-
+#include "sccolorengine.h"
+#include "scraction.h"
+#include "scribusapp.h"
 #include "scribuscore.h"
-#include "scraction.h"
-
 #include "selection.h"
+#include "undomanager.h"
 #include "units.h"
-#include "undomanager.h"
 #include "util.h"
 #include "util_math.h"
 
@@ -86,6 +87,7 @@
 
 	setSizePolicy( QSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum));
 	connect(this->model(), SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)), this, SLOT(handleNewValues()));
+	connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange()));
 
 	m_haveItem = false;
 }
@@ -238,6 +240,13 @@
 	softShadowYOffset->blockSignals(sigBlocked2);
 	softShadowBlurRadius->blockSignals(sigBlocked3);
 	this->model()->blockSignals(sigBlocked4);
+}
+
+void PropertiesPalette_Shadow::localeChange()
+{
+	softShadowXOffset->localeChange();
+	softShadowYOffset->localeChange();
+	softShadowBlurRadius->localeChange();
 }
 
 void PropertiesPalette_Shadow::updateColorList()

Modified: trunk/Scribus/scribus/ui/propertiespalette_shadow.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/propertiespalette_shadow.h
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_shadow.h	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_shadow.h	Tue Apr 14 08:34:13 2020
@@ -42,6 +42,8 @@
 
 	void languageChange();
 	void unitChange();
+	void localeChange();
+
 	void handleSelectionChanged();
 	void handleUpdateRequest(int);
 

Modified: trunk/Scribus/scribus/ui/propertiespalette_shape.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/propertiespalette_shape.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_shape.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_shape.cpp	Tue Apr 14 08:34:13 2020
@@ -16,6 +16,7 @@
 #include "autoform.h"
 #include "commonstrings.h"
 #include "iconmanager.h"
+#include "localemgr.h"
 #include "pageitem_arc.h"
 #include "pageitem_regularpolygon.h"
 #include "pageitem_textframe.h"
@@ -54,6 +55,7 @@
 	languageChange();
 
 	connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange()));
+	connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange()));
 
 	connect(textFlowBtnGroup, SIGNAL(buttonClicked(int)), this, SLOT(handleTextFlow()));
 	connect(editShape  , SIGNAL(clicked())                 , this, SLOT(handleShapeEdit()));
@@ -560,3 +562,9 @@
 	roundRect->setNewUnit( m_unitIndex );
 	roundRect->blockSignals(false);
 }
+
+void PropertiesPalette_Shape::localeChange()
+{
+	const QLocale& l(LocaleManager::instance().userPreferredLocale());
+	roundRect->setLocale(l);
+}

Modified: trunk/Scribus/scribus/ui/propertiespalette_shape.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/propertiespalette_shape.h
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_shape.h	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_shape.h	Tue Apr 14 08:34:13 2020
@@ -73,6 +73,7 @@
 	void iconSetChange();
 	void languageChange();
 	void unitChange();
+	void localeChange();
 
 private slots:
 

Modified: trunk/Scribus/scribus/ui/propertiespalette_text.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/propertiespalette_text.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_text.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_text.cpp	Tue Apr 14 08:34:13 2020
@@ -20,6 +20,7 @@
 #include "commonstrings.h"
 #include "fontcombo.h"
 #include "iconmanager.h"
+#include "localemgr.h"
 #include "pageitem.h"
 #include "pageitem_table.h"
 #include "pageitem_textframe.h"
@@ -36,6 +37,7 @@
 #include "propertywidget_textcolor.h"
 #include "scfonts.h"
 #include "scraction.h"
+#include "scribusapp.h"
 #include "scribuscore.h"
 #include "selection.h"
 #include "spalette.h"
@@ -121,6 +123,8 @@
 
 	connect(fontfeaturesWidget, SIGNAL(needsRelayout()), this, SLOT(updateTreeLayout()));
 	connect(parEffectWidgets,   SIGNAL(needsRelayout()), this, SLOT(updateTreeLayout()));
+
+	connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange()));
 
 	m_haveItem = false;
 	setEnabled(false);
@@ -379,6 +383,18 @@
 	m_haveItem = tmp;
 }
 
+void PropertiesPalette_Text::localeChange()
+{
+	const QLocale& l(LocaleManager::instance().userPreferredLocale());
+	fontSize->setLocale(l);
+	lineSpacing->setLocale(l);
+	advancedWidgets->localeChange();
+	colorWidgets->localeChange();
+	distanceWidgets->localeChange();
+	parEffectWidgets->localeChange();
+	pathTextWidgets->localeChange();
+}
+
 void PropertiesPalette_Text::handleLineSpacingMode(int id)
 {
 	if ((m_haveDoc) && (m_haveItem))

Modified: trunk/Scribus/scribus/ui/propertiespalette_text.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/propertiespalette_text.h
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_text.h	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_text.h	Tue Apr 14 08:34:13 2020
@@ -75,6 +75,7 @@
 
 	void languageChange();
 	void unitChange();
+	void localeChange();
 	void changeLang(int id);
 
 	void showAlignment(int e);

Modified: trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp	Tue Apr 14 08:34:13 2020
@@ -14,13 +14,15 @@
 #endif
 #include <cmath>
 
+
 #include "appmodehelper.h"
 #include "appmodes.h"
 #include "autoform.h"
 #include "basepointwidget.h"
+#include "colorlistbox.h"
 #include "commonstrings.h"
-#include "colorlistbox.h"
-#include "sccolorengine.h"
+#include "iconmanager.h"
+#include "localemgr.h"
 #include "pageitem.h"
 #include "pageitem_arc.h"
 #include "pageitem_group.h"
@@ -28,18 +30,17 @@
 #include "pageitem_spiral.h"
 #include "pageitem_textframe.h"
 #include "propertiespalette_utils.h"
-
-#include "scribuscore.h"
+#include "sccolorengine.h"
 #include "scraction.h"
 #include "scribusapp.h"
+#include "scribuscore.h"
 #include "scribusdoc.h"
 #include "scribusview.h"
 #include "selection.h"
 #include "tabmanager.h"
+#include "undomanager.h"
 #include "units.h"
-#include "undomanager.h"
 #include "util.h"
-#include "iconmanager.h"
 #include "util_math.h"
 
 //using namespace std;
@@ -94,6 +95,7 @@
 	languageChange();
 
 	connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange()));
+	connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange()));
 
 	connect(xposSpin, SIGNAL(valueChanged(double)), this, SLOT(handleNewX()));
 	connect(yposSpin, SIGNAL(valueChanged(double)), this, SLOT(handleNewY()));
@@ -537,6 +539,16 @@
 	widthSpin->setNewUnit( m_unitIndex );
 	heightSpin->setNewUnit( m_unitIndex );
 	m_haveItem = tmp;
+}
+
+void PropertiesPalette_XYZ::localeChange()
+{
+	const QLocale& l(LocaleManager::instance().userPreferredLocale());
+	xposSpin->setLocale(l);
+	yposSpin->setLocale(l);
+	widthSpin->setLocale(l);
+	heightSpin->setLocale(l);
+	rotationSpin->setLocale(l);
 }
 
 void PropertiesPalette_XYZ::showXY(double x, double y)

Modified: trunk/Scribus/scribus/ui/propertiespalette_xyz.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/propertiespalette_xyz.h
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_xyz.h	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_xyz.h	Tue Apr 14 08:34:13 2020
@@ -56,6 +56,7 @@
 	void iconSetChange();
 	void languageChange();
 	void unitChange();
+	void localeChange();
 
 	void showXY(double x, double y);
 	void showWH(double x, double y);

Modified: trunk/Scribus/scribus/ui/propertywidget_advanced.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/propertywidget_advanced.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_advanced.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertywidget_advanced.cpp	Tue Apr 14 08:34:13 2020
@@ -9,6 +9,7 @@
 
 #include "appmodes.h"
 #include "iconmanager.h"
+#include "localemgr.h"
 #include "pageitem_table.h"
 #include "scribus.h"
 #include "scribusapp.h"
@@ -45,6 +46,7 @@
 	languageChange();
 
 	connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange()));
+	connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange()));
 }
 
 void PropertyWidget_Advanced::setMainWindow(ScribusMainWindow *mw)
@@ -378,3 +380,16 @@
 {
 	retranslateUi(this);
 }
+
+void PropertyWidget_Advanced::localeChange()
+{
+	const QLocale& l(LocaleManager::instance().userPreferredLocale());
+	textBase->setLocale(l);
+	tracking->setLocale(l);
+	scaleH->setLocale(l);
+	scaleV->setLocale(l);
+	minWordTrackingSpinBox->setLocale(l);
+	normWordTrackingSpinBox->setLocale(l);
+	minGlyphExtSpinBox->setLocale(l);
+	maxGlyphExtSpinBox->setLocale(l);
+}

Modified: trunk/Scribus/scribus/ui/propertywidget_advanced.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/propertywidget_advanced.h
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_advanced.h	(original)
+++ trunk/Scribus/scribus/ui/propertywidget_advanced.h	Tue Apr 14 08:34:13 2020
@@ -49,6 +49,7 @@
 	void iconSetChange();
 	void languageChange();
 	void unitChange() {};
+	void localeChange();
 
 	void showBaseLineOffset(double e);
 	void showTextScaleH(double e);

Modified: trunk/Scribus/scribus/ui/propertywidget_distance.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/propertywidget_distance.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_distance.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertywidget_distance.cpp	Tue Apr 14 08:34:13 2020
@@ -11,9 +11,11 @@
 
 #include "appmodehelper.h"
 #include "appmodes.h"
+#include "localemgr.h"
 #include "pageitem_table.h"
 #include "pageitem_textframe.h"
 #include "scribus.h"
+#include "scribusapp.h"
 #include "scribusdoc.h"
 #include "selection.h"
 #include "tabmanager.h"
@@ -55,6 +57,8 @@
 	languageChange();
 
 	columnGapLabel->setCurrentIndex(0);
+
+	connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange()));
 }
 
 void PropertyWidget_Distance::setMainWindow(ScribusMainWindow* mw)
@@ -489,3 +493,13 @@
 	bottomDistance->blockSignals(false);
 	rightDistance->blockSignals(false);
 }
+
+void PropertyWidget_Distance::localeChange()
+{
+	const QLocale& l(LocaleManager::instance().userPreferredLocale());
+	columnGap->setLocale(l);
+	topDistance->setLocale(l);
+	bottomDistance->setLocale(l);
+	leftDistance->setLocale(l);
+	rightDistance->setLocale(l);
+}

Modified: trunk/Scribus/scribus/ui/propertywidget_distance.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/propertywidget_distance.h
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_distance.h	(original)
+++ trunk/Scribus/scribus/ui/propertywidget_distance.h	Tue Apr 14 08:34:13 2020
@@ -48,6 +48,7 @@
 
 	void languageChange();
 	void unitChange();
+	void localeChange();
 
 	void showColumns(int r, double g);
 	void showTextDistances(double left, double top, double bottom, double right);

Modified: trunk/Scribus/scribus/ui/propertywidget_pareffect.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/propertywidget_pareffect.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_pareffect.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertywidget_pareffect.cpp	Tue Apr 14 08:34:13 2020
@@ -12,6 +12,7 @@
 #include "appmodehelper.h"
 #include "appmodes.h"
 #include "iconmanager.h"
+#include "localemgr.h"
 #include "pageitem.h"
 #include "pageitem_table.h"
 #include "scribus.h"
@@ -125,6 +126,12 @@
 	bool sigBlocked = peOffset->blockSignals(true);
 	peOffset->setNewUnit( m_unitIndex );
 	peOffset->blockSignals(sigBlocked);
+}
+
+void PropertyWidget_ParEffect::localeChange()
+{
+	const QLocale& l(LocaleManager::instance().userPreferredLocale());
+	peOffset->setLocale(l);
 }
 
 void PropertyWidget_ParEffect::fillNumerationsCombo()

Modified: trunk/Scribus/scribus/ui/propertywidget_pareffect.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/propertywidget_pareffect.h
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_pareffect.h	(original)
+++ trunk/Scribus/scribus/ui/propertywidget_pareffect.h	Tue Apr 14 08:34:13 2020
@@ -54,6 +54,7 @@
 	void iconSetChange();
 	void languageChange();
 	void unitChange();
+	void localeChange();
 
 	void handleParEffectUse();
 	void handleBulletStr(QString);

Modified: trunk/Scribus/scribus/ui/propertywidget_pathtext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/propertywidget_pathtext.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_pathtext.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertywidget_pathtext.cpp	Tue Apr 14 08:34:13 2020
@@ -9,7 +9,9 @@
 
 #include <QSignalBlocker>
 
+#include "localemgr.h"
 #include "scribus.h"
+#include "scribusapp.h"
 #include "scribusdoc.h"
 #include "selection.h"
 #include "units.h"
@@ -33,6 +35,8 @@
 
 	distFromCurve->setValues(-300, 300, 2, 0);
 	distFromCurve->setSingleStep(10);
+
+	connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange()));
 
 	languageChange();
 }
@@ -255,3 +259,10 @@
 	startOffset->setNewUnit( m_unitIndex );
 	distFromCurve->setNewUnit( m_unitIndex );
 }
+
+void PropertyWidget_PathText::localeChange()
+{
+	const QLocale& l(LocaleManager::instance().userPreferredLocale());
+	startOffset->setLocale(l);
+	distFromCurve->setLocale(l);
+}

Modified: trunk/Scribus/scribus/ui/propertywidget_pathtext.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/propertywidget_pathtext.h
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_pathtext.h	(original)
+++ trunk/Scribus/scribus/ui/propertywidget_pathtext.h	Tue Apr 14 08:34:13 2020
@@ -47,6 +47,7 @@
 
 	void languageChange();
 	void unitChange();
+	void localeChange();
 
 private slots:
 	void handlePathType();

Modified: trunk/Scribus/scribus/ui/propertywidget_textcolor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/propertywidget_textcolor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_textcolor.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertywidget_textcolor.cpp	Tue Apr 14 08:34:13 2020
@@ -5,9 +5,10 @@
 for which a new license (GPL+exception) is in place.
 */
 
-
+#include <QLocale>
 #include "appmodes.h"
 #include "iconmanager.h"
+#include "localemgr.h"
 #include "pageitem_table.h"
 #include "propertywidget_textcolor.h"
 #include "scribus.h"
@@ -48,6 +49,8 @@
 	strokeShade->setEnabled(false);
 
 	connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange()));
+	connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange()));
+
 }
 
 void PropertyWidget_TextColor::setMainWindow(ScribusMainWindow *mw)
@@ -509,3 +512,15 @@
 	retranslateUi(this);
 	textEffects->languageChange();
 }
+
+void PropertyWidget_TextColor::localeChange()
+{
+	const QLocale& l(LocaleManager::instance().userPreferredLocale());
+	textEffects->ShadowVal->Xoffset->setLocale(l);
+	textEffects->ShadowVal->Yoffset->setLocale(l);
+	textEffects->OutlineVal->LWidth->setLocale(l);
+	textEffects->UnderlineVal->LPos->setLocale(l);
+	textEffects->UnderlineVal->LWidth->setLocale(l);
+	textEffects->StrikeVal->LPos->setLocale(l);
+	textEffects->StrikeVal->LWidth->setLocale(l);
+}

Modified: trunk/Scribus/scribus/ui/propertywidget_textcolor.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/propertywidget_textcolor.h
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_textcolor.h	(original)
+++ trunk/Scribus/scribus/ui/propertywidget_textcolor.h	Tue Apr 14 08:34:13 2020
@@ -47,6 +47,7 @@
 	void iconSetChange();
 	void languageChange();
 	void unitChange() {};
+	void localeChange();
 
 	void showOutlineW(double x);
 	void showShadowOffset(double x, double y);

Modified: trunk/Scribus/scribus/ui/proptree.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/proptree.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/proptree.cpp	(original)
+++ trunk/Scribus/scribus/ui/proptree.cpp	Tue Apr 14 08:34:13 2020
@@ -31,6 +31,7 @@
 #include "proptree.h"
 
 #include "colorcombo.h"
+#include "localemgr.h"
 #include "scrspinbox.h"
 #include <QCheckBox>
 #include <QApplication>
@@ -360,8 +361,12 @@
 
 void PropTreeItem::setDoubleValue(double value)
 {
+	const QLocale& l(LocaleManager::instance().userPreferredLocale());
+
 	setData(1, Qt::UserRole, value);
-	setData(1, Qt::DisplayRole, QString("%1 %2").arg(value, 0, 'f', m_decimals).arg(unitGetSuffixFromIndex(m_unit)));
+//	setData(1, Qt::DisplayRole, QString("%1 %2").arg(value, 0, 'f', m_decimals).arg(unitGetSuffixFromIndex(m_unit)));
+	setData(1, Qt::DisplayRole, QString("%1 %2").arg(l.toString(value, 'f', m_decimals)).arg(unitGetSuffixFromIndex(m_unit)));
+
 }
 
 void PropTreeItem::setBoolValue(bool value)
@@ -395,7 +400,10 @@
 {
 	m_decimals = unit;
 	if (m_type == DoubleSpinBox)
-		setData(1, Qt::DisplayRole, QString("%1 %2").arg(data(1, Qt::UserRole).toDouble(), 0, 'f', unit).arg(unitGetSuffixFromIndex(m_unit)));
+	{
+		const QLocale& l(LocaleManager::instance().userPreferredLocale());
+		setData(1, Qt::DisplayRole, QString("%1 %2").arg(l.toString(data(1, Qt::UserRole).toDouble(), 'f', unit)).arg(unitGetSuffixFromIndex(m_unit)));
+	}
 	else
 		setData(1, Qt::DisplayRole, QString("%1 %2").arg(data(1, Qt::UserRole).toString(), unitGetSuffixFromIndex(m_unit)));
 }
@@ -420,6 +428,14 @@
 void PropTreeItem::setColorList(const ColorList& colors)
 {
 	m_colors = colors;
+}
+
+void PropTreeItem::localeChange()
+{
+	if (m_type == DoubleSpinBox)
+	{
+		setDoubleValue(data(1, Qt::UserRole).toDouble());
+	}
 }
 
 PropTreeWidget::PropTreeWidget(QWidget* pa) : QTreeWidget(pa)

Modified: trunk/Scribus/scribus/ui/proptree.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/proptree.h
==============================================================================
--- trunk/Scribus/scribus/ui/proptree.h	(original)
+++ trunk/Scribus/scribus/ui/proptree.h	Tue Apr 14 08:34:13 2020
@@ -47,8 +47,10 @@
 	virtual void destroyEditor(QWidget * editor, const QModelIndex & index) const;
 	virtual void updateEditorGeometry(QWidget *editor,const QStyleOptionViewItem &option, const QModelIndex &index) const;
 	virtual QSize sizeHint(const QStyleOptionViewItem &opt, const QModelIndex &index) const;
+
 private slots:
 	void valueHasChanged();
+
 private:
 	PropTreeWidget *m_parent;
 	mutable QWidget *m_edit {nullptr};
@@ -109,6 +111,9 @@
 	void valueChanged(QString);
 	void editFinished();
 	void editStarted();
+
+public slots:
+	void localeChange();
 };
 
 class SCRIBUS_API PropTreeWidget : public QTreeWidget

Modified: trunk/Scribus/scribus/ui/scrspinbox.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/ui/scrspinbox.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scrspinbox.cpp	(original)
+++ trunk/Scribus/scribus/ui/scrspinbox.cpp	Tue Apr 14 08:34:13 2020
@@ -8,7 +8,7 @@
  *   Craig Bradney, cbradney at zip.com.au                                    *
  ***************************************************************************/
 
-#include <clocale>
+//#include <clocale>
 #include <cmath>
 
 #include <QtDebug>
@@ -18,6 +18,7 @@
 #include <QRegExp>
 
 #include "commonstrings.h"
+#include "localemgr.h"
 #include "scrspinbox.h"
 #include "units.h"
 #include "third_party/fparser/fparser.hh"
@@ -41,6 +42,7 @@
 	m_unitIndex = unitIndex;
 	setSuffix(unitGetSuffixFromIndex(m_unitIndex));
 	setDecimals(unitGetPrecisionFromIndex(m_unitIndex));
+	setLocale(LocaleManager::instance().userPreferredLocale());
 	setSingleStep(1.0);
 	lineEdit()->setValidator(nullptr);
 	disconnect(this, SIGNAL(valueChanged(const QString &)), this, SLOT(textChanged()));
@@ -152,11 +154,26 @@
 	//Replace our pica XpY.Z format with (X*12+Y.Z)pt
 	if (CommonStrings::trStrP.localeAwareCompare(CommonStrings::strP)!=0)
 		ts.replace(CommonStrings::trStrP, CommonStrings::strP);
+
+//	const lconv * lc(localeconv());
+	QString cSepDecimal(QLocale::c().decimalPoint());
+	QString cSepGroup(QLocale::c().groupSeparator());
+	QString sysSepDecimal(QLocale::system().decimalPoint());
+//	qDebug()<<"sysSepDecimal"<<sysSepDecimal;
+	QString sysSepGroup(QLocale::system().groupSeparator());
+//	qDebug()<<"sysSepGroup"<<sysSepGroup;
+//	QString crtSepDecimal(QString::fromLocal8Bit( lc->decimal_point ));
+//	QString crtSepGroup(QString::fromLocal8Bit( lc->thousands_sep ));
+//	QString crtSepDecimal(LocaleManager::instance().userPreferredLocale().decimalPoint());
+	QString crtSepGroup(LocaleManager::instance().userPreferredLocale().groupSeparator());
+//	qDebug()<<"crtSepGroup"<<crtSepGroup;
+	QString crtSepDecimal(LocaleManager::instance().userPreferredLocale().decimalPoint());
+//	qDebug()<<"crtSepDecimal"<<crtSepDecimal;
 	QRegExp rxP;
 	if (m_unitIndex==SC_PICAS)
-		rxP.setPattern("\\b(\\d+)" + CommonStrings::strP + "?(\\d+\\.?\\d*)?\\b");
+		rxP.setPattern("\\b(\\d+)" + CommonStrings::strP + "?(\\d+\\"+crtSepDecimal+"?\\d*)?\\b");
 	else
-		rxP.setPattern("\\b(\\d+)" + CommonStrings::strP + "(\\d+\\.?\\d*)?\\b");
+		rxP.setPattern("\\b(\\d+)" + CommonStrings::strP + "(\\d+\\"+crtSepDecimal+"?\\d*)?\\b");
 	int posP = 0;
 	while (posP >= 0)
 	{
@@ -173,20 +190,34 @@
 	}
 // 	qDebug() << "##" << ts;
 
-	const lconv * lc(localeconv());
-	QString sysSepDecimal(QLocale::system().decimalPoint());
-	QString sysSepGroup(QLocale::system().groupSeparator());
-	QString crtSepDecimal(QString::fromLocal8Bit( lc->decimal_point ));
-	QString crtSepGroup(QString::fromLocal8Bit( lc->thousands_sep ));
+/*
 	// this could be hardcoded: "."
-	QString cSepDecimal(QLocale::c().decimalPoint());
+
 	if (sysSepGroup != sysSepDecimal)
+	{
+		qDebug()<<"Removing "<<sysSepGroup;
 		ts.remove(sysSepGroup);
+	}
 	ts.replace(sysSepDecimal, crtSepDecimal);
+	qDebug()<<"Replacing "<<sysSepDecimal<<"by"<<crtSepDecimal;
 	if (crtSepGroup != crtSepDecimal)
+	{
+		qDebug()<<"Removing "<<crtSepGroup;
 		ts.remove(crtSepGroup);
+	}
 	ts.replace(crtSepDecimal, cSepDecimal);
-	
+	qDebug()<<"Replacing "<<crtSepDecimal<<"by"<<cSepDecimal;
+	*/
+	if (crtSepGroup != cSepGroup)
+	{
+//		qDebug()<<"Removing "<<crtSepGroup;
+		ts.remove(crtSepGroup);
+	}
+	if (crtSepDecimal != cSepDecimal)
+	{
+		ts.replace(crtSepDecimal, cSepDecimal);
+//		qDebug()<<"Replacing "<<crtSepDecimal<<"by"<<cSepDecimal;
+	}
 	ts.replace(CommonStrings::trStrPX, "");
 	ts.replace("%", "");
 	ts.replace("°", "");
@@ -252,14 +283,11 @@
 			++it;
 		}
 	}
-//	qDebug() << "TS"<<ts;
 	std::string str(ts.toLocal8Bit().data());
 	double erg = this->value();
-
 	int ret = fp.Parse(str, "", true);
 	if(ret < 0)
 		erg = fp.Eval(nullptr);
-
 	//qDebug() << "fp value =" << erg ;
 	return erg;
 }
@@ -334,5 +362,10 @@
 		return retval;
 	}
 
+	if (event->type() == QEvent::LocaleChange)
+	{
+		setLocale(LocaleManager::instance().userPreferredLocale());
+	}
+
 	return QDoubleSpinBox::eventFilter(watched, event);
 }

Modified: trunk/Scribus/scribus/units.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23607&path=/trunk/Scribus/scribus/units.cpp
==============================================================================
--- trunk/Scribus/scribus/units.cpp	(original)
+++ trunk/Scribus/scribus/units.cpp	Tue Apr 14 08:34:13 2020
@@ -20,8 +20,11 @@
  ***************************************************************************/
 
 #include <cmath>
+#include <QLocale>
 #include <QString>
 #include <QObject>
+#include "localemgr.h"
+#include "scribuscore.h"
 #include "units.h"
 
 /*!
@@ -373,9 +376,9 @@
 	else
 	{
 		if (round2Precision)
-			s=QString::number(pts2value(unitValue, unitIndex), 'f', unitGetPrecisionFromIndex(unitIndex));
+			s=LocaleManager::instance().userPreferredLocale().toString(pts2value(unitValue, unitIndex), 'f', unitGetPrecisionFromIndex(unitIndex));
 		else
-			s=QString::number(pts2value(unitValue, unitIndex));
+			s=LocaleManager::instance().userPreferredLocale().toString(pts2value(unitValue, unitIndex));
 		if (appendSuffix)
 			s += " " + unitGetStrFromIndex(unitIndex);
 	}




More information about the scribus-commit mailing list