0021935: [CEA 696] Possibility to delete an object even if it was used before to create another one

This commit is contained in:
vsr 2013-05-27 15:19:08 +00:00
parent 9c34f9e0a4
commit d331308a89
3 changed files with 11 additions and 7 deletions

View File

@ -29,8 +29,10 @@
</message>
<message>
<source>DEP_OBJECT</source>
<translation>Selected object has been used to create another one.
It can&apos;t be deleted </translation>
<translation>One or more selected objects are used to create another ones or referenced from other modules.
Removal of these objects can result in valid Python dump.
Do you still want to delete these objects?</translation>
</message>
<message>
<source>DEVIDE_EDGE_NEW_OBJECT_NAME</source>

View File

@ -29,7 +29,7 @@
</message>
<message>
<source>DEP_OBJECT</source>
<translation>L&apos;objet choisi a é utilisé pour créer un autre objet.
<translation type="unfinished">L&apos;objet choisi a é utilisé pour créer un autre objet.
Il n&apos;est pas possible de le supprimer </translation>
</message>
<message>

View File

@ -543,10 +543,12 @@ void GEOMToolsGUI::OnEditDelete()
}
else {
// GEOM component is not selected: check if selected objects are in use
if ( inUse( aStudy, geomComp, allDeleted ) ) {
SUIT_MessageBox::warning( app->desktop(),
if ( inUse( aStudy, geomComp, allDeleted ) &&
SUIT_MessageBox::question( app->desktop(),
QObject::tr("WRN_WARNING"),
QObject::tr("DEP_OBJECT") );
QObject::tr("DEP_OBJECT"),
SUIT_MessageBox::Yes | SUIT_MessageBox::No,
SUIT_MessageBox::No ) != SUIT_MessageBox::Yes ) {
return; // object(s) in use
}
// ... and then delete all objects