Add specific warning for no symbol library selected.

Fixes https://gitlab.com/kicad/code/kicad/issues/7954
This commit is contained in:
Jeff Young 2021-03-18 11:04:44 +00:00
parent 074f0432f0
commit 35d17929ff
1 changed files with 7 additions and 0 deletions

View File

@ -154,6 +154,13 @@ int SYMBOL_EDITOR_CONTROL::AddSymbol( const TOOL_EVENT& aEvent )
const wxString& libName = sel.GetLibNickname();
wxString msg;
if( libName.IsEmpty() )
{
msg.Printf( _( "No symbol library selected." ), libName );
m_frame->ShowInfoBarError( msg );
return 0;
}
if( editFrame->GetLibManager().IsLibraryReadOnly( libName ) )
{
msg.Printf( _( "Symbol library '%s' is not writeable." ), libName );