Ask user before overwriting a file when migrating symbol libs.
Fixes https://gitlab.com/kicad/code/kicad/issues/8299
This commit is contained in:
parent
b78ba12739
commit
693fbf9073
|
@ -736,7 +736,7 @@ void PANEL_SYM_LIB_TABLE::onConvertLegacyLibraries( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
msg.Printf( _( "Save %d legacy libraries as current format (*.kicad_sym) and "
|
msg.Printf( _( "Save %d legacy libraries as current format (*.kicad_sym) and "
|
||||||
"replace legacy entries in table?" ),
|
"replace legacy entries in table?" ),
|
||||||
legacyRows.size() );
|
(int) legacyRows.size() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !IsOK( m_parent, msg ) )
|
if( !IsOK( m_parent, msg ) )
|
||||||
|
@ -760,6 +760,20 @@ void PANEL_SYM_LIB_TABLE::onConvertLegacyLibraries( wxCommandEvent& event )
|
||||||
wxFileName newLib( resolvedPath );
|
wxFileName newLib( resolvedPath );
|
||||||
newLib.SetExt( "kicad_sym" );
|
newLib.SetExt( "kicad_sym" );
|
||||||
|
|
||||||
|
if( newLib.Exists() )
|
||||||
|
{
|
||||||
|
msg.Printf( _( "File '%s' already exists. Do you want overwrite this file?" ),
|
||||||
|
newLib.GetFullPath() );
|
||||||
|
|
||||||
|
switch( wxMessageBox( msg, _( "Migrate Library" ),
|
||||||
|
wxYES_NO | wxCANCEL | wxICON_QUESTION, m_parent ) )
|
||||||
|
{
|
||||||
|
case wxYES: break;
|
||||||
|
case wxNO: continue;
|
||||||
|
case wxCANCEL: return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if( convertLibrary( libName, legacyLib.GetFullPath(), newLib.GetFullPath() ) )
|
if( convertLibrary( libName, legacyLib.GetFullPath(), newLib.GetFullPath() ) )
|
||||||
{
|
{
|
||||||
relPath = NormalizePath( newLib.GetFullPath(), &Pgm().GetLocalEnvVariables(),
|
relPath = NormalizePath( newLib.GetFullPath(), &Pgm().GetLocalEnvVariables(),
|
||||||
|
|
Loading…
Reference in New Issue