Salome HOME
Fix for the bug #45: check and warning when the same image is used in 2 arguments.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Module.cxx
index 3433e99aec960b32d6376441fc60762b015dd008..19d2e20757c0f91b3f4d75e5eb7b0e5a6a8f72c9 100644 (file)
@@ -253,7 +253,7 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
   bool anIsFusedImage = false;
   bool anIsCutImage = false;
   bool anIsSplittedImage = false;
-  bool anIsMustBeUpdatedImage = false;
+  bool anIsMustobjectBeUpdated = false;
   bool anIsPolyline = false;
   bool anIsPolyline3D = false;
   bool anIsProfile = false;
@@ -290,6 +290,11 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
       anIsVisibleInSelection |= aVisibility;
       anIsHiddenInSelection |= !aVisibility;
 
+      if ( anObject->IsMustBeUpdated() )
+      {
+        anIsMustobjectBeUpdated = true;
+      }
+
       ObjectKind anObjectKind = anObject->GetKind();
       if( anObjectKind == KIND_IMAGE )
       {
@@ -312,10 +317,6 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
                 anIsSplittedImage = true;
             }
           }
-          if ( anImage->IsMustBeUpdated() )
-          {
-            anIsMustBeUpdatedImage = true;
-          }
         }
       }
       else if( anObjectKind == KIND_POLYLINEXY )
@@ -410,9 +411,9 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
 
   if( anIsSelectedDataObjects )
   {
-    if ( anIsMustBeUpdatedImage )
+    if ( anIsMustobjectBeUpdated )
     {
-      theMenu->addAction( action( UpdateImageId ) );
+      theMenu->addAction( action( UpdateObjectId ) );
       theMenu->addSeparator();
     }