Salome HOME
Issue #1502 Select sub-solids in viewer : Compsolid shape selection type should be...
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetFileSelector.cpp
index 5abfea54d6303a7337321cfeb6f63ddebba6b0f2..be91840732b4aaaea150a6ec468399a73ddff41c 100644 (file)
@@ -31,9 +31,8 @@
 #include <string>
 
 ModuleBase_WidgetFileSelector::ModuleBase_WidgetFileSelector(QWidget* theParent,
-                                                             const Config_WidgetAPI* theData,
-                                                             const std::string& theParentId)
-    : ModuleBase_ModelWidget(theParent, theData, theParentId)
+                                                             const Config_WidgetAPI* theData)
+: ModuleBase_ModelWidget(theParent, theData)
 {
   myTitle = QString::fromStdString(theData->getProperty("title"));
   myType = (theData->getProperty("type") == "save") ? WFS_SAVE : WFS_OPEN;
@@ -66,7 +65,7 @@ ModuleBase_WidgetFileSelector::~ModuleBase_WidgetFileSelector()
 {
 }
 
-bool ModuleBase_WidgetFileSelector::storeValueCustom() const
+bool ModuleBase_WidgetFileSelector::storeValueCustom()
 {
   // A rare case when plugin was not loaded. 
   if (!myFeature)
@@ -88,7 +87,9 @@ bool ModuleBase_WidgetFileSelector::restoreValueCustom()
   AttributeStringPtr aStringAttr = aData->string(attributeID());
 
   bool isBlocked = myPathField->blockSignals(true);
-  myPathField->setText(QString::fromStdString(aStringAttr->value()));
+  QString aNewText = QString::fromStdString(aStringAttr->value());
+  if( myPathField->text() != aNewText )
+    myPathField->setText( aNewText );
   myPathField->blockSignals(isBlocked);
 
   return true;
@@ -120,6 +121,7 @@ void ModuleBase_WidgetFileSelector::onPathSelectionBtn()
     if (myType == WFS_SAVE)
       aFileName = applyExtension(aFileName, mySelectedFilter);
     myPathField->setText(aFileName);
+    emit focusOutWidget(this);
   }
 }