r17986 by craig - #10113: First start localisation. Initial code using same defaults as before for now
scribus-commit
scribus-commit at lists.scribus.net
Thu Dec 27 15:11:44 UTC 2012
Author: craig
Date: Thu Dec 27 15:11:44 2012
New Revision: 17986
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17986
Log:
#10113: First start localisation. Initial code using same defaults as before for now
Added:
trunk/Scribus/scribus/localemgr.cpp (with props)
trunk/Scribus/scribus/localemgr.h (with props)
Modified:
trunk/Scribus/scribus/CMakeLists.txt
trunk/Scribus/scribus/prefsmanager.cpp
trunk/Scribus/scribus/scribus.h
trunk/Scribus/scribus/scribusapp.cpp
trunk/Scribus/scribus/scribuscore.cpp
Modified: trunk/Scribus/scribus/CMakeLists.txt
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17986&path=/trunk/Scribus/scribus/CMakeLists.txt
==============================================================================
--- trunk/Scribus/scribus/CMakeLists.txt (original)
+++ trunk/Scribus/scribus/CMakeLists.txt Thu Dec 27 15:11:44 2012
@@ -575,6 +575,7 @@
langmgr.cpp
latexhelpers.cpp
loadsaveplugin.cpp
+ localemgr.cpp
menumanager.cpp
mesh.cpp
navigator.cpp
Modified: trunk/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17986&path=/trunk/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsmanager.cpp (original)
+++ trunk/Scribus/scribus/prefsmanager.cpp Thu Dec 27 15:11:44 2012
@@ -38,6 +38,7 @@
#include "commonstrings.h"
#include "filewatcher.h"
#include "latexhelpers.h"
+#include "localemgr.h"
#include "pagesize.h"
#include "pagestructs.h"
#include "pdfoptions.h"
@@ -47,9 +48,11 @@
#include "scdomelement.h"
#include "scfonts.h"
#include "scpaths.h"
+#include "scribusapp.h"
#include "scribuscore.h"
#include "scribusstructs.h"
#include "sctextstream.h"
+#include "units.h"
#include "util_color.h"
#include "util_file.h"
#include "util_ghostscript.h"
@@ -58,6 +61,7 @@
#include "ui/modetoolbar.h"
#include "ui/prefs_keyboardshortcuts.h"
+extern ScribusQApp* ScQApp;
extern bool emergencyActivated;
PrefsManager* PrefsManager::_instance = 0;
@@ -260,7 +264,8 @@
appPrefs.opToolPrefs.magMin = 1;
appPrefs.opToolPrefs.magMax = 3200;
appPrefs.opToolPrefs.magStep = 25;
- appPrefs.docSetupPrefs.docUnitIndex = 0;
+ qDebug()<<ScQApp->currGUILanguage();
+ appPrefs.docSetupPrefs.docUnitIndex = unitIndexFromString(LocaleManager::instance()->unitForLocale("default"));
appPrefs.itemToolPrefs.polyCorners = 4;
appPrefs.itemToolPrefs.polyFactor = 0.5;
appPrefs.itemToolPrefs.polyUseFactor = false;
@@ -295,11 +300,11 @@
appPrefs.scrapbookPrefs.writePreviews = true;
appPrefs.scrapbookPrefs.numScrapbookCopies = 10;
appPrefs.displayPrefs.marginColored = false;
- appPrefs.docSetupPrefs.pageSize = "A4";
+ appPrefs.docSetupPrefs.pageSize = LocaleManager::instance()->pageSizeForLocale("default");
appPrefs.docSetupPrefs.pageOrientation = 0;
- PageSize a4("A4");
- appPrefs.docSetupPrefs.pageWidth = a4.width();
- appPrefs.docSetupPrefs.pageHeight = a4.height();
+ PageSize defaultPageSize(appPrefs.docSetupPrefs.pageSize);
+ appPrefs.docSetupPrefs.pageWidth = defaultPageSize.width();
+ appPrefs.docSetupPrefs.pageHeight = defaultPageSize.height();
appPrefs.docSetupPrefs.margins.Top = 40;
appPrefs.docSetupPrefs.margins.Bottom = 40;
appPrefs.docSetupPrefs.margins.Left = 40;
Modified: trunk/Scribus/scribus/scribus.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17986&path=/trunk/Scribus/scribus/scribus.h
==============================================================================
--- trunk/Scribus/scribus/scribus.h (original)
+++ trunk/Scribus/scribus/scribus.h Thu Dec 27 15:11:44 2012
@@ -231,8 +231,6 @@
ScribusWin* ActWin;
QClipboard *ClipB;
QString LoadEnc;
- //QMap<QString, QStringList> InstLang;
- //QMap<QString,QString> LangTransl;
QProcess *ExternalApp;
Modified: trunk/Scribus/scribus/scribusapp.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17986&path=/trunk/Scribus/scribus/scribusapp.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusapp.cpp (original)
+++ trunk/Scribus/scribus/scribusapp.cpp Thu Dec 27 15:11:44 2012
@@ -477,8 +477,6 @@
ts << tr("Installed interface languages for Scribus are as follows:"); endl(ts);
endl(ts);
-// LanguageManager langMgr;
-// langMgr.init();
LanguageManager::instance()->printInstalledList();
endl(ts);
Modified: trunk/Scribus/scribus/scribuscore.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17986&path=/trunk/Scribus/scribus/scribuscore.cpp
==============================================================================
--- trunk/Scribus/scribus/scribuscore.cpp (original)
+++ trunk/Scribus/scribus/scribuscore.cpp Thu Dec 27 15:11:44 2012
@@ -28,6 +28,7 @@
#include "commonstrings.h"
#include "filewatcher.h"
+#include "localemgr.h"
#include "pluginmanager.h"
#include "prefsmanager.h"
#include "scimagecachemanager.h"
@@ -49,7 +50,6 @@
m_SplashScreen=0;
m_UseGUI=false;
m_HaveCMS=false;
-// m_PaletteParent=0;
m_currScMW=0;
ScColorMgmtStrategy strategy;
@@ -94,15 +94,12 @@
int ScribusCore::startGUI(bool showSplash, bool showFontInfo, bool showProfileInfo, const QString newGuiLanguage, const QString prefsUserFile)
{
-// m_PaletteParent=new QWidget(0);
-// Q_CHECK_PTR(m_PaletteParent);
ScribusMainWindow* scribus = new ScribusMainWindow();
Q_CHECK_PTR(scribus);
if (!scribus)
return(EXIT_FAILURE);
ScMWList.append(scribus);
m_currScMW=0;
-// ScMW=scribus;
int retVal=initScribusCore(showSplash, showFontInfo, showProfileInfo,newGuiLanguage, prefsUserFile);
if (retVal == 1)
return(EXIT_FAILURE);
@@ -113,7 +110,6 @@
closeSplash();
m_ScribusInitialized=true;
-// ScQApp->setMainWidget(scribus);
connect(ScQApp, SIGNAL(lastWindowClosed()), ScQApp, SLOT(quit()));
scribus->show();
@@ -155,6 +151,7 @@
int retVal=0;
//FIXME ExternalApp = 0;
initSplash(showSplash);
+ LocaleManager::instance();
prefsManager = PrefsManager::instance();
prefsManager->setup();
//CB #4428 Get fonts before prefs are set to default
More information about the scribus-commit
mailing list