Fix schematic editor crash when exporting symbols to missing library.
UI string was reused from the symbol library manager. No new translatable strings were used. Fixes https://gitlab.com/kicad/code/kicad/-/issues/16446
This commit is contained in:
parent
81cec494f2
commit
20ee45edbe
|
@ -337,7 +337,8 @@ void SCH_EDITOR_CONTROL::doCrossProbeSchToPcb( const TOOL_EVENT& aEvent, bool aF
|
|||
|
||||
int SCH_EDITOR_CONTROL::ExportSymbolsToLibrary( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
bool savePowerSymbols = IsOK( m_frame, _( "Include power symbols in schematic to the library?" ) );
|
||||
bool savePowerSymbols = IsOK( m_frame,
|
||||
_( "Include power symbols in schematic to the library?" ) );
|
||||
|
||||
bool createNew = aEvent.IsAction( &EE_ACTIONS::exportSymbolsToNewLibrary );
|
||||
|
||||
|
@ -430,7 +431,19 @@ int SCH_EDITOR_CONTROL::ExportSymbolsToLibrary( const TOOL_EVENT& aEvent )
|
|||
LIB_SYMBOL* origSym = it.second;
|
||||
LIB_SYMBOL* newSym = origSym->Flatten().release();
|
||||
|
||||
try
|
||||
{
|
||||
pi->SaveSymbol( dest.GetFullPath(), newSym );
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( _( "Error saving symbol %s to library '%s'." ),
|
||||
newSym->GetName(), row->GetNickName() );
|
||||
msg += wxS( "\n\n" ) + ioe.What();
|
||||
wxLogWarning( msg );
|
||||
return 0;
|
||||
}
|
||||
|
||||
if( map )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue