Item Delete in pop-up of link on hypotheses or algorithm doesn't work.

This commit is contained in:
dmv 2008-10-22 06:42:51 +00:00
parent ecf80f795d
commit 663cdc0234
2 changed files with 22 additions and 12 deletions

View File

@ -896,18 +896,28 @@
_PTR(AttributeIOR) anIOR; _PTR(AttributeIOR) anIOR;
int objectCount = 0; int objectCount = 0;
QString aNameList;
QString aParentComponent = QString::null; QString aParentComponent = QString::null;
Handle(SALOME_InteractiveObject) anIO;
for( SALOME_ListIteratorOfListIO anIt( selected ); anIt.More(); anIt.Next() ) 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) { if (aSO) {
// check if object is not reference // check if object is reference
_PTR(SObject) refobj; _PTR(SObject) aRefSObj;
if ( !aSO->ReferencedObject( refobj ) ) aNameList.append("\n - ");
objectCount++; 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() ) if( aParentComponent.isNull() )
aParentComponent = cur; aParentComponent = cur;
else if( !aParentComponent.isEmpty() && aParentComponent!=cur ) else if( !aParentComponent.isEmpty() && aParentComponent!=cur )
@ -927,7 +937,7 @@
if (SUIT_MessageBox::warning if (SUIT_MessageBox::warning
(SMESHGUI::desktop(), (SMESHGUI::desktop(),
QObject::tr("SMESH_WRN_WARNING"), 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::No,
SUIT_MessageBox::Yes) != SUIT_MessageBox::Yes) SUIT_MessageBox::Yes) != SUIT_MessageBox::Yes)
return; return;
@ -950,10 +960,10 @@
if ( engineIOR() == anIOR->Value().c_str() ) if ( engineIOR() == anIOR->Value().c_str() )
continue; continue;
} }
//Check the referenced object
_PTR(SObject) refobj; _PTR(SObject) aRefSObject;
if ( aSO && aSO->ReferencedObject( refobj ) ) if ( aSO && aSO->ReferencedObject( aRefSObject ) )
continue; // skip references aSO = aRefSObject; // Delete main Object instead of reference
// put the whole hierarchy of sub-objects of the selected SO into a list and // 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) // then treat them all starting from the deepest objects (at list back)

View File

@ -1611,7 +1611,7 @@ Are you sure want to export to MED 2.1 ?</translation>
</message> </message>
<message> <message>
<source>SMESH_REALLY_DELETE</source> <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>
<message> <message>
<source>SMESH_REMOVE</source> <source>SMESH_REMOVE</source>