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.
This commit is contained in:
Mike Williams 2021-07-15 14:51:20 -04:00 committed by Wayne Stambaugh
parent 13a03f77d3
commit 36b2ff262d
1 changed files with 4 additions and 0 deletions

View File

@ -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 );
}