]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Additional fix for bug NPAL19028 (see remarks from Olivier Giorgis).
authormzn <mzn@opencascade.com>
Tue, 29 Apr 2008 13:13:59 +0000 (13:13 +0000)
committermzn <mzn@opencascade.com>
Tue, 29 Apr 2008 13:13:59 +0000 (13:13 +0000)
src/SUIT/SUIT_FileDlg.cxx
src/SUIT/SUIT_FileDlg.h
src/SalomeApp/SalomeApp_Application.cxx

index 7fb1ee7c6a4b424fc09d75bc84a464736ea5bfe4..ec7bc547f4c6648f7cc3ea2b4602ceb42f4c38fc 100755 (executable)
@@ -522,6 +522,14 @@ QString SUIT_FileDlg::getExistingDirectory( QWidget*       parent,
   
 }
 
+/*!
+  Returns the last visited path. [ static ]
+*/
+QString SUIT_FileDlg::getLastVisitedPath()
+{
+  return myLastVisitedPath;
+}
+
 /*!
   QFileDialog::dirPath() has a bug on Linux Debian (1 level up from correct
   directory is returned).  This function fixes the bug. 
index 04418800333ee7b1da6c509bb94efb98e91c840a..3a3a26b8348c0cd45e36b700d21f3d04e1926c08 100755 (executable)
@@ -57,6 +57,8 @@ public:
   static QString      getExistingDirectory( QWidget* parent, const QString& initial,
                                             const QString& caption, const bool showQuickDir = true );
 
+  static QString      getLastVisitedPath();
+
 public slots:
   void                polish();
 
index 4fbe1d0b9ef81bb5acc8f6f5c5ab3cdb446dd978..894ca64fd287e0aeaeb829adcbbf0b618a2c2ad9 100644 (file)
@@ -773,7 +773,11 @@ void SalomeApp_Application::onLoadScript( )
   filtersList.append(tr("PYTHON_FILES_FILTER"));
   filtersList.append(tr("ALL_FILES_FILTER"));
   
-  QString aFile = SUIT_FileDlg::getFileName( desktop(), QDir::currentDirPath(), filtersList, tr( "TOT_DESK_FILE_LOAD_SCRIPT" ), true, true );
+  QString anInitialPath = "";
+  if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
+    anInitialPath = QDir::currentDirPath();
+
+  QString aFile = SUIT_FileDlg::getFileName( desktop(), anInitialPath, filtersList, tr( "TOT_DESK_FILE_LOAD_SCRIPT" ), true, true );
 
   if ( !aFile.isEmpty() )
   {