From: vsv Date: Tue, 23 Jun 2015 09:23:41 +0000 (+0300) Subject: Issue #652: Provide locale management similarly to SALOME X-Git-Tag: V_1.3.0~211 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0427bfbfd24545ed45c8815e9c9c262dd98a01e7;p=modules%2Fshaper.git Issue #652: Provide locale management similarly to SALOME --- diff --git a/src/XGUI/NewGeom.xml b/src/XGUI/NewGeom.xml index 020622418..267113d71 100644 --- a/src/XGUI/NewGeom.xml +++ b/src/XGUI/NewGeom.xml @@ -3,6 +3,11 @@ +
+ + + +
diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 203e2a897..ec7ddf45a 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -68,6 +68,8 @@ #include #include +#include + #include #include #include @@ -80,6 +82,7 @@ #include #include #include +#include #ifdef _DEBUG #include @@ -110,6 +113,15 @@ XGUI_Workshop::XGUI_Workshop(XGUI_SalomeConnector* theConnector) { myMainWindow = mySalomeConnector ? 0 : new AppElements_MainWindow(); + if (myMainWindow) { + SUIT_ResourceMgr* aResMgr = ModuleBase_Preferences::resourceMgr(); + bool aCloc = aResMgr->booleanValue("language", "locale", true); + if (aCloc) + QLocale::setDefault( QLocale::c() ); + else + QLocale::setDefault( QLocale::system() ); + } + myDisplayer = new XGUI_Displayer(this); mySelector = new XGUI_SelectionMgr(this); @@ -117,7 +129,7 @@ XGUI_Workshop::XGUI_Workshop(XGUI_SalomeConnector* theConnector) myOperationMgr = new XGUI_OperationMgr(this); myActionsMgr = new XGUI_ActionsMgr(this); - myErrorDlg = new XGUI_ErrorDialog(myMainWindow); + myErrorDlg = new XGUI_ErrorDialog(QApplication::desktop()); myContextMenuMgr = new XGUI_ContextMenuMgr(this); connect(myContextMenuMgr, SIGNAL(actionTriggered(const QString&, bool)), this, SLOT(onContextMenuCommand(const QString&, bool))); @@ -138,7 +150,8 @@ XGUI_Workshop::XGUI_Workshop(XGUI_SalomeConnector* theConnector) SLOT(onOperationCommitted(ModuleBase_Operation*))); connect(myOperationMgr, SIGNAL(operationAborted(ModuleBase_Operation*)), SLOT(onOperationAborted(ModuleBase_Operation*))); - connect(myMainWindow, SIGNAL(exitKeySequence()), SLOT(onExit())); + if (myMainWindow) + connect(myMainWindow, SIGNAL(exitKeySequence()), SLOT(onExit())); connect(this, SIGNAL(errorOccurred(const QString&)), myErrorDlg, SLOT(addError(const QString&))); }