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();
else
{
setZonesVisible( true );
+
+ if ( isNameChanged ) {
+ module()->getDataModel()->updateObjectTree( myEditedObject );
+ }
}
if ( anIsToUpdateOb ) {