]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
ModuleBase_WidgetFileSelector uses curent value as default for the dialog
authorSergey POKHODENKO <sergey.pokhodenko@opencascade.com>
Tue, 19 May 2015 07:07:51 +0000 (10:07 +0300)
committerSergey POKHODENKO <sergey.pokhodenko@opencascade.com>
Tue, 19 May 2015 07:58:19 +0000 (10:58 +0300)
src/ModuleBase/ModuleBase_WidgetFileSelector.cpp

index c7fcacd11e278cd8036eaad8416098419a2666c4..139b3849a2f1caad2f5c1749febfe693cd141feb 100644 (file)
@@ -111,10 +111,11 @@ bool ModuleBase_WidgetFileSelector::isCurrentPathValid()
 
 void ModuleBase_WidgetFileSelector::onPathSelectionBtn()
 {
+  QString aDefaultPath = myPathField->text().isEmpty() ? myDefaultPath : myPathField->text();
   QString aFilter = filterString();
   QString aFileName = (myType == WFS_SAVE)
-      ? QFileDialog::getSaveFileName(this, myTitle, myDefaultPath, aFilter)
-      : QFileDialog::getOpenFileName(this, myTitle, myDefaultPath, aFilter);
+      ? QFileDialog::getSaveFileName(this, myTitle, aDefaultPath, aFilter)
+      : QFileDialog::getOpenFileName(this, myTitle, aDefaultPath, aFilter);
   if (!aFileName.isEmpty()) {
     myPathField->setText(aFileName);
   }