Adds Teardrops as separate type in Global Deletions dialog.

Also removes the nag dialog as undo has worked for Global Deletions for
some time now.
This commit is contained in:
Jeff Young 2023-03-19 20:18:04 +00:00
parent 897984aa22
commit 5d55fc41ae
4 changed files with 80 additions and 11 deletions

View File

@ -117,12 +117,6 @@ void DIALOG_GLOBAL_DELETION::DoGlobalDeletions()
bool gen_rastnest = false;
bool delete_all = m_delAll->GetValue();
if( !IsOK( GetParent(), delete_all ? _( "Are you sure you want to delete the entire board?" )
: _( "Are you sure you want to delete the selected items?" ) ) )
{
return;
}
// Clear selection before removing any items
m_Parent->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true );
@ -153,13 +147,20 @@ void DIALOG_GLOBAL_DELETION::DoGlobalDeletions()
}
};
if( delete_all || m_delZones->GetValue() )
for( ZONE* zone : board->Zones() )
{
for( ZONE* zone : board->Zones() )
if( delete_all )
{
if( delete_all )
processConnectedItem( zone, all_layers );
else
processConnectedItem( zone, all_layers );
}
else if( zone->IsTeardropArea() )
{
if( m_delTeardrops->GetValue() )
processConnectedItem( zone, layers_filter );
}
else
{
if( m_delZones->GetValue() )
processConnectedItem( zone, layers_filter );
}
}

View File

@ -40,6 +40,9 @@ DIALOG_GLOBAL_DELETION_BASE::DIALOG_GLOBAL_DELETION_BASE( wxWindow* parent, wxWi
m_delTracks = new wxCheckBox( sbSizerLeft->GetStaticBox(), wxID_ANY, _("Tracks && vias"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizerLeft->Add( m_delTracks, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 );
m_delTeardrops = new wxCheckBox( sbSizerLeft->GetStaticBox(), wxID_ANY, _("Teardrops"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizerLeft->Add( m_delTeardrops, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_delMarkers = new wxCheckBox( sbSizerLeft->GetStaticBox(), wxID_ANY, _("Markers"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizerLeft->Add( m_delMarkers, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 );

View File

@ -470,6 +470,70 @@
<event name="OnCheckBox">onCheckDeleteTracks</event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Teardrops</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_delTeardrops</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxLEFT|wxRIGHT</property>

View File

@ -42,6 +42,7 @@ class DIALOG_GLOBAL_DELETION_BASE : public DIALOG_SHIM
wxCheckBox* m_delDrawings;
wxCheckBox* m_delFootprints;
wxCheckBox* m_delTracks;
wxCheckBox* m_delTeardrops;
wxCheckBox* m_delMarkers;
wxCheckBox* m_delAll;
wxStaticBoxSizer* sbFilter;