Salome HOME
Issue #244 : do not allow to select null objects (coming from other documents) yet
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetBoolValue.cpp
index e6bbdad250ee58087af360c81475676116dddd3f..cc0197d577d18d90a5876633cfdf4ce348c92262 100644 (file)
@@ -24,11 +24,11 @@ ModuleBase_WidgetBoolValue::ModuleBase_WidgetBoolValue(QWidget* theParent,
 {
   QString aText = QString::fromStdString(theData->widgetLabel());
   QString aToolTip = QString::fromStdString(theData->widgetTooltip());
-  QString aDefault = QString::fromStdString(theData->getProperty("default"));
+  bool isChecked = theData->getBooleanAttribute(ANY_WDG_DEFAULT, false);
 
   myCheckBox = new QCheckBox(aText, theParent);
   myCheckBox->setToolTip(aToolTip);
-  myCheckBox->setChecked(aDefault == "true");
+  myCheckBox->setChecked(isChecked);
 
   connect(myCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(valuesChanged()));
 }
@@ -46,11 +46,8 @@ bool ModuleBase_WidgetBoolValue::storeValue() const
 {
   DataPtr aData = myFeature->data();
   boost::shared_ptr<ModelAPI_AttributeBoolean> aBool = aData->boolean(attributeID());
-
-  if (aBool->value() != myCheckBox->isChecked()) {
-    aBool->setValue(myCheckBox->isChecked());
-    updateObject(myFeature);
-  }
+  aBool->setValue(myCheckBox->isChecked());
+  updateObject(myFeature);
   return true;
 }