diff --git a/include/tool/selection.h b/include/tool/selection.h index 0916f98481..28e7d8d0e1 100644 --- a/include/tool/selection.h +++ b/include/tool/selection.h @@ -222,6 +222,9 @@ enum SELECTION_TYPE_FLAGS SELECTION_SANITIZE_PADS = 4, // Request a hover-only selection SELECTION_HOVER = 8, + // Select locked parts without asking the user + SELECTION_FORCE_UNLOCK = 16, + SELECTION_DEFAULT = 0x7 }; diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 4218d9ec28..4cab7c1e6e 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -612,7 +612,8 @@ int EDIT_TOOL::Properties( const TOOL_EVENT& aEvent ) { PCB_BASE_EDIT_FRAME* editFrame = getEditFrame(); - const auto& selection = m_selectionTool->RequestSelection( SELECTION_EDITABLE | SELECTION_DELETABLE ); + const auto& selection = m_selectionTool->RequestSelection( + SELECTION_EDITABLE | SELECTION_DELETABLE | SELECTION_FORCE_UNLOCK ); if( selection.Empty() ) return 0; diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index 5a423ba32a..db8ce73ce0 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -356,6 +356,9 @@ SELECTION& SELECTION_TOOL::RequestSelection( int aFlags ) { if( m_selection.Empty() ) { + if( aFlags & SELECTION_FORCE_UNLOCK ) + m_locked = false; + m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true, 0 ); m_selection.SetIsHover( true ); m_selection.ClearReferencePoint();