From 924736c6f378d4cca74a954e461835b3fdd796de Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 23 May 2019 19:25:07 +0100 Subject: [PATCH] Make sure PCBNew is open when running F8. Fixes: lp:1830256 * https://bugs.launchpad.net/kicad/+bug/1830256 --- eeschema/sch_edit_frame.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 9169e0ba44..2ccc7ae790 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -785,6 +785,23 @@ void SCH_EDIT_FRAME::CloseErc() void SCH_EDIT_FRAME::OnUpdatePCB( wxCommandEvent& event ) { + if( Kiface().IsSingle() ) + { + DisplayError( this, _( "Cannot update the PCB, because the Schematic Editor is" + " opened in stand-alone mode. In order to create/update" + " PCBs from schematics, you need to launch Kicad shell" + " and create a PCB project." ) ); + return; + } + + KIWAY_PLAYER* frame = Kiway().Player( FRAME_PCB, true ); + + // On Windows, Raise() does not bring the window on screen, when iconized + if( frame->IsIconized() ) + frame->Iconize( false ); + + frame->Raise(); + std::string payload; Kiway().ExpressMail( FRAME_PCB, MAIL_PCB_UPDATE, payload, this ); }