Non-KiCad Project Importers: Fix broken project import
Fixes bug introduced in b4741c97b6
This commit is contained in:
parent
76ef98339d
commit
e03bca3563
|
@ -130,35 +130,39 @@ void KICAD_MANAGER_FRAME::ImportNonKiCadProject( wxString aWindowTitle, wxString
|
||||||
wxFileName schCopy( pro );
|
wxFileName schCopy( pro );
|
||||||
schCopy.SetExt( aSchFileExtension );
|
schCopy.SetExt( aSchFileExtension );
|
||||||
|
|
||||||
if( sch.Exists() && !schCopy.SameAs( sch )
|
if( sch.Exists() && !schCopy.SameAs( sch ) )
|
||||||
&& wxCopyFile( sch.GetFullPath(), schCopy.GetFullPath(), true ) )
|
|
||||||
{
|
{
|
||||||
///< @todo Should we remove the newly created folder?
|
if( !wxCopyFile( sch.GetFullPath(), schCopy.GetFullPath(), true ) )
|
||||||
msg.Printf( _( "Cannot copy file '%s'\n"
|
{
|
||||||
"to '%s'\n"
|
///< @todo Should we remove the newly created folder?
|
||||||
"The project cannot be imported." ),
|
msg.Printf( _( "Cannot copy file '%s'\n"
|
||||||
sch.GetFullPath(), schCopy.GetFullPath() );
|
"to '%s'\n"
|
||||||
|
"The project cannot be imported." ),
|
||||||
|
sch.GetFullPath(), schCopy.GetFullPath() );
|
||||||
|
|
||||||
wxMessageDialog schCopyErrorDlg( this, msg, _( "Error" ), wxOK_DEFAULT | wxICON_ERROR );
|
wxMessageDialog schCopyErrorDlg( this, msg, _( "Error" ), wxOK_DEFAULT | wxICON_ERROR );
|
||||||
schCopyErrorDlg.ShowModal();
|
schCopyErrorDlg.ShowModal();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wxFileName pcbCopy( pro );
|
wxFileName pcbCopy( pro );
|
||||||
pcbCopy.SetExt( aPcbFileExtension );
|
pcbCopy.SetExt( aPcbFileExtension );
|
||||||
|
|
||||||
if( pcb.Exists() && !pcbCopy.SameAs( pcb )
|
if( pcb.Exists() && !pcbCopy.SameAs( pcb ) )
|
||||||
&& wxCopyFile( pcb.GetFullPath(), pcbCopy.GetFullPath(), true ) )
|
|
||||||
{
|
{
|
||||||
///< @todo Should we remove copied schematic file and the newly created folder?
|
if( !wxCopyFile( pcb.GetFullPath(), pcbCopy.GetFullPath(), true ) )
|
||||||
msg.Printf( _( "Cannot copy file '%s'\n"
|
{
|
||||||
"to '%s'\n"
|
///< @todo Should we remove copied schematic file and the newly created folder?
|
||||||
"The project cannot be imported." ),
|
msg.Printf( _( "Cannot copy file '%s'\n"
|
||||||
sch.GetFullPath(), schCopy.GetFullPath() );
|
"to '%s'\n"
|
||||||
|
"The project cannot be imported." ),
|
||||||
|
pcb.GetFullPath(), pcbCopy.GetFullPath() );
|
||||||
|
|
||||||
wxMessageDialog brdCopyErrorDlg( this, msg, _( "Error" ), wxOK_DEFAULT | wxICON_ERROR );
|
wxMessageDialog brdCopyErrorDlg( this, msg, _( "Error" ), wxOK_DEFAULT | wxICON_ERROR );
|
||||||
brdCopyErrorDlg.ShowModal();
|
brdCopyErrorDlg.ShowModal();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close the project and make the new one
|
// Close the project and make the new one
|
||||||
|
|
Loading…
Reference in New Issue