Browse Source

Make sure PCB document is opened when doing an update.

Fixes: lp:1830256
* https://bugs.launchpad.net/kicad/+bug/1830256
pull/15/head
Jeff Young 6 years ago
parent
commit
94c8e84d3b
  1. 13
      eeschema/sch_edit_frame.cpp

13
eeschema/sch_edit_frame.cpp

@ -745,6 +745,10 @@ void SCH_EDIT_FRAME::CloseErc()
void SCH_EDIT_FRAME::OnUpdatePCB( wxCommandEvent& event )
{
wxFileName fn = Prj().AbsolutePath( g_RootSheet->GetScreen()->GetFileName() );
fn.SetExt( PcbFileExtension );
if( Kiface().IsSingle() )
{
DisplayError( this, _( "Cannot update the PCB, because the Schematic Editor is"
@ -756,6 +760,15 @@ void SCH_EDIT_FRAME::OnUpdatePCB( wxCommandEvent& event )
KIWAY_PLAYER* frame = Kiway().Player( FRAME_PCB, true );
// a pcb frame can be already existing, but not yet used.
// this is the case when running the footprint editor, or the footprint viewer first
// if the frame is not visible, the board is not yet loaded
if( !frame->IsVisible() )
{
frame->OpenProjectFiles( std::vector<wxString>( 1, fn.GetFullPath() ) );
frame->Show( true );
}
// On Windows, Raise() does not bring the window on screen, when iconized
if( frame->IsIconized() )
frame->Iconize( false );

Loading…
Cancel
Save