~stol/kicad/selectcomp1493071

« back to all changes in this revision

Viewing changes to pcbnew/tools/pcbnew_control.cpp

  • Committer: Maciej Suminski
  • Date: 2015-09-08 09:17:30 UTC
  • Revision ID: maciej.suminski@cern.ch-20150908091730-485sz17mtml6r25c
Removal tool asks for confirmation only for modules (GAL).

Show diffs side-by-side

added added

removed removed

Lines of Context:
725
725
    aToolMgr->RunAction( COMMON_ACTIONS::selectionCursor, true );
726
726
    selectionTool->SanitizeSelection();
727
727
 
728
 
    if( selectionTool->GetSelection().Empty() )
 
728
    const SELECTION& selection = selectionTool->GetSelection();
 
729
 
 
730
    if( selection.Empty() )
729
731
        return true;
730
732
 
731
 
    if( IsOK( aToolMgr->GetEditFrame(), _( "Are you sure you want to delete item?" ) ) )
 
733
    bool canBeRemoved = ( selection.Item<EDA_ITEM>( 0 )->Type() != PCB_MODULE_T );
 
734
 
 
735
    if( canBeRemoved || IsOK( aToolMgr->GetEditFrame(), _( "Are you sure you want to delete item?" ) ) )
732
736
        aToolMgr->RunAction( COMMON_ACTIONS::remove, true );
733
737
    else
734
738
        aToolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );