Salome HOME
Minor changes.
authormzn <mzn@opencascade.com>
Fri, 24 Oct 2014 12:23:19 +0000 (12:23 +0000)
committermzn <mzn@opencascade.com>
Fri, 24 Oct 2014 12:23:19 +0000 (12:23 +0000)
src/HYDROGUI/HYDROGUI_CalculationOp.cxx
src/HYDROGUI/HYDROGUI_DataObject.cxx

index 5cac3dc1f0ebd96dae6c8f429025816a807aa596..9d78d3cc4db6990fc98bbaa1c79e360aca362d4c 100644 (file)
@@ -668,15 +668,18 @@ void HYDROGUI_CalculationOp::onNext( const int theIndex )
   
     QString aNewCaseName = aPanel->getObjectName();
     QString anOldCaseName = myEditedObject->GetName();
+    bool isNameChanged = anOldCaseName != aNewCaseName;
   
-    bool anIsToUpdateOb = false;
+    bool anIsToUpdateOb = isNameChanged;
 
     // At first we must to update the case name because of 
     // automatic names generation for regions and zones
     myEditedObject->SetName( aNewCaseName );
 
     // Clear rules
-    myEditedObject->ClearRules();
+    if ( myEditedObject->GetRulesCount() > 0 ) {
+      myEditedObject->ClearRules();
+    }
 
     // Set parameters for automatic mode
     int aMode = aPanel->getMode();
@@ -717,6 +720,10 @@ void HYDROGUI_CalculationOp::onNext( const int theIndex )
     else
     {
       setZonesVisible( true );
+
+      if ( isNameChanged ) {
+        module()->getDataModel()->updateObjectTree( myEditedObject );
+      }
     }
 
     if ( anIsToUpdateOb ) {
index 9701970ad2ee07bfdeae4a3e043341e1d861ba24..6f2b9cce804d3d8f228b441f0556bd33cc35ad12 100644 (file)
@@ -234,11 +234,6 @@ void HYDROGUI_DataObject::updateBy( SUIT_DataObject* theObj )
   setModified( true );
 }
 
-
-
-
-
-
 HYDROGUI_NamedObject::HYDROGUI_NamedObject( SUIT_DataObject* theParent,
                                             const QString&   theName,
                                             const QString&   theParentEntry,