QMap<QString,HYDROData_SequenceOfObjects> aBackObjects =
HYDROGUI_Tool::GetObjectsBackReferences( module(), anObjNames );
+ QMap<QString,HYDROData_SequenceOfObjects>::const_iterator anIt = aBackObjects.begin(),
+ aLast = aBackObjects.end();
+ QStringList aRefList;
+ for ( ; anIt != aLast; anIt++ ) {
+ QStringList aSeqList;
+ HYDROData_SequenceOfObjects::Iterator anIter( anIt.value() );
+ for ( ; anIter.More(); anIter.Next() )
+ {
+ Handle(HYDROData_Entity) anEntity = anIter.Value();
+ if ( anEntity.IsNull() )
+ continue;
+ aSeqList.append( QString( tr( "DELETE_OBJECT_NAME" ) ).arg( anEntity->GetName() ) );
+ }
+ aRefList.append( QString( tr( "DELETE_OBJECT_IS_USED_FOR" ) ).arg( anIt.key() )
+ .arg( aSeqList.join( ", " ) ) );
+ }
+
+ //QString aNamesList = anObjNames.join( "\n" );
if ( !aBackObjects.isEmpty() )
{
SUIT_MessageBox::critical( module()->getApp()->desktop(),
- tr( "DELETE_OBJECTS" ), tr( "DELETED_OBJECTS_HAS_BACKREFERENCES" ) );
+ tr( "DELETE_OBJECTS" ),
+ tr( "DELETED_OBJECTS_HAS_BACKREFERENCES" ).arg( aRefList.join( "\n" ) ) );
abort();
return;
}
<message>
<source>DELETED_OBJECTS_HAS_BACKREFERENCES</source>
<translation>One or more selected objects are used to create another ones.
-First remove objects which are created on their basis.</translation>
+First remove objects which are created on their basis.
+
+%1</translation>
+ </message>
+ <message>
+ <source>DELETE_OBJECT_NAME</source>
+ <translation>"%1"</translation>
+ </message>
+ <message>
+ <source>DELETE_OBJECT_IS_USED_FOR</source>
+ <translation>Object "%1" is used for %2</translation>
</message>
</context>