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:
parent
db3185723e
commit
769611b79e
|
@ -222,6 +222,9 @@ enum SELECTION_TYPE_FLAGS
|
||||||
SELECTION_SANITIZE_PADS = 4,
|
SELECTION_SANITIZE_PADS = 4,
|
||||||
// Request a hover-only selection
|
// Request a hover-only selection
|
||||||
SELECTION_HOVER = 8,
|
SELECTION_HOVER = 8,
|
||||||
|
// Select locked parts without asking the user
|
||||||
|
SELECTION_FORCE_UNLOCK = 16,
|
||||||
|
|
||||||
SELECTION_DEFAULT = 0x7
|
SELECTION_DEFAULT = 0x7
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -612,7 +612,8 @@ int EDIT_TOOL::Properties( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
PCB_BASE_EDIT_FRAME* editFrame = getEditFrame<PCB_BASE_EDIT_FRAME>();
|
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() )
|
if( selection.Empty() )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -356,6 +356,9 @@ SELECTION& SELECTION_TOOL::RequestSelection( int aFlags )
|
||||||
{
|
{
|
||||||
if( m_selection.Empty() )
|
if( m_selection.Empty() )
|
||||||
{
|
{
|
||||||
|
if( aFlags & SELECTION_FORCE_UNLOCK )
|
||||||
|
m_locked = false;
|
||||||
|
|
||||||
m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true, 0 );
|
m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true, 0 );
|
||||||
m_selection.SetIsHover( true );
|
m_selection.SetIsHover( true );
|
||||||
m_selection.ClearReferencePoint();
|
m_selection.ClearReferencePoint();
|
||||||
|
|
Loading…
Reference in New Issue