Tidy up delete-all-markers.

Fix a typo in the order of booleans, and move from 3 buttons to
2 buttons and a (remembered-for-session) checkbox.
This commit is contained in:
Jeff Young 2020-08-04 13:25:44 +01:00
parent f67ba62c11
commit 0f3d79245e
1 changed files with 7 additions and 6 deletions

View File

@ -513,7 +513,7 @@ void DIALOG_DRC::deleteAllMarkers( bool aIncludeExclusions )
// Clear current selection list to avoid selection of deleted items // Clear current selection list to avoid selection of deleted items
m_brdEditor->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true ); m_brdEditor->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true );
m_markerTreeModel->DeleteItems( false, true, aIncludeExclusions ); m_markerTreeModel->DeleteItems( false, aIncludeExclusions, true );
} }
@ -593,7 +593,8 @@ void DIALOG_DRC::OnDeleteOneClick( wxCommandEvent& aEvent )
void DIALOG_DRC::OnDeleteAllClick( wxCommandEvent& aEvent ) void DIALOG_DRC::OnDeleteAllClick( wxCommandEvent& aEvent )
{ {
bool includeExclusions = false; static bool s_includeExclusions = false;
int numExcluded = 0; int numExcluded = 0;
if( m_markersProvider ) if( m_markersProvider )
@ -610,17 +611,17 @@ void DIALOG_DRC::OnDeleteAllClick( wxCommandEvent& aEvent )
wxRichMessageDialog dlg( this, _( "Do you wish to delete excluded markers as well?" ), wxRichMessageDialog dlg( this, _( "Do you wish to delete excluded markers as well?" ),
_( "Delete All Markers" ), _( "Delete All Markers" ),
wxOK | wxCANCEL | wxCENTER | wxICON_QUESTION ); wxOK | wxCANCEL | wxCENTER | wxICON_QUESTION );
dlg.ShowCheckBox( _( "Delete exclusions" ) ); dlg.ShowCheckBox( _( "Delete exclusions" ), s_includeExclusions );
int ret = dlg.ShowModal(); int ret = dlg.ShowModal();
if( ret == wxID_CANCEL ) if( ret == wxID_CANCEL )
return; return;
else if( dlg.IsCheckBoxChecked() ) else
includeExclusions = true; s_includeExclusions = dlg.IsCheckBoxChecked();
} }
deleteAllMarkers( includeExclusions ); deleteAllMarkers( s_includeExclusions );
refreshBoardEditor(); refreshBoardEditor();
updateDisplayedCounts(); updateDisplayedCounts();