Salome HOME
Issue #1005: To improve user-friendship of error-messages for features and attributes
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetAction.cpp
index b0206a5a5a0921e924ee2dccbe4e35e3fb08ea47..a5ddbbe9660e1a88905316cee155c71e50a7d362 100755 (executable)
 
 ModuleBase_WidgetAction::ModuleBase_WidgetAction(QWidget* theParent,
                                                  const Config_WidgetAPI* theData)
-: ModuleBase_ModelWidget(theParent, theData)
+: ModuleBase_ModelWidget(theParent, theData),
+  myActionID(attributeID())
 {
+  setAttributeID(""); // To prevent errors. Action not stored as attribtue in feature.
   QHBoxLayout* aControlLay = new QHBoxLayout(this);
   ModuleBase_Tools::adjustMargins(aControlLay);
 
-  myActionID = attributeID();
-  setAttributeID("");
-
   myButton = new QToolButton(this);
-  QString aText = QString::fromStdString(theData->widgetLabel());
-  QString aToolTip = ModuleBase_Tools::wrapTextByWords(
-              QString::fromStdString(theData->widgetTooltip()), myButton, DEFAULT_TOOL_TIP_WIDTH);
+  QString aText = translate(theData->widgetLabel());
+  QString aToolTip = ModuleBase_Tools::wrapTextByWords(translate(theData->widgetTooltip()),
+                                                       myButton,
+                                                       DEFAULT_TOOL_TIP_WIDTH);
 
   myButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
   aControlLay->addWidget(myButton);