Salome HOME
Issue #591 - Highlight of the first argument of constraints
[modules/shaper.git] / src / ModuleBase / ModuleBase_Operation.cpp
index 7484ff28dd7e5798e57643126dd19de9eaffc644..58891e564d2bb1c9bec7a299fcdf7b7c3b2c1c52 100644 (file)
@@ -136,6 +136,7 @@ bool ModuleBase_Operation::hasObject(ObjectPtr theObj) const
 
 void ModuleBase_Operation::start()
 {
+  myIsModified = false;
   QString anId = getDescription()->operationId();
   if (myIsEditing) {
     anId = anId.append(EditSuffix());
@@ -255,6 +256,11 @@ void ModuleBase_Operation::setRunning(bool theState)
   emit triggered(theState);
 }
 
+void ModuleBase_Operation::onValuesChanged()
+{
+  myIsModified = true;
+}
+
 //TODO: nds stabilization hotfix
 void ModuleBase_Operation::commitOperation()
 {
@@ -375,6 +381,15 @@ void ModuleBase_Operation::setPropertyPanel(ModuleBase_IPropertyPanel* theProp)
   myPropertyPanel = theProp; 
   myPropertyPanel->setEditingMode(isEditOperation());
 
+  if (myPropertyPanel) {
+    const QList<ModuleBase_ModelWidget*>& aWidgets = myPropertyPanel->modelWidgets();
+    QList<ModuleBase_ModelWidget*>::const_iterator aWIt;
+    for (aWIt = aWidgets.constBegin(); aWIt != aWidgets.constEnd(); ++aWIt) {
+      ModuleBase_ModelWidget* aWgt = (*aWIt);
+      connect(aWgt, SIGNAL(valuesChanged()), this, SLOT(onValuesChanged()));
+    }
+  }
+
   // Do not activate widgets by default if the current operation is editing operation
   // Because we don't know which widget is going to be edited. 
   if (!isEditOperation())