Don't blindly overwrite footprints when doing a Save As.

This commit is contained in:
Jeff Young 2018-10-24 21:43:42 +01:00
parent 244497f514
commit 9624ef4f2e
1 changed files with 12 additions and 0 deletions

View File

@ -948,6 +948,18 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprintAs( MODULE* aModule )
bool module_exists = tbl->FootprintExists( libraryName, footprintName ); bool module_exists = tbl->FootprintExists( libraryName, footprintName );
if( module_exists )
{
wxString msg = wxString::Format( _( "Footprint %s already exists in %s." ),
footprintName,
libraryName );
KIDIALOG dlg( this, msg, _( "Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
dlg.SetOKLabel( _( "Overwrite" ) );
if( dlg.ShowModal() == wxID_CANCEL )
return false;
}
if( !saveFootprintInLibrary( aModule, libraryName ) ) if( !saveFootprintInLibrary( aModule, libraryName ) )
return false; return false;