From d71d127c1a8525f93ae2e519de3130abdb2d3301 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 21 Aug 2020 23:44:43 +0100 Subject: [PATCH] Put up infobar when editing board footprint. Fixes https://gitlab.com/kicad/code/kicad/issues/5294 --- eeschema/libedit/lib_edit_frame.cpp | 12 ++++++++++++ pcbnew/footprint_edit_frame.cpp | 10 ++++++++++ 2 files changed, 22 insertions(+) diff --git a/eeschema/libedit/lib_edit_frame.cpp b/eeschema/libedit/lib_edit_frame.cpp index 5c62f1dbe5..e600f70edb 100644 --- a/eeschema/libedit/lib_edit_frame.cpp +++ b/eeschema/libedit/lib_edit_frame.cpp @@ -593,6 +593,18 @@ void LIB_EDIT_FRAME::SetCurPart( LIB_PART* aPart ) // Ensure synchronized pin edit can be enabled only symbols with interchangeable units m_SyncPinEdit = aPart && aPart->IsRoot() && aPart->IsMulti() && !aPart->UnitsLocked(); + /* TODO: enable when we have schematic-symbol editing... + if( IsCurrentPartFromSchematic() ) + { + wxString msg; + msg.Printf( _( "Editing %s from schematic. Saving will update the schematic only." ), + partName ); + + GetInfoBar()->RemoveAllButtons(); + GetInfoBar()->ShowMessage( msg, wxICON_INFORMATION ); + } + */ + m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD ); RebuildView(); } diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 889432e082..70e04ab249 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -406,6 +406,16 @@ void FOOTPRINT_EDIT_FRAME::AddModuleToBoard( MODULE* aFootprint ) PCB_BASE_EDIT_FRAME::AddModuleToBoard( aFootprint ); + if( IsCurrentFPFromBoard() ) + { + wxString msg; + msg.Printf( _( "Editing %s from board. Saving will update the board only." ), + aFootprint->GetReference() ); + + GetInfoBar()->RemoveAllButtons(); + GetInfoBar()->ShowMessage( msg, wxICON_INFORMATION ); + } + UpdateMsgPanel(); }