From 36b2ff262dbcd6c0009a159fabcca5a6f236a408 Mon Sep 17 00:00:00 2001 From: Mike Williams Date: Thu, 15 Jul 2021 14:51:20 -0400 Subject: [PATCH] Symbol Editor: Auto select newly added/created library CHANGED: When creating a new library, the usual intention is to add a new symbol to it. Without this, the "No symbol library selected." message will appear if the user attempts to add a new symbol without manually selecting their new library. --- eeschema/symbol_editor/symbol_edit_frame.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eeschema/symbol_editor/symbol_edit_frame.cpp b/eeschema/symbol_editor/symbol_edit_frame.cpp index 47cc59148b..dc801d7461 100644 --- a/eeschema/symbol_editor/symbol_edit_frame.cpp +++ b/eeschema/symbol_editor/symbol_edit_frame.cpp @@ -849,6 +849,9 @@ bool SYMBOL_EDIT_FRAME::AddLibraryFile( bool aCreateNew ) bool globalTable = ( libTable == &SYMBOL_LIB_TABLE::GetGlobalLibTable() ); saveSymbolLibTables( globalTable, !globalTable ); + std::string packet = fn.GetFullPath().ToStdString(); + this->Kiway().ExpressMail( FRAME_SCH_SYMBOL_EDITOR, MAIL_LIB_EDIT, packet ); + return true; } @@ -1201,6 +1204,7 @@ void SYMBOL_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail ) if( m_treePane ) { LIB_ID id( libNickname, wxEmptyString ); + m_treePane->GetLibTree()->SelectLibId( id ); m_treePane->GetLibTree()->ExpandLibId( id ); m_treePane->GetLibTree()->CenterLibId( id ); }