Salome HOME
Fix for bug 0019870(Import/Export should show current directory).
authormzn <mzn@opencascade.com>
Sat, 7 Jun 2008 12:49:40 +0000 (12:49 +0000)
committermzn <mzn@opencascade.com>
Sat, 7 Jun 2008 12:49:40 +0000 (12:49 +0000)
src/SMESHGUI/SMESHGUI.cxx

index 6e946de8c9f6a195cbbcdfd366217a9390900c53..2d89fec36f9186b34e622d060bd4a2a01219e33d 100644 (file)
@@ -185,8 +185,8 @@ using namespace std;
     }
 
     QString anInitialPath = "";
-    //if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
-    //  anInitialPath = QDir::currentDirPath();
+    if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
+      anInitialPath = QDir::currentDirPath();
 
     QString filename = SUIT_FileDlg::getFileName(SMESHGUI::desktop(),
                                                 anInitialPath,
@@ -354,10 +354,12 @@ using namespace std;
        if ( resMgr )
          toCreateGroups = resMgr->booleanValue( "SMESH", "auto_groups", false );
 
-       if ( theCommandID != 122 && theCommandID != 125 && theCommandID != 140 && theCommandID != 141)
-
-         aFilename = SUIT_FileDlg::getFileName(SMESHGUI::desktop(), "", aFilter, aTitle, false);
+       QString anInitialPath = "";
+       if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
+         anInitialPath = QDir::currentDirPath();
 
+       if ( theCommandID != 122 && theCommandID != 125 && theCommandID != 140 && theCommandID != 141)
+         aFilename = SUIT_FileDlg::getFileName(SMESHGUI::desktop(), anInitialPath, aFilter, aTitle, false);
        else if(theCommandID == 140 || theCommandID == 141) { // Export to STL
          QStringList filters;
           QMap<QString, int>::const_iterator it = aFilterMapSTL.begin();
@@ -368,6 +370,8 @@ using namespace std;
           fd->setCaption( aTitle );
           fd->setFilters( filters );
           fd->setSelectedFilter( QObject::tr("STL ASCII  (*.stl)") );
+         if ( anInitialPath.isEmpty() )
+           fd->setDir( anInitialPath );
           bool is_ok = false;
           while (!is_ok) {
             fd->exec();
@@ -395,6 +399,8 @@ using namespace std;
           //fd->setSelectedFilter( QObject::tr("MED 2.2 (*.med)") );
           fd->setSelectedFilter(aDefaultFilter);
           fd->SetChecked(toCreateGroups);
+         if ( anInitialPath.isEmpty() )
+           fd->setDir( anInitialPath );
           bool is_ok = false;
           while (!is_ok) {
             fd->exec();