From: mzn Date: Tue, 29 Apr 2008 13:13:59 +0000 (+0000) Subject: Additional fix for bug NPAL19028 (see remarks from Olivier Giorgis). X-Git-Tag: TG_start_Deformed_CutPlanes~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=31f44b2aa9a2d8534a9a57bfb59277df466ebcb3;p=modules%2Fgui.git Additional fix for bug NPAL19028 (see remarks from Olivier Giorgis). --- diff --git a/src/SUIT/SUIT_FileDlg.cxx b/src/SUIT/SUIT_FileDlg.cxx index 7fb1ee7c6..ec7bc547f 100755 --- a/src/SUIT/SUIT_FileDlg.cxx +++ b/src/SUIT/SUIT_FileDlg.cxx @@ -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. diff --git a/src/SUIT/SUIT_FileDlg.h b/src/SUIT/SUIT_FileDlg.h index 044188003..3a3a26b83 100755 --- a/src/SUIT/SUIT_FileDlg.h +++ b/src/SUIT/SUIT_FileDlg.h @@ -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(); diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 4fbe1d0b9..894ca64fd 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -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() ) {