Browse Source

Edit library footprint command

Provides missing PCB_ACTION for the edit library footprint command.  This is
needed for python control of the command

Fixes https://gitlab.com/kicad/code/kicad/issues/9454
6.0.7
Seth Hillbrand 4 years ago
parent
commit
ea4e06124e
  1. 6
      pcbnew/tools/board_editor_control.cpp
  2. 7
      pcbnew/tools/pcb_actions.cpp
  3. 2
      pcbnew/tools/pcb_actions.h

6
pcbnew/tools/board_editor_control.cpp

@ -1473,7 +1473,10 @@ int BOARD_EDITOR_CONTROL::EditFpInFpEditor( const TOOL_EVENT& aEvent )
auto editor = (FOOTPRINT_EDIT_FRAME*) editFrame->Kiway().Player( FRAME_FOOTPRINT_EDITOR, true );
editor->LoadFootprintFromBoard( fp );
if( aEvent.IsAction( &PCB_ACTIONS::editFpInFpEditor ) )
editor->LoadFootprintFromBoard( fp );
else if( aEvent.IsAction( &PCB_ACTIONS::editLibFpInFpEditor ) )
editor->LoadFootprintFromLibrary( fp->GetFPID() );
editor->Show( true );
editor->Raise(); // Iconize( false );
@ -1565,6 +1568,7 @@ void BOARD_EDITOR_CONTROL::setTransitions()
Go( &BOARD_EDITOR_CONTROL::DrillOrigin, PCB_ACTIONS::drillOrigin.MakeEvent() );
Go( &BOARD_EDITOR_CONTROL::EditFpInFpEditor, PCB_ACTIONS::editFpInFpEditor.MakeEvent() );
Go( &BOARD_EDITOR_CONTROL::EditFpInFpEditor, PCB_ACTIONS::editLibFpInFpEditor.MakeEvent() );
// Other
Go( &BOARD_EDITOR_CONTROL::ToggleLockSelected, PCB_ACTIONS::toggleLock.MakeEvent() );

7
pcbnew/tools/pcb_actions.cpp

@ -234,6 +234,13 @@ TOOL_ACTION PCB_ACTIONS::editFpInFpEditor( "pcbnew.EditorControl.EditFpInFpEdito
_( "Opens the selected footprint in the Footprint Editor" ),
BITMAPS::module_editor );
TOOL_ACTION PCB_ACTIONS::editLibFpInFpEditor( "pcbnew.EditorControl.EditLibFpInFpEditor",
AS_GLOBAL,
MD_CTRL + MD_SHIFT + 'E', "",
_( "Edit Library Footprint..." ),
_( "Opens the selected footprint in the Footprint Editor" ),
BITMAPS::module_editor );
TOOL_ACTION PCB_ACTIONS::getAndPlace( "pcbnew.InteractiveEdit.FindMove",
AS_GLOBAL,
'T', LEGACY_HK_NAME( "Get and Move Footprint" ),

2
pcbnew/tools/pcb_actions.h

@ -344,6 +344,8 @@ public:
static TOOL_ACTION runDRC;
static TOOL_ACTION editFpInFpEditor;
static TOOL_ACTION editLibFpInFpEditor;
static TOOL_ACTION showLayersManager;
static TOOL_ACTION showPythonConsole;

Loading…
Cancel
Save