Eeschema, ExportSymbolsToLibrary(): fix not working replace library.
When exporting symbols of the schematic to a new library, if this library exists the dialog ask for overwriting it, but it did not work. Fixed now.
This commit is contained in:
parent
82d9176782
commit
fb225acefc
|
@ -391,11 +391,16 @@ int SCH_EDITOR_CONTROL::ExportSymbolsToLibrary( const TOOL_EVENT& aEvent )
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if the "new" library is in fact an existing library and the used asked for replacing
|
||||||
|
// it by the recreated lib, erase it:
|
||||||
|
if( fn.FileExists() )
|
||||||
|
wxRemoveFile( fn.GetFullPath() );
|
||||||
|
|
||||||
if( !mgr.CreateLibrary( fn.GetFullPath(), libTable ) )
|
if( !mgr.CreateLibrary( fn.GetFullPath(), libTable ) )
|
||||||
{
|
{
|
||||||
DisplayError( m_frame, wxString::Format( _( "Could not add library '%s'." ),
|
DisplayError( m_frame, wxString::Format( _( "Could not add library '%s'." ),
|
||||||
targetLib ) );
|
targetLib ) );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue