Salome HOME
bug #155: create profile of splines
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_DataModel.cxx
index ba34e1e62721aff393d7b80e60dae89b21a62afc..d37789b5b61a58d9ed59202acb78f75c39300ea1 100644 (file)
@@ -849,3 +849,24 @@ bool HYDROGUI_DataModel::createNewRegion( Handle(HYDROData_CalculationCase) theC
   }
   return isOk;
 }
+
+bool HYDROGUI_DataModel::rename( Handle(HYDROData_Entity) theEntity, const QString& theName )
+{
+  if ( theName.isEmpty() )
+    return false;
+
+  try 
+  {
+    getDocument()->StartOperation();
+    theEntity->SetName( theName );
+    getDocument()->CommitOperation( HYDROGUI_Tool::ToExtString( tr("RENAME_TO").arg( theName ) ) );
+    module()->application()->activeStudy()->Modified();
+  }
+  catch ( Standard_Failure )
+  {
+    getDocument()->AbortOperation();
+    return false;
+  }
+  return true;
+}
+