From 00a29dadb0d666b34c5150d1278825f2956bc013 Mon Sep 17 00:00:00 2001 From: yfr Date: Mon, 19 Jul 2004 11:18:03 +0000 Subject: [PATCH] DCQ: prepare V2.0.0 --- src/SALOMEGUI/CLIENT_msg_en.po | 2 +- src/SALOMEGUI/QAD_Config.cxx | 32 +++-- src/SALOMEGUI/QAD_Config.h | 1 + src/SALOMEGUI/QAD_FileDlg.cxx | 54 ++++++- src/SALOMEGUI/QAD_FileDlg.h | 6 + src/SALOMEGUI/QAD_ResourceMgr.cxx | 23 ++- src/SALOME_PY/SalomePy.cxx | 186 +++++++++++-------------- src/SALOME_PYQT/SALOME_PYQT_GUI.cxx | 6 +- src/SALOME_PYQT/SalomePyQt.cxx | 38 +++++ src/SALOME_PYQT/SalomePyQt.hxx | 35 +++-- src/SALOME_PYQT/SalomePyQt.sip | 2 + src/SALOME_SWIG/batchmode_salome.py | 3 +- src/Session/SALOME_Session_QThread.cxx | 9 +- src/Session/SALOME_Session_Server.cxx | 6 +- 14 files changed, 255 insertions(+), 148 deletions(-) diff --git a/src/SALOMEGUI/CLIENT_msg_en.po b/src/SALOMEGUI/CLIENT_msg_en.po index f0e5f90f9..f0f569cf2 100644 --- a/src/SALOMEGUI/CLIENT_msg_en.po +++ b/src/SALOMEGUI/CLIENT_msg_en.po @@ -23,7 +23,7 @@ msgid "INF_VERSION" msgstr "Version 2.0.0" msgid "INF_COPYRIGHT" -msgstr " " +msgstr "" msgid "INF_LICENSE" msgstr " " diff --git a/src/SALOMEGUI/QAD_Config.cxx b/src/SALOMEGUI/QAD_Config.cxx index b9d734f16..33b563237 100644 --- a/src/SALOMEGUI/QAD_Config.cxx +++ b/src/SALOMEGUI/QAD_Config.cxx @@ -86,17 +86,33 @@ void QAD_Config::ini() /*! - Creates not existing config files. + Set default directory for config files. */ -bool QAD_Config::createConfigFile( bool overwrite ) +void QAD_Config::setDefaultConfigDir() { - bool ret=true; - #ifdef DEF_WINDOWS setConfigDir(QDir(prgDir.absPath())); #else - setConfigDir(QDir(QDir::home().absPath() + "/." + tr("MEN_APPNAME") )); + QString vers = tr("INF_VERSION"); + int first_dot = vers.find('.'); + int blanc_before = vers.findRev(' ', first_dot) + 1; + int blanc_after = vers.find(' ', first_dot); + if (blanc_after == -1) blanc_after = vers.length(); + int vers_len = blanc_after - blanc_before; + vers.truncate(blanc_after); + QString vers_nb = vers.right(vers_len); + setConfigDir(QDir(QDir::home().absPath() + "/." + tr("MEN_APPNAME") + "_" + vers_nb)); #endif +} + +/*! + Creates not existing config files. +*/ +bool QAD_Config::createConfigFile( bool overwrite ) +{ + bool ret = true; + + setDefaultConfigDir(); // Create config directory: if(!configDir.exists()) { @@ -166,11 +182,7 @@ bool QAD_Config::createConfigFile( bool overwrite ) */ bool QAD_Config::readConfigFile() { -#ifdef DEF_WINDOWS - setConfigDir(QDir(prgDir.absPath())); -#else - setConfigDir(QDir(QDir::home().absPath() + "/." + tr("MEN_APPNAME") )); -#endif + setDefaultConfigDir(); QString configPath; configPath = configDir.absPath() + "/" + tr("MEN_APPNAME") + ".conf"; diff --git a/src/SALOMEGUI/QAD_Config.h b/src/SALOMEGUI/QAD_Config.h index e5b202a97..24d863ac3 100644 --- a/src/SALOMEGUI/QAD_Config.h +++ b/src/SALOMEGUI/QAD_Config.h @@ -60,6 +60,7 @@ public: /** Gets directory of KERNEL_ROOT. */ QDir getPrgDir() const { return prgDir; } + void setDefaultConfigDir(); bool createConfigFile( bool overwrite=false ); bool readConfigFile(); diff --git a/src/SALOMEGUI/QAD_FileDlg.cxx b/src/SALOMEGUI/QAD_FileDlg.cxx index df22e1e21..76860b89d 100644 --- a/src/SALOMEGUI/QAD_FileDlg.cxx +++ b/src/SALOMEGUI/QAD_FileDlg.cxx @@ -175,8 +175,10 @@ if the selected name is valid ( see 'acceptData()' ) void QAD_FileDlg::accept() { // mySelectedFile = QFileDialog::selectedFile().simplifyWhiteSpace(); //VSR- 06/12/02 - mySelectedFile = QFileDialog::selectedFile(); //VSR+ 06/12/02 - addExtension(); + if ( mode() != ExistingFiles ) { + mySelectedFile = QFileDialog::selectedFile(); //VSR+ 06/12/02 + addExtension(); + } // mySelectedFile = mySelectedFile.simplifyWhiteSpace(); //VSR- 06/12/02 /* Qt 2.2.2 BUG: accept() is called twice if you validate @@ -209,7 +211,17 @@ bool QAD_FileDlg::acceptData() if ( myValidator ) { if ( isOpenDlg() ) - return myValidator->canOpen( selectedFile() ); + if ( mode() == ExistingFiles ) { + QStringList fileNames = selectedFiles(); + for ( int i = 0; i < fileNames.count(); i++ ) { + if ( !myValidator->canOpen( fileNames[i] ) ) + return false; + } + return true; + } + else { + return myValidator->canOpen( selectedFile() ); + } else return myValidator->canSave( selectedFile() ); } @@ -289,6 +301,7 @@ bool QAD_FileDlg::processPath( const QString& path ) else { if ( QFileInfo( fi.dirPath() ).exists() ) { setDir( fi.dirPath() ); + setSelection( path ); return true; } } @@ -317,9 +330,9 @@ void QAD_FileDlg::quickDir(const QString& dirPath) */ QString QAD_FileDlg::getFileName( QWidget* parent, const QString& initial, - const QStringList& filters, - const QString& caption, - bool open, + const QStringList& filters, + const QString& caption, + bool open, bool showQuickDir, QAD_FileValidator* validator ) { @@ -339,6 +352,34 @@ QString QAD_FileDlg::getFileName( QWidget* parent, return filename; } + +/*! + Returns the list of files to be opened [ static ] +*/ +QStringList QAD_FileDlg::getOpenFileNames( QWidget* parent, + const QString& initial, + const QStringList& filters, + const QString& caption, + bool showQuickDir, + QAD_FileValidator* validator ) +{ + QAD_FileDlg* fd = new QAD_FileDlg( parent, true, showQuickDir, true ); + fd->setMode( ExistingFiles ); + if ( !caption.isEmpty() ) + fd->setCaption( caption ); + if ( !initial.isEmpty() ) { + fd->processPath( initial ); // VSR 24/03/03 check for existing of directory has been added to avoid QFileDialog's bug + } + fd->setFilters( filters ); + if ( validator ) + fd->setValidator( validator ); + fd->exec(); + QStringList filenames = fd->selectedFiles(); + delete fd; + qApp->processEvents(); + return filenames; +} + /*! Existing directory selection dialog [ static ] */ @@ -362,3 +403,4 @@ QString QAD_FileDlg::getExistingDirectory ( QWidget* parent, return dirname; } + diff --git a/src/SALOMEGUI/QAD_FileDlg.h b/src/SALOMEGUI/QAD_FileDlg.h index a38dc8861..e6964280f 100644 --- a/src/SALOMEGUI/QAD_FileDlg.h +++ b/src/SALOMEGUI/QAD_FileDlg.h @@ -38,6 +38,12 @@ public: bool open, bool showQuickDir = true, QAD_FileValidator* validator = 0); + static QStringList getOpenFileNames( QWidget* parent, + const QString& initial, + const QStringList& filters, + const QString& caption, + bool showQuickDir = true, + QAD_FileValidator* validator = 0); static QString getExistingDirectory ( QWidget* parent, const QString& initial, const QString& caption, diff --git a/src/SALOMEGUI/QAD_ResourceMgr.cxx b/src/SALOMEGUI/QAD_ResourceMgr.cxx index f6e5b6e8f..a220c1536 100644 --- a/src/SALOMEGUI/QAD_ResourceMgr.cxx +++ b/src/SALOMEGUI/QAD_ResourceMgr.cxx @@ -264,7 +264,8 @@ QString QAD_ResourceMgr::resources( const char* prefix ) const - _ROOT_DIR/share/salome/resources directory - SALOME_Resources env.var directory ( or directory list ) - ${HOME}/.salome/resources directory - - KERNEL_ROOT_DIR/share/salome/resources directory + - ${SALOME_SITE_DIR}/share/${SALOME_SITE_NAME}/resources directory (for SALOME-based applications) + - ${KERNEL_ROOT_DIR}/share/salome/resources directory */ QString QAD_ResourceMgr::collectDirs( const QString& prefix ) const { @@ -314,7 +315,25 @@ QString QAD_ResourceMgr::collectDirs( const QString& prefix ) const dirList.append( dirList.isEmpty() ? dir : ( QString( SEPARATOR ) + dir ) ); } } - + // Try ${SALOME_SITE_DIR}/share/${SALOME_SITE_NAME}/resources directory + cenv = getenv( "SALOME_SITE_DIR" ); + if ( cenv ) { + dir.sprintf( "%s", cenv ); + if ( !dir.isEmpty() ) { + dir = QAD_Tools::addSlash(dir) ; + dir = dir + "share" ; + dir = QAD_Tools::addSlash(dir) ; + cenv = getenv( "SALOME_SITE_NAME" ); + if ( cenv ) + dir = dir + cenv ; + else + dir = dir + "salome" ; + dir = QAD_Tools::addSlash(dir) ; + dir = dir + "resources" ; + dir = QAD_Tools::addSlash(dir) ; + dirList.append( dirList.isEmpty() ? dir : ( QString( SEPARATOR ) + dir ) ); + } + } // Try ${KERNEL_ROOT_DIR}/share/salome/resources directory cenv = getenv( "KERNEL_ROOT_DIR" ); if ( cenv ) { diff --git a/src/SALOME_PY/SalomePy.cxx b/src/SALOME_PY/SalomePy.cxx index 017c54647..3de3dac86 100644 --- a/src/SALOME_PY/SalomePy.cxx +++ b/src/SALOME_PY/SalomePy.cxx @@ -26,128 +26,108 @@ // Module : SALOME // $Header$ -using namespace std; #include -#include -#include #include + #include -#include "utilities.h" -#include "QAD_Study.h" -#include "QAD_RightFrame.h" +#include +#include +#include + #include "QAD_Application.h" #include "QAD_Desktop.h" +#include "QAD_Study.h" +#include "QAD_RightFrame.h" + #include "VTKViewer_ViewFrame.h" +#include "VTKViewer_RenderWindow.h" +#include "VTKViewer_RenderWindowInteractor.h" -extern "C" -{ - static PyObject * libSalomePy_getRenderer(PyObject *self, PyObject *args); +#include "utilities.h" + +using namespace std; + + +PyObject* GetPyClass(const char* theClassName){ + static PyObject *aVTKModule = NULL; + if(!aVTKModule){ + if (VTK_MAJOR_VERSION > 3) + aVTKModule = PyImport_ImportModule("libvtkRenderingPython"); + else + aVTKModule = PyImport_ImportModule("libVTKGraphicsPython"); + if(PyErr_Occurred()){ + PyErr_Print(); + return NULL; + } + } + PyObject* aVTKDict = PyModule_GetDict(aVTKModule); + char* aClassName = const_cast(theClassName); + PyObject* aPyClass = PyDict_GetItemString(aVTKDict,aClassName); + //Py_DECREF(aVTKModule); + return aPyClass; +} + + +VTKViewer_ViewFrame* GetVTKViewFrame(){ + QAD_Study* aStudy = QAD_Application::getDesktop()->getActiveStudy(); + QAD_StudyFrame* aStudyFrame = aStudy->getActiveStudyFrame(); + QAD_ViewFrame* aViewFrame = aStudyFrame->getRightFrame()->getViewFrame(); + return dynamic_cast(aViewFrame); } -static PyObject *libSalomePy_getRenderer(PyObject *self, PyObject *args) + +extern "C" PyObject *libSalomePy_getRenderer(PyObject *self, PyObject *args) { - if (!PyArg_ParseTuple(args, ":getRenderer")) - return NULL; - // exemple retournant systematiquement Py_None - Py_INCREF(Py_None); - return Py_None; + if(VTKViewer_ViewFrame* aVTKViewFrame = GetVTKViewFrame()){ + PyObject* aPyClass = GetPyClass("vtkRenderer"); + vtkRenderer* aVTKObject = aVTKViewFrame->getRenderer(); + return PyVTKObject_New(aPyClass,aVTKObject); + } + return NULL; +} + + +extern "C" PyObject *libSalomePy_getRenderWindow(PyObject *self, PyObject *args) +{ + if(VTKViewer_ViewFrame* aVTKViewFrame = GetVTKViewFrame()){ + PyObject* aPyClass = GetPyClass("vtkRenderWindow"); + vtkRenderWindow* aVTKObject = aVTKViewFrame->getRW()->getRenderWindow(); + return PyVTKObject_New(aPyClass,aVTKObject); + } + return NULL; } + +extern "C" PyObject *libSalomePy_getRenderWindowInteractor(PyObject *self, PyObject *args) +{ + if(VTKViewer_ViewFrame* aVTKViewFrame = GetVTKViewFrame()){ + PyObject* aPyClass = GetPyClass("vtkRenderWindowInteractor"); + vtkRenderWindowInteractor* aVTKObject = aVTKViewFrame->getRWInteractor(); + return PyVTKObject_New(aPyClass,aVTKObject); + } + return NULL; +} + + static PyMethodDef Module_Methods[] = { - {"getRenderer", libSalomePy_getRenderer, METH_VARARGS}, + {"getRenderer",libSalomePy_getRenderer,METH_NOARGS}, + {"getRenderWindow",libSalomePy_getRenderWindow,METH_NOARGS}, + {"getRenderWindowInteractor",libSalomePy_getRenderWindow,METH_NOARGS}, {NULL, NULL} }; -extern "C" { void initlibSalomePy();} -void initlibSalomePy() +extern "C" void initlibSalomePy() { - PyObject *m, *d, *c, *md, *obj, *vtkclass; - static char modulename[] = "libSalomePy"; - MESSAGE("---"); - m = Py_InitModule(modulename, Module_Methods); - MESSAGE("---"); - d = PyModule_GetDict(m); - MESSAGE("---"); - // DANGEROUS : if (!d) Py_FatalError("can't get dictionary for module SalomePy!"); - if (PyErr_Occurred()) - { - MESSAGE("---"); - return; - } - - if (VTK_MAJOR_VERSION > 3) - m=PyImport_ImportModule("libvtkRenderingPython"); // import module if not already imported (new ref) - else - m=PyImport_ImportModule("libVTKGraphicsPython"); // import module if not already imported (new ref) - - MESSAGE("---"); - - if (PyErr_Occurred()) - { - PyErr_Print(); - MESSAGE("---"); - return; - } - - if ( m ) { - md = PyModule_GetDict(m); // dict of libvtkGraphicsPython (borrowed ref ; not decref) - MESSAGE("---"); - - vtkclass=PyDict_GetItemString(md,"vtkRenderer"); // (borrowed ref ; not decref) - Py_DECREF(m); // no more need of m - MESSAGE("---"); + PyObject* aModule = Py_InitModule(modulename, Module_Methods); + PyObject* aDict = PyModule_GetDict(aModule); + if(PyErr_Occurred()){ + PyErr_Print(); + return; } -//NRI - //san:T3.13 - move getRenderer() implementation here - //vtkRenderer *renderer = SALOMEGUI_Swig::getRenderer(); - QAD_Study* myStudy = QAD_Application::getDesktop()->getActiveStudy(); - int nbStudyFrames = myStudy->getStudyFramesCount(); - vtkRenderer *renderer = NULL; - int viewId = -1; - if (viewId == -1) // find the first frame with VTK viewer & get renderer - { - int i=0; - for(i=0; igetStudyFrame(i)->getTypeView() == VIEW_VTK ) - { - renderer = ((VTKViewer_ViewFrame*)myStudy->getStudyFrame(i)->getRightFrame()->getViewFrame())->getRenderer(); - break; - } - } - } - else // get the VTK renderer of a given frame - { - SCRUTE(viewId); - if ((viewId >=0) && (viewId getStudyFrame(viewId)->getRightFrame()->getViewFrame())->getRenderer(); - } - if (renderer == NULL) MESSAGE("No VTK Renderer available !"); - //san:T3.13 - move getRenderer() implementation here - - MESSAGE("---"); - obj = PyVTKObject_New(vtkclass,renderer); // (new ref) - MESSAGE( "Nombre de references sur obj : " << obj->ob_refcnt ); // sys.getrefcount(o) gives ref count + 1 in Python interp - PyDict_SetItemString(d,"renderer",obj); // (add a ref to obj ; has to be decref) - MESSAGE( "Nombre de references sur obj : " << obj->ob_refcnt ); // sys.getrefcount(o) gives ref count + 1 in Python interp - Py_DECREF(obj); // only one ref is sufficient - MESSAGE( "Nombre de references sur obj : " << obj->ob_refcnt ); // sys.getrefcount(o) gives ref count + 1 in Python interp -//NRI - -// vtkclass=PyDict_GetItemString(md,"vtkRenderWindowInteractor"); // (borrowed ref ; not decref) -// Py_DECREF(m); // no more need of m -// MESSAGE("---"); -// vtkRenderWindowInteractor *RWInteractor = SALOMEGUI_Swig::getRWInteractor(); -// MESSAGE("---"); -// obj = PyVTKObject_New(vtkclass,RWInteractor); // (new ref) -// MESSAGE( "Nombre de references sur obj : " << obj->ob_refcnt ); // sys.getrefcount(o) gives ref count + 1 in Python interp -// PyDict_SetItemString(d,"interactor",obj); // (add a ref to obj ; has to be decref) -// MESSAGE( "Nombre de references sur obj : " << obj->ob_refcnt ); // sys.getrefcount(o) gives ref count + 1 in Python interp -// Py_DECREF(obj); // only one ref is sufficient -// MESSAGE( "Nombre de references sur obj : " << obj->ob_refcnt ); // sys.getrefcount(o) gives ref count + 1 in Python interp + PyObject* anObj = libSalomePy_getRenderer(NULL,NULL); + PyDict_SetItemString(aDict,"renderer",anObj); + Py_DECREF(anObj); } - - diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUI.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUI.cxx index 73e33fd05..20a0edfe7 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUI.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUI.cxx @@ -272,9 +272,9 @@ void SALOME_PYQT_GUI::DefinePopup( QString & theContext, QString & theObject ) { MESSAGE("SALOME_PYQT_GUI::DefinePopup"); - //theContext = ""; - //theObject = ""; - //theParent = ""; + theContext = ""; + theObject = ""; + theParent = ""; PyLockWrapper aLock = interp->GetLockWrapper(); diff --git a/src/SALOME_PYQT/SalomePyQt.cxx b/src/SALOME_PYQT/SalomePyQt.cxx index 11d2fe9ce..e821f22ba 100644 --- a/src/SALOME_PYQT/SalomePyQt.cxx +++ b/src/SALOME_PYQT/SalomePyQt.cxx @@ -8,10 +8,15 @@ using namespace std; #include "SalomePyQt.hxx" +#include + #include "QAD_Application.h" #include "QAD_Desktop.h" #include "QAD_Study.h" #include "QAD_FileDlg.h" +#include "QAD_ViewFrame.h" +#include "QAD_RightFrame.h" +#include "QAD_Tools.h" #include "QAD_Config.h" #include "QAD_Settings.h" @@ -101,6 +106,14 @@ QString SalomePyQt::getFileName(QWidget* parent, return QAD_FileDlg::getFileName(parent, initial, filters, caption, open); } +QStringList SalomePyQt::getOpenFileNames(QWidget* parent, + const QString& initial, + const QStringList& filters, + const QString& caption) +{ + return QAD_FileDlg::getOpenFileNames(parent, initial, filters, caption); +} + QString SalomePyQt::getExistingDirectory(QWidget* parent, const QString& initial, const QString& caption) @@ -111,3 +124,28 @@ QString SalomePyQt::getExistingDirectory(QWidget* parent, void SalomePyQt::helpContext(const QString& source, const QString& context) { //QAD_Application::getDesktop()->helpContext(source, context); } + +bool SalomePyQt::dumpView(const QString& filename) +{ + QAD_Study* activeStudy = QAD_Application::getDesktop()->getActiveApp()->getActiveStudy(); + if ( !activeStudy ) + return false; + QAD_ViewFrame* activeViewFrame = activeStudy->getActiveStudyFrame()->getRightFrame()->getViewFrame(); + if ( !activeViewFrame ) + return false; + if ( !activeViewFrame->getViewWidget() ) + return false; + + qApp->processEvents(); + QPixmap px = QPixmap::grabWindow( activeViewFrame->getViewWidget()->winId() ); + if ( !filename.isNull() ) { + QString fmt = QAD_Tools::getFileExtensionFromPath( filename ).upper(); + if ( fmt.isEmpty() ) + fmt = QString( "PNG" ); // default format + if ( fmt == "JPG" ) + fmt = "JPEG"; + bool bOk = px.save( filename, fmt.latin1() ); + return bOk; + } + return false; +} diff --git a/src/SALOME_PYQT/SalomePyQt.hxx b/src/SALOME_PYQT/SalomePyQt.hxx index b3f5101a6..b70d39dfe 100644 --- a/src/SALOME_PYQT/SalomePyQt.hxx +++ b/src/SALOME_PYQT/SalomePyQt.hxx @@ -30,21 +30,26 @@ public: static void updateObjBrowser( int studyId, bool updateSelection); - static void addStringSetting(QString _name, QString _value, bool _autoValue); - static void addIntSetting(QString _name, int _value, bool _autoValue); - static void addDoubleSetting(QString _name, double _value, bool _autoValue); - static bool removeSettings(QString name); - static QString getSetting(QString name); - - static QString getFileName(QWidget* parent, - const QString& initial, - const QStringList& filters, - const QString& caption, - bool open); - static QString getExistingDirectory(QWidget* parent, - const QString& initial, - const QString& caption); - static void helpContext(const QString& source, const QString& context); + static void addStringSetting(QString _name, QString _value, bool _autoValue); + static void addIntSetting(QString _name, int _value, bool _autoValue); + static void addDoubleSetting(QString _name, double _value, bool _autoValue); + static bool removeSettings(QString name); + static QString getSetting(QString name); + + static QString getFileName(QWidget* parent, + const QString& initial, + const QStringList& filters, + const QString& caption, + bool open); + static QStringList getOpenFileNames(QWidget* parent, + const QString& initial, + const QStringList& filters, + const QString& caption); + static QString getExistingDirectory(QWidget* parent, + const QString& initial, + const QString& caption); + static void helpContext(const QString& source, const QString& context); + static bool dumpView(const QString& filename); }; #endif diff --git a/src/SALOME_PYQT/SalomePyQt.sip b/src/SALOME_PYQT/SalomePyQt.sip index 3f593d0af..fe6a9d43a 100644 --- a/src/SALOME_PYQT/SalomePyQt.sip +++ b/src/SALOME_PYQT/SalomePyQt.sip @@ -44,6 +44,8 @@ public: static void addDoubleSetting(QString, double, bool); static QString getFileName(QWidget*, const QString&, const QStringList&, const QString&, bool); + static QStringList getOpenFileNames(QWidget*, const QString&, const QStringList&, const QString&); static QString getExistingDirectory(QWidget*, const QString&, const QString&); static void helpContext(const QString&, const QString&); + static bool dumpView(const QString&); }; diff --git a/src/SALOME_SWIG/batchmode_salome.py b/src/SALOME_SWIG/batchmode_salome.py index 7cf675756..f06796eb7 100644 --- a/src/SALOME_SWIG/batchmode_salome.py +++ b/src/SALOME_SWIG/batchmode_salome.py @@ -231,7 +231,8 @@ myStudy = None; if len(aListOfOpenStudies) == 0 : myStudy = myStudyManager.NewStudy("Study1") else: - myStudy = aListOfOpenStudies[0] + myStudyName = aListOfOpenStudies[0] + myStudy = myStudyManager.GetStudyByName(myStudyName) myStudyName = myStudy._get_Name() diff --git a/src/Session/SALOME_Session_QThread.cxx b/src/Session/SALOME_Session_QThread.cxx index 9229ba274..76cfaeb41 100644 --- a/src/Session/SALOME_Session_QThread.cxx +++ b/src/Session/SALOME_Session_QThread.cxx @@ -62,7 +62,7 @@ SALOME_Session_QThread::SALOME_Session_QThread(int argc, char ** argv) : QThread _argc = argc ; _argv = argv ; _NS = 0 ; -} ; +} //============================================================================= @@ -163,11 +163,12 @@ void SALOME_Session_QThread::run() } aCatch.Deactivate(); - QString confMsg = "Settings create $HOME/." + QObject::tr("MEN_APPNAME") + "/" + QObject::tr("MEN_APPNAME") + ".conf"; - MESSAGE (confMsg ) + QString confMsg = "Settings create " + + QAD_CONFIG->getConfigDir().absPath() + "/" + QObject::tr("MEN_APPNAME") + ".conf"; + MESSAGE (confMsg); QAD_CONFIG->createConfigFile(true); } -} ; +} //============================================================================= /*! setNamingService diff --git a/src/Session/SALOME_Session_Server.cxx b/src/Session/SALOME_Session_Server.cxx index ff9a6cf3c..b4e40e63f 100644 --- a/src/Session/SALOME_Session_Server.cxx +++ b/src/Session/SALOME_Session_Server.cxx @@ -217,9 +217,9 @@ int main(int argc, char **argv) } } //aCatch.Deactivate(); - QString confMsg = "Settings create $HOME/." - + QObject::tr("MEN_APPNAME") + "/" + QObject::tr("MEN_APPNAME") + ".conf"; - MESSAGE (confMsg ); + QString confMsg = "Settings create " + + QAD_CONFIG->getConfigDir().absPath() + "/" + QObject::tr("MEN_APPNAME") + ".conf"; + MESSAGE (confMsg); QAD_CONFIG->createConfigFile(true); } //orb->shutdown(0); -- 2.39.2