Salome HOME
Merge branch 'master' of newgeom:newgeom.git
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetBoolValue.cpp
index 1c3b68d1d9bcbb87029802de5b55f24aefb53eba..e6bbdad250ee58087af360c81475676116dddd3f 100644 (file)
 #include <QLayout>
 #include <QCheckBox>
 
-ModuleBase_WidgetBoolValue::ModuleBase_WidgetBoolValue(QWidget* theParent, 
-  const Config_WidgetAPI* theData, 
-  const std::string& theParentId)
-  : ModuleBase_ModelWidget(theParent, theData, theParentId)
+ModuleBase_WidgetBoolValue::ModuleBase_WidgetBoolValue(QWidget* theParent,
+                                                       const Config_WidgetAPI* theData,
+                                                       const std::string& theParentId)
+    : ModuleBase_ModelWidget(theParent, theData, theParentId)
 {
   QString aText = QString::fromStdString(theData->widgetLabel());
   QString aToolTip = QString::fromStdString(theData->widgetTooltip());
@@ -37,26 +37,26 @@ ModuleBase_WidgetBoolValue::~ModuleBase_WidgetBoolValue()
 {
 }
 
-QWidget* ModuleBase_WidgetBoolValue::getControl() const 
-{ 
-  return myCheckBox; 
+QWidget* ModuleBase_WidgetBoolValue::getControl() const
+{
+  return myCheckBox;
 }
 
-bool ModuleBase_WidgetBoolValue::storeValue(ObjectPtr theObject) const
+bool ModuleBase_WidgetBoolValue::storeValue() const
 {
-  DataPtr aData = theObject->data();
+  DataPtr aData = myFeature->data();
   boost::shared_ptr<ModelAPI_AttributeBoolean> aBool = aData->boolean(attributeID());
 
   if (aBool->value() != myCheckBox->isChecked()) {
     aBool->setValue(myCheckBox->isChecked());
-    Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
+    updateObject(myFeature);
   }
   return true;
 }
 
-bool ModuleBase_WidgetBoolValue::restoreValue(ObjectPtr theObject)
+bool ModuleBase_WidgetBoolValue::restoreValue()
 {
-  DataPtr aData = theObject->data();
+  DataPtr aData = myFeature->data();
   boost::shared_ptr<ModelAPI_AttributeBoolean> aRef = aData->boolean(attributeID());
 
   bool isBlocked = myCheckBox->blockSignals(true);