From a45a8e8797d66616a7dd1cd0e50349d7ec2e4871 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 11 Aug 2018 20:35:58 +0100 Subject: [PATCH] Warn before replacing edited footprint in footprint editor. Fixes: lp:1786570 * https://bugs.launchpad.net/kicad/+bug/1786570 --- pcbnew/initpcb.cpp | 2 ++ pcbnew/load_select_footprint.cpp | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pcbnew/initpcb.cpp b/pcbnew/initpcb.cpp index ba6012b297..5af3579938 100644 --- a/pcbnew/initpcb.cpp +++ b/pcbnew/initpcb.cpp @@ -98,6 +98,8 @@ bool FOOTPRINT_EDIT_FRAME::Clear_Pcb( bool aQuery ) if( aQuery && GetScreen()->IsModify() && !GetBoard()->IsEmpty() ) { + wxSafeYield( this, true ); // Allow frame to come to front before showing warning. + if( !IsOK( this, _( "Current Footprint will be lost and this operation cannot be undone. Continue ?" ) ) ) return false; diff --git a/pcbnew/load_select_footprint.cpp b/pcbnew/load_select_footprint.cpp index 9f614d22e6..3c6b07558e 100644 --- a/pcbnew/load_select_footprint.cpp +++ b/pcbnew/load_select_footprint.cpp @@ -93,7 +93,8 @@ bool FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD( MODULE* aModule ) SetCurItem( NULL ); - Clear_Pcb( false ); + if( !Clear_Pcb( true ) ) + return false; GetBoard()->m_Status_Pcb = 0; newModule = new MODULE( *aModule );