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

This commit is contained in:
dmv 2008-10-22 06:43:37 +00:00
parent 6d02e18557
commit 8a9b59c3e6
2 changed files with 20 additions and 10 deletions

View File

@ -921,18 +921,28 @@ using namespace std;
_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 = anIt.Value()->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 = aRefSObj->GetName();
aNameList.append( aRefName );
cur = 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 )
@ -953,7 +963,7 @@ using namespace std;
if (SUIT_MessageBox::warn2 if (SUIT_MessageBox::warn2
(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 ),
QObject::tr("SMESH_BUT_YES"), QObject::tr("SMESH_BUT_NO"), 1, 0, 0) != 1) QObject::tr("SMESH_BUT_YES"), QObject::tr("SMESH_BUT_NO"), 1, 0, 0) != 1)
return; return;
@ -975,10 +985,10 @@ using namespace std;
if ( !strcmp( (char*)anIOR->Value().c_str(), engineIOR().latin1() ) ) if ( !strcmp( (char*)anIOR->Value().c_str(), engineIOR().latin1() ) )
continue; continue;
} }
//Check the referenced object
_PTR(SObject) refobj; _PTR(SObject) refobj;
if ( aSO && aSO->ReferencedObject( refobj ) ) if ( aSO && aSO->ReferencedObject( refobj ) )
continue; // skip references aSO = refobj; // 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

@ -142,7 +142,7 @@ msgstr "Operation failed"
#: SMESHGUI.cxx:465 #: SMESHGUI.cxx:465
msgid "SMESH_REALLY_DELETE" msgid "SMESH_REALLY_DELETE"
msgstr "Do you really want to delete object(s) ?" msgstr "Do you really want to delete this %1 object(s)? : %2"
#Hypothesis or Algorithm not exists #Hypothesis or Algorithm not exists
msgid "SMESH_WRN_HYPOTHESIS_NOTEXIST" msgid "SMESH_WRN_HYPOTHESIS_NOTEXIST"