Salome HOME
Updated copyright comment
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetShapeSelector.cpp
index e5ea9338995ae5ac20362446cbfc2a8d0a26f6f2..33ea54529dae03f23750697a4e629031f2f6b367 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2024  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -216,24 +216,31 @@ void ModuleBase_WidgetShapeSelector::updateSelectionName()
   bool isNameUpdated = false;
   AttributeSelectionPtr aSelect = aData->selection(attributeID());
   if (aSelect) {
-    myTextLine->setText(QString::fromStdString(aSelect->namingName(getDefaultValue())));
+    std::wstring aDefault = translate(getDefaultValue()).toStdWString();
+    myTextLine->setText(QString::fromStdWString(aSelect->namingName(aDefault)));
     isNameUpdated = true;
   }
   if (!isNameUpdated) {
     ObjectPtr anObject = ModuleBase_Tools::getObject(myFeature->attribute(attributeID()));
     if (anObject.get() != NULL) {
-      std::string aName = anObject->data()->name();
-      myTextLine->setText(QString::fromStdString(aName));
+      std::wstring aName = anObject->data()->name();
+      myTextLine->setText(QString::fromStdWString(aName));
     } else {
       AttributeRefAttrPtr aRefAttr = aData->refattr(attributeID());
       if (aRefAttr && aRefAttr->attr().get() != NULL) {
         //myIsObject = aRefAttr->isObject();
-        std::string anAttrName = ModuleBase_Tools::generateName(aRefAttr->attr(), myWorkshop);
-        myTextLine->setText(QString::fromStdString(anAttrName));
+        std::wstring anAttrName = ModuleBase_Tools::generateName(aRefAttr->attr(), myWorkshop);
+        myTextLine->setText(QString::fromStdWString(anAttrName));
       }
       else {
-        myTextLine->setText(getDefaultValue().c_str());
+        myTextLine->setText(translate(getDefaultValue()));
       }
     }
   }
 }
+
+//********************************************************************
+bool ModuleBase_WidgetShapeSelector::isModified() const
+{
+  return !myTextLine->text().isEmpty();
+}
\ No newline at end of file