From 74b0e1fa4773ce4d5603b7d837b956b5d1362c5a Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Mon, 28 Sep 2020 19:58:08 -0400 Subject: [PATCH] Break apart locked items from the rest of the selection filter Disable selection of locked items by default See discussion in https://gitlab.com/kicad/code/kicad/-/issues/5793 --- include/project/board_project_settings.h | 10 ++++++++-- pcbnew/tools/selection_tool.cpp | 2 +- pcbnew/widgets/panel_selection_filter.cpp | 1 - 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/include/project/board_project_settings.h b/include/project/board_project_settings.h index 294b08f11e..71d85949d7 100644 --- a/include/project/board_project_settings.h +++ b/include/project/board_project_settings.h @@ -62,15 +62,21 @@ struct SELECTION_FILTER_OPTIONS otherItems = true; } + /** + * @return true if any of the item types are enabled (excluding "locked items" which is special) + */ bool Any() { - return ( lockedItems || footprints || text || tracks || vias || pads || graphics || zones + return ( footprints || text || tracks || vias || pads || graphics || zones || keepouts || dimensions || otherItems ); } + /** + * @return true if all the item types are enabled (excluding "locked items" which is special) + */ bool All() { - return ( lockedItems && footprints && text && tracks && vias && pads && graphics && zones + return ( footprints && text && tracks && vias && pads && graphics && zones && keepouts && dimensions && otherItems ); } }; diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index 5968094b6c..1135cefd03 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -105,7 +105,7 @@ SELECTION_TOOL::SELECTION_TOOL() : m_enteredGroup( nullptr ), m_priv( std::make_unique() ) { - m_filter.lockedItems = true; + m_filter.lockedItems = false; m_filter.footprints = true; m_filter.text = true; m_filter.tracks = true; diff --git a/pcbnew/widgets/panel_selection_filter.cpp b/pcbnew/widgets/panel_selection_filter.cpp index 8c6d81d104..73c172af38 100644 --- a/pcbnew/widgets/panel_selection_filter.cpp +++ b/pcbnew/widgets/panel_selection_filter.cpp @@ -77,7 +77,6 @@ void PANEL_SELECTION_FILTER::OnFilterChanged( wxCommandEvent& aEvent ) { bool newState = m_cbAllItems->GetValue(); - m_cbLockedItems->SetValue( newState ); m_cbFootprints->SetValue( newState ); m_cbText->SetValue( newState ); m_cbTracks->SetValue( newState );