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
This commit is contained in:
Seth Hillbrand 2021-10-25 09:23:22 -07:00
parent bba742b804
commit ea4e06124e
3 changed files with 14 additions and 1 deletions

View File

@ -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 ); 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->Show( true );
editor->Raise(); // Iconize( false ); 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::DrillOrigin, PCB_ACTIONS::drillOrigin.MakeEvent() );
Go( &BOARD_EDITOR_CONTROL::EditFpInFpEditor, PCB_ACTIONS::editFpInFpEditor.MakeEvent() ); Go( &BOARD_EDITOR_CONTROL::EditFpInFpEditor, PCB_ACTIONS::editFpInFpEditor.MakeEvent() );
Go( &BOARD_EDITOR_CONTROL::EditFpInFpEditor, PCB_ACTIONS::editLibFpInFpEditor.MakeEvent() );
// Other // Other
Go( &BOARD_EDITOR_CONTROL::ToggleLockSelected, PCB_ACTIONS::toggleLock.MakeEvent() ); Go( &BOARD_EDITOR_CONTROL::ToggleLockSelected, PCB_ACTIONS::toggleLock.MakeEvent() );

View File

@ -234,6 +234,13 @@ TOOL_ACTION PCB_ACTIONS::editFpInFpEditor( "pcbnew.EditorControl.EditFpInFpEdito
_( "Opens the selected footprint in the Footprint Editor" ), _( "Opens the selected footprint in the Footprint Editor" ),
BITMAPS::module_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", TOOL_ACTION PCB_ACTIONS::getAndPlace( "pcbnew.InteractiveEdit.FindMove",
AS_GLOBAL, AS_GLOBAL,
'T', LEGACY_HK_NAME( "Get and Move Footprint" ), 'T', LEGACY_HK_NAME( "Get and Move Footprint" ),

View File

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