]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Item Delete in pop-up of link on hypotheses or algorithm doesn't work.
authordmv <dmv@opencascade.com>
Wed, 22 Oct 2008 06:42:51 +0000 (06:42 +0000)
committerdmv <dmv@opencascade.com>
Wed, 22 Oct 2008 06:42:51 +0000 (06:42 +0000)
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESH_msg_en.ts

index 6c7cfffcbadbd7af068b335e66100c4d58ee2845..355f1a9b9428f0cb45ec248fbcfd560e227c5778 100644 (file)
     _PTR(AttributeIOR) anIOR;
 
     int objectCount = 0;
+    QString aNameList;
     QString aParentComponent = QString::null;
+    Handle(SALOME_InteractiveObject) anIO;
     for( SALOME_ListIteratorOfListIO anIt( selected ); anIt.More(); anIt.Next() )
     {
-      _PTR(SObject) aSO = aStudy->FindObjectID(anIt.Value()->getEntry());
+      anIO = anIt.Value();
+      QString cur = anIO->getComponentDataType();
+      _PTR(SObject) aSO = aStudy->FindObjectID(anIO->getEntry());
       if (aSO) {
-       // check if object is not reference
-       _PTR(SObject) refobj;
-       if ( !aSO->ReferencedObject( refobj ) )
-         objectCount++;
+       // check if object is reference
+       _PTR(SObject) aRefSObj;
+       aNameList.append("\n    - ");
+       if ( aSO->ReferencedObject( aRefSObj ) ) {
+         QString aRefName = QString::fromStdString ( aRefSObj->GetName() );
+         aNameList.append( aRefName );
+         cur = QString::fromStdString ( aRefSObj->GetFatherComponent()->ComponentDataType() );
+       }
+       else
+         aNameList.append(anIO->getName());
+       objectCount++;
       }
 
-      QString cur = anIt.Value()->getComponentDataType();
       if( aParentComponent.isNull() )
         aParentComponent = cur;
       else if( !aParentComponent.isEmpty() && aParentComponent!=cur )
     if (SUIT_MessageBox::warning
        (SMESHGUI::desktop(),
         QObject::tr("SMESH_WRN_WARNING"),
-        QObject::tr("SMESH_REALLY_DELETE"),
+        QObject::tr("SMESH_REALLY_DELETE").arg( objectCount ).arg( aNameList ),
         SUIT_MessageBox::Yes | SUIT_MessageBox::No,
         SUIT_MessageBox::Yes) != SUIT_MessageBox::Yes)
       return;
          if ( engineIOR() == anIOR->Value().c_str() )
            continue;
        }
-
-       _PTR(SObject) refobj;
-       if ( aSO && aSO->ReferencedObject( refobj ) )
-         continue; // skip references
+       //Check the referenced object
+       _PTR(SObject) aRefSObject;
+       if ( aSO && aSO->ReferencedObject( aRefSObject ) )
+         aSO = aRefSObject; // Delete main Object instead of reference
 
         // put the whole hierarchy of sub-objects of the selected SO into a list and
         // then treat them all starting from the deepest objects (at list back)
index f1ce25d7c53eefb83eaec337d050e6f9117e0224..e681b0894b0a65fb5118ff26380ab69460582e68 100644 (file)
@@ -1611,7 +1611,7 @@ Are you sure want to export to MED 2.1 ?</translation>
         </message>
         <message>
             <source>SMESH_REALLY_DELETE</source>
-            <translation>Do you really want to delete object(s) ?</translation>
+            <translation>Do you really want to delete this %1 object(s)? : %2</translation>
         </message>
         <message>
             <source>SMESH_REMOVE</source>