Fix issues related to footprint wizards not loaded/reloaded in fp editor and fp wizard frame.

Fixes #11195
https://gitlab.com/kicad/code/kicad/issues/11195
This commit is contained in:
jean-pierre charras 2023-01-09 19:56:48 +01:00
parent 31202a2eb3
commit 507edc54b3
2 changed files with 13 additions and 8 deletions

View File

@ -4,7 +4,7 @@
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2015 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2015-2016 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@ -1066,6 +1066,9 @@ void FOOTPRINT_EDIT_FRAME::setupTools()
m_toolManager->InitTools();
m_toolManager->InvokeTool( "pcbnew.InteractiveSelection" );
// Load or reload wizard plugins in case they changed since the last time the frame opened
m_toolManager->RunAction( PCB_ACTIONS::pluginsReload, true );
}

View File

@ -4,7 +4,7 @@
* Copyright (C) 2012-2015 Miguel Angel Ajo Pelayo <miguelangel@nbee.es>
* Copyright (C) 2012-2019 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 2004-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2004-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -53,6 +53,7 @@
#include "tools/pcb_selection_tool.h"
#include "tools/pcb_control.h"
#include "tools/pcb_actions.h"
#include <python/scripting/pcb_scripting_tool.h>
BEGIN_EVENT_TABLE( FOOTPRINT_WIZARD_FRAME, EDA_DRAW_FRAME )
@ -142,6 +143,7 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, wxWindow* aParent
m_toolManager->RegisterTool( new PCB_CONTROL );
m_toolManager->RegisterTool( new PCB_SELECTION_TOOL ); // for std context menus (zoom & grid)
m_toolManager->RegisterTool( new SCRIPTING_TOOL );
m_toolManager->RegisterTool( new COMMON_TOOLS );
m_toolManager->InitTools();
@ -636,12 +638,12 @@ void FOOTPRINT_WIZARD_FRAME::PythonPluginsReload()
{
// Reload the Python plugins
// Because the board editor has also a plugin python menu,
// call PCB_EDIT_FRAME::PythonPluginsReload() if the board editor
// is running
auto brd_frame = static_cast<PCB_EDIT_FRAME*>( Kiway().Player( FRAME_PCB_EDITOR, false ) );
// call the PCB_EDIT_FRAME RunAction() if the board editor is running
// Otherwise run the current RunAction().
PCB_EDIT_FRAME* pcbframe = static_cast<PCB_EDIT_FRAME*>( Kiway().Player( FRAME_PCB_EDITOR, false ) );
if( brd_frame )
brd_frame->GetToolManager()->RunAction( PCB_ACTIONS::pluginsReload );
if( pcbframe )
pcbframe->GetToolManager()->RunAction( PCB_ACTIONS::pluginsReload, true );
else
GetToolManager()->RunAction( PCB_ACTIONS::pluginsReload );
GetToolManager()->RunAction( PCB_ACTIONS::pluginsReload, true );
}