Browse Source

Don't presume symbol library still exists (KICAD-74C).

pull/18/head
Jeff Young 4 months ago
parent
commit
d5eeef0f2c
  1. 18
      eeschema/tools/symbol_editor_control.cpp

18
eeschema/tools/symbol_editor_control.cpp

@ -258,6 +258,13 @@ int SYMBOL_EDITOR_CONTROL::AddSymbol( const TOOL_EVENT& aEvent )
return 0;
}
if( !editFrame->GetLibManager().LibraryExists( libName ) )
{
msg.Printf( _( "Symbol library '%s' not found." ), libName );
m_frame->ShowInfoBarError( msg );
return 0;
}
if( editFrame->GetLibManager().IsLibraryReadOnly( libName ) )
{
msg.Printf( _( "Symbol library '%s' is not writable." ), libName );
@ -402,7 +409,9 @@ int SYMBOL_EDITOR_CONTROL::CutCopyDelete( const TOOL_EVENT& aEvt )
{
const wxString& libName = sel.GetLibNickname();
if( editFrame->GetLibManager().IsLibraryReadOnly( libName ) )
if( !editFrame->GetLibManager().LibraryExists( libName ) )
msg.Printf( _( "Symbol library '%s' not found." ), libName );
else if( editFrame->GetLibManager().IsLibraryReadOnly( libName ) )
msg.Printf( _( "Symbol library '%s' is not writable." ), libName );
else
hasWritableLibs = true;
@ -443,6 +452,13 @@ int SYMBOL_EDITOR_CONTROL::DuplicateSymbol( const TOOL_EVENT& aEvent )
const wxString& libName = sel.GetLibNickname();
if( !editFrame->GetLibManager().LibraryExists( libName ) )
{
msg.Printf( _( "Symbol library '%s' not found." ), libName );
m_frame->ShowInfoBarError( msg );
return 0;
}
if( editFrame->GetLibManager().IsLibraryReadOnly( libName ) )
{
msg.Printf( _( "Symbol library '%s' is not writable." ), libName );

Loading…
Cancel
Save