From 39c7024f12deef1ab34739a2963557a4c41ae049 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 11 Jun 2023 11:36:42 +0100 Subject: [PATCH] Make sure infobar gets created earlier. (restoreLastFootprint() might want it.) Fixes https://gitlab.com/kicad/code/kicad/-/issues/14922 (cherry picked from commit 3159391e28e043cc15267ae2a4898cbfde7badb8) --- pcbnew/footprint_edit_frame.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index d51fdf9480..9666e3c496 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -128,14 +128,15 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : SetIcons( icon_bundle ); - CreateInfoBar(); - // Create GAL canvas m_canvasType = loadCanvasTypeSetting(); PCB_DRAW_PANEL_GAL* drawPanel = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_frameSize, GetGalDisplayOptions(), m_canvasType ); SetCanvas( drawPanel ); + + CreateInfoBar(); + SetBoard( new BOARD() ); // This board will only be used to hold a footprint for editing @@ -543,13 +544,17 @@ void FOOTPRINT_EDIT_FRAME::AddFootprintToBoard( FOOTPRINT* aFootprint ) msg.Printf( _( "Editing %s from board. Saving will update the board only." ), aFootprint->GetReference() ); - GetInfoBar()->RemoveAllButtons(); - GetInfoBar()->AddCloseButton(); - GetInfoBar()->ShowMessage( msg, wxICON_INFORMATION ); + if( WX_INFOBAR* infobar = GetInfoBar() ) + { + infobar->RemoveAllButtons(); + infobar->AddCloseButton(); + infobar->ShowMessage( msg, wxICON_INFORMATION ); + } } else { - GetInfoBar()->Dismiss(); + if( WX_INFOBAR* infobar = GetInfoBar() ) + infobar->Dismiss(); } UpdateMsgPanel();