]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/ModuleBase/ModuleBase_WidgetFileSelector.cpp
Salome HOME
Issue #1005: To improve user-friendship of error-messages for features and attributes
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetFileSelector.cpp
index f3238f222744a1468ebe337d9aad48fc8b7fb791..534c7c8c44c7925b66433eec8315d88d4f9db9c7 100644 (file)
@@ -34,7 +34,7 @@ ModuleBase_WidgetFileSelector::ModuleBase_WidgetFileSelector(QWidget* theParent,
                                                              const Config_WidgetAPI* theData)
 : ModuleBase_ModelWidget(theParent, theData)
 {
-  myTitle = QString::fromStdString(theData->getProperty("title"));
+  myTitle = translate(theData->getProperty("title"));
   myType = (theData->getProperty("type") == "save") ? WFS_SAVE : WFS_OPEN;
   myDefaultPath = QString::fromStdString(theData->getProperty("path"));
 
@@ -65,9 +65,9 @@ ModuleBase_WidgetFileSelector::~ModuleBase_WidgetFileSelector()
 {
 }
 
-bool ModuleBase_WidgetFileSelector::storeValueCustom() const
+bool ModuleBase_WidgetFileSelector::storeValueCustom()
 {
-  // A rare case when plugin was not loaded. 
+  // A rare case when plugin was not loaded.
   if (!myFeature)
     return false;
   DataPtr aData = myFeature->data();
@@ -80,7 +80,7 @@ bool ModuleBase_WidgetFileSelector::storeValueCustom() const
 
 bool ModuleBase_WidgetFileSelector::restoreValueCustom()
 {
-  // A rare case when plugin was not loaded. 
+  // A rare case when plugin was not loaded.
   if (!myFeature)
     return false;
   DataPtr aData = myFeature->data();
@@ -121,6 +121,7 @@ void ModuleBase_WidgetFileSelector::onPathSelectionBtn()
     if (myType == WFS_SAVE)
       aFileName = applyExtension(aFileName, mySelectedFilter);
     myPathField->setText(aFileName);
+    emit focusOutWidget(this);
   }
 }