Do not ask for confirmation to open Properties dialog for a locked footprint

Opening Properties dialog normally does not ask the user to confirm the
action, even for locked items. The exception was a case when there was
nothing selected and Properties dialog was invoked via its hot key -
then SELECTION_TOOL::RequestSelection() tried to get the item under the
cursor, verifying the lock flag.

Fixes: lp:1734537
* https://bugs.launchpad.net/kicad/+bug/1734537
This commit is contained in:
Maciej Suminski 2017-11-28 17:32:12 +01:00
parent db3185723e
commit 769611b79e
3 changed files with 8 additions and 1 deletions

View File

@ -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
};

View File

@ -612,7 +612,8 @@ int EDIT_TOOL::Properties( const TOOL_EVENT& aEvent )
{
PCB_BASE_EDIT_FRAME* editFrame = getEditFrame<PCB_BASE_EDIT_FRAME>();
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;

View File

@ -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();