Salome HOME
refs #207 - "Help" button doesn't work
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Operations.cxx
index 1114381aee4cc4816a9b4f8d480d6bdf4760fc58..7d8dba61d98a7e0d1969a6f99ff68b8967b64813 100644 (file)
@@ -136,8 +136,8 @@ void HYDROGUI_Module::createActions()
   createAction( CreateChannelId, "CREATE_CHANNEL", "CREATE_CHANNEL_ICO" );
   createAction( EditChannelId, "EDIT_CHANNEL", "EDIT_CHANNEL_ICO" );
 
-  createAction( CreateDigueId, "CREATE_DIGUE" );
-  createAction( EditDigueId, "EDIT_DIGUE" );
+  createAction( CreateDigueId, "CREATE_DIGUE", "CREATE_DIGUE_ICO" );
+  createAction( EditDigueId, "EDIT_DIGUE", "EDIT_DIGUE_ICO" );
 
   createAction( ImportObstacleFromFileId, "IMPORT_OBSTACLE_FROM_FILE", "IMPORT_OBSTACLE_FROM_FILE_ICO" );
   createAction( ImportGeomObjectId, "IMPORT_GEOM_OBJECT", "IMPORT_GEOM_OBJECT_ICO" );
@@ -239,6 +239,7 @@ void HYDROGUI_Module::createToolbars()
 
   createTool( separator(), aToolBar );
   createTool( CreateChannelId, aToolBar );
+  createTool( CreateDigueId, aToolBar );
 
   createTool( separator(), aToolBar );
   createTool( CreateImmersibleZoneId, aToolBar );
@@ -543,8 +544,8 @@ bool HYDROGUI_Module::renameAllowed( const QString& theEntry ) const
 bool HYDROGUI_Module::renameObject( const QString& theEntry, const QString& theName )
 {
   Handle(HYDROData_Entity) anEntity = getDataModel()->objectByEntry( theEntry );
-  bool aRes = !anEntity.IsNull();
-  if ( aRes )
+  bool aRes = false;
+  if ( !anEntity.IsNull() )
   {
     HYDROGUI_DataModel* aModel = getDataModel();
     if( aModel )
@@ -553,10 +554,18 @@ bool HYDROGUI_Module::renameObject( const QString& theEntry, const QString& theN
       {
         // check that there are no other objects with the same name in the document
         Handle(HYDROData_Entity) anObject = HYDROGUI_Tool::FindObjectByName( this, theName );
-        aRes = anObject.IsNull();
-        if ( aRes )
+        if ( anObject.IsNull() )
         {
-          aRes = aModel->rename( anEntity, theName );
+          SUIT_Operation* anOp = application()->activeStudy()->activeOperation();
+          if ( anOp && anOp->inherits( "HYDROGUI_CalculationOp" ) )
+          {
+            anEntity->SetName( theName );
+            aRes = true;
+          }
+          else
+          {
+            aRes = aModel->rename( anEntity, theName );
+          }
         }
         else
         {