Removal tool asks for confirmation only for modules (GAL).

This commit is contained in:
Maciej Suminski 2015-09-08 11:17:30 +02:00
parent b55c074a11
commit 6e23979253
1 changed files with 6 additions and 2 deletions

View File

@ -725,10 +725,14 @@ static bool deleteItem( TOOL_MANAGER* aToolMgr, const VECTOR2D& aPosition )
aToolMgr->RunAction( COMMON_ACTIONS::selectionCursor, true );
selectionTool->SanitizeSelection();
if( selectionTool->GetSelection().Empty() )
const SELECTION& selection = selectionTool->GetSelection();
if( selection.Empty() )
return true;
if( IsOK( aToolMgr->GetEditFrame(), _( "Are you sure you want to delete item?" ) ) )
bool canBeRemoved = ( selection.Item<EDA_ITEM>( 0 )->Type() != PCB_MODULE_T );
if( canBeRemoved || IsOK( aToolMgr->GetEditFrame(), _( "Are you sure you want to delete item?" ) ) )
aToolMgr->RunAction( COMMON_ACTIONS::remove, true );
else
aToolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );