]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
DCQ: prepare V2.0.0
authoryfr <yfr@opencascade.com>
Mon, 19 Jul 2004 11:18:03 +0000 (11:18 +0000)
committeryfr <yfr@opencascade.com>
Mon, 19 Jul 2004 11:18:03 +0000 (11:18 +0000)
14 files changed:
src/SALOMEGUI/CLIENT_msg_en.po
src/SALOMEGUI/QAD_Config.cxx
src/SALOMEGUI/QAD_Config.h
src/SALOMEGUI/QAD_FileDlg.cxx
src/SALOMEGUI/QAD_FileDlg.h
src/SALOMEGUI/QAD_ResourceMgr.cxx
src/SALOME_PY/SalomePy.cxx
src/SALOME_PYQT/SALOME_PYQT_GUI.cxx
src/SALOME_PYQT/SalomePyQt.cxx
src/SALOME_PYQT/SalomePyQt.hxx
src/SALOME_PYQT/SalomePyQt.sip
src/SALOME_SWIG/batchmode_salome.py
src/Session/SALOME_Session_QThread.cxx
src/Session/SALOME_Session_Server.cxx

index f0e5f90f9e2d47a8f3ff99e633bea10e913391c6..f0f569cf2bc26498237890b02104de07f57eec61 100644 (file)
@@ -23,7 +23,7 @@ msgid "INF_VERSION"
 msgstr "Version 2.0.0"
 
 msgid "INF_COPYRIGHT"
-msgstr "  "
+msgstr ""
 
 msgid "INF_LICENSE"
 msgstr "  "
index b9d734f16a14647cf49f7d0358bea404c61912e2..33b56323756abbf4620f3edaec946ab3702d0e1e 100644 (file)
@@ -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";
index e5b202a97d907a0589f7ed1e1e36ceed885e54e3..24d863ac38a47ce00e83cc83b36fe06733e6d8f1 100644 (file)
@@ -60,6 +60,7 @@ public:
   /** Gets directory of KERNEL_ROOT. */
   QDir           getPrgDir() const { return prgDir; }
 
+  void           setDefaultConfigDir();
   bool           createConfigFile( bool overwrite=false );
   bool           readConfigFile();
 
index df22e1e21f1eda951c4ee42715ee4df62ce90c15..76860b89d524c49033bfbc62af43255261f9e931 100644 (file)
@@ -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;
   
 }
+
index a38dc8861511817372f4db7c30751c22ba680ca1..e6964280fdb69b7b651ef3bf6d0e8bb208b4b5fd 100644 (file)
@@ -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, 
index f6e5b6e8feb1b3290a4e61fa1bf0194eb906e382..a220c1536ac7ae4fa8ffecdf1566071578fcba44 100644 (file)
@@ -264,7 +264,8 @@ QString QAD_ResourceMgr::resources( const char* prefix ) const
   - <prefix>_ROOT_DIR/share/salome/resources directory
   - SALOME_<prefix>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 ) {
index 017c546470270ffd23e42b5515bb92ca3a77616e..3de3dac863799ae45a34b5b6c5cc9807d1ab5136 100644 (file)
 //  Module : SALOME
 //  $Header$
 
-using namespace std;
 #include <Python.h>
-#include <vtkRenderer.h>
-#include <vtkRenderWindowInteractor.h>
 #include <vtkPythonUtil.h>
+
 #include <vtkVersion.h>
-#include "utilities.h"
-#include "QAD_Study.h"
-#include "QAD_RightFrame.h"
+#include <vtkRenderer.h>
+#include <vtkRenderWindow.h>
+#include <vtkRenderWindowInteractor.h>
+
 #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<char*>(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<VTKViewer_ViewFrame*>(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; i<nbStudyFrames; i++)
-       {
-         if ( myStudy->getStudyFrame(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 <nbStudyFrames))
-       renderer = ((VTKViewer_ViewFrame*)myStudy->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);
 }
-
-
index 73e33fd0527db93bb64f39b54903b7d91e118b43..20a0edfe773dc707c439d73ac614cac8137376a5 100644 (file)
@@ -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();
 
index 11d2fe9ce73e3329537ca214d3ffce506d829d45..e821f22bae849129ab103e61ddff1f6aca23d173 100644 (file)
@@ -8,10 +8,15 @@
 using namespace std;
 #include "SalomePyQt.hxx"
 
+#include <qapplication.h>
+
 #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;
+}
index b3f5101a6c12244d03cd9f6f4a84e41d743b6a4d..b70d39dfe4b1bde5c0f9afbeb212537dfde56437 100644 (file)
@@ -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
index 3f593d0af71defd34a3848bb77dbf15036c4c57e..fe6a9d43a9b212339ab21d72be119a2ba21d4a05 100644 (file)
@@ -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&);
 };
index 7cf6757561ef8e3c9144f7d9225523c14fc4906b..f06796eb72e00ec289297ced8f0e15b032e5f128 100644 (file)
@@ -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()
 
index 9229ba2741372b5e9688a48eca9ed00f70844b53..76cfaeb41ea97e629899414f4d6f28c0f20d2263 100644 (file)
@@ -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
index ff9a6cf3c20d22bc4258a65411887e366fbc4047..b4e40e63f2e17c6459c4342617b5bb41a75b1386 100644 (file)
@@ -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);