Browse Source

Make global delete tracks remove tuning patterns

If we are removing the generated item, we should remove the generator as
well

Fixes https://gitlab.com/kicad/code/kicad/issues/21572
pull/19/head
Seth Hillbrand 3 months ago
parent
commit
cb4c8e6647
  1. 11
      pcbnew/dialogs/dialog_global_deletion.cpp
  2. 1
      pcbnew/generators/pcb_tuning_pattern.h

11
pcbnew/dialogs/dialog_global_deletion.cpp

@ -31,7 +31,9 @@ using namespace std::placeholders;
#include <board_commit.h>
#include <board.h>
#include <footprint.h>
#include <pcb_generator.h>
#include <pcb_track.h>
#include <generators/pcb_tuning_pattern.h>
#include <tool/tool_manager.h>
#include <tools/pcb_actions.h>
#include <tools/global_edit_tool.h>
@ -272,6 +274,15 @@ void DIALOG_GLOBAL_DELETION::DoGlobalDeletions()
}
}
}
for( PCB_GENERATOR* generator : board->Generators() )
{
if( PCB_TUNING_PATTERN* pattern = dynamic_cast<PCB_TUNING_PATTERN*>( generator ) )
{
if( pattern->GetBoardItems().empty() )
commit.Remove( pattern );
}
}
}
commit.Push( _( "Global Delete" ) );

1
pcbnew/generators/pcb_tuning_pattern.h

@ -23,6 +23,7 @@
*/
#include <eda_item.h>
#include <geometry/geometry_utils.h>
#include <pcb_base_edit_frame.h>
#include <router/pns_meander.h>
#include <router/pns_meander_placer_base.h>

Loading…
Cancel
Save