minor code cleanup.
This commit is contained in:
parent
27b9377d3c
commit
91b9e928dc
|
@ -682,7 +682,7 @@ wxString PCB_EDIT_FRAME::createBackupFile( const wxString& aFileName )
|
||||||
// rename it to the backup file name.
|
// rename it to the backup file name.
|
||||||
if( fn.FileExists() )
|
if( fn.FileExists() )
|
||||||
{
|
{
|
||||||
// Remove the old file xxx.000 if it exists.
|
// Remove the old file xxx.kicad_pcb-bak if it exists.
|
||||||
if( backupFileName.FileExists() )
|
if( backupFileName.FileExists() )
|
||||||
wxRemoveFile( backupFileName.GetFullPath() );
|
wxRemoveFile( backupFileName.GetFullPath() );
|
||||||
|
|
||||||
|
@ -691,8 +691,7 @@ wxString PCB_EDIT_FRAME::createBackupFile( const wxString& aFileName )
|
||||||
{
|
{
|
||||||
wxString msg = wxString::Format( _(
|
wxString msg = wxString::Format( _(
|
||||||
"Warning: unable to create backup file \"%s\"" ),
|
"Warning: unable to create backup file \"%s\"" ),
|
||||||
GetChars( backupFileName.GetFullPath() )
|
backupFileName.GetFullPath() );
|
||||||
);
|
|
||||||
DisplayError( NULL, msg );
|
DisplayError( NULL, msg );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -718,8 +717,7 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool aCreateBackupF
|
||||||
{
|
{
|
||||||
wxString msg = wxString::Format( _(
|
wxString msg = wxString::Format( _(
|
||||||
"No access rights to write to file \"%s\"" ),
|
"No access rights to write to file \"%s\"" ),
|
||||||
GetChars( pcbFileName.GetFullPath() )
|
pcbFileName.GetFullPath() );
|
||||||
);
|
|
||||||
|
|
||||||
DisplayError( this, msg );
|
DisplayError( this, msg );
|
||||||
return false;
|
return false;
|
||||||
|
@ -758,12 +756,11 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool aCreateBackupF
|
||||||
{
|
{
|
||||||
wxString msg = wxString::Format( _(
|
wxString msg = wxString::Format( _(
|
||||||
"Error saving board file \"%s\".\n%s" ),
|
"Error saving board file \"%s\".\n%s" ),
|
||||||
GetChars( pcbFileName.GetFullPath() ),
|
pcbFileName.GetFullPath(), ioe.What()
|
||||||
GetChars( ioe.What() )
|
|
||||||
);
|
);
|
||||||
DisplayError( this, msg );
|
DisplayError( this, msg );
|
||||||
|
|
||||||
lowerTxt.Printf( _( "Failed to create \"%s\"" ), GetChars( pcbFileName.GetFullPath() ) );
|
lowerTxt.Printf( _( "Failed to create \"%s\"" ), pcbFileName.GetFullPath() );
|
||||||
|
|
||||||
AppendMsgPanel( upperTxt, lowerTxt, CYAN );
|
AppendMsgPanel( upperTxt, lowerTxt, CYAN );
|
||||||
|
|
||||||
|
@ -787,9 +784,9 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool aCreateBackupF
|
||||||
wxRemoveFile( autoSaveFileName.GetFullPath() );
|
wxRemoveFile( autoSaveFileName.GetFullPath() );
|
||||||
|
|
||||||
if( !!backupFileName )
|
if( !!backupFileName )
|
||||||
upperTxt.Printf( _( "Backup file: \"%s\"" ), GetChars( backupFileName ) );
|
upperTxt.Printf( _( "Backup file: \"%s\"" ), backupFileName );
|
||||||
|
|
||||||
lowerTxt.Printf( _( "Wrote board file: \"%s\"" ), GetChars( pcbFileName.GetFullPath() ) );
|
lowerTxt.Printf( _( "Wrote board file: \"%s\"" ), pcbFileName.GetFullPath() );
|
||||||
|
|
||||||
AppendMsgPanel( upperTxt, lowerTxt, CYAN );
|
AppendMsgPanel( upperTxt, lowerTxt, CYAN );
|
||||||
|
|
||||||
|
@ -810,8 +807,7 @@ bool PCB_EDIT_FRAME::SavePcbCopy( const wxString& aFileName )
|
||||||
{
|
{
|
||||||
wxString msg = wxString::Format( _(
|
wxString msg = wxString::Format( _(
|
||||||
"No access rights to write to file \"%s\"" ),
|
"No access rights to write to file \"%s\"" ),
|
||||||
GetChars( pcbFileName.GetFullPath() )
|
pcbFileName.GetFullPath() );
|
||||||
);
|
|
||||||
|
|
||||||
DisplayError( this, msg );
|
DisplayError( this, msg );
|
||||||
return false;
|
return false;
|
||||||
|
@ -835,8 +831,7 @@ bool PCB_EDIT_FRAME::SavePcbCopy( const wxString& aFileName )
|
||||||
{
|
{
|
||||||
wxString msg = wxString::Format( _(
|
wxString msg = wxString::Format( _(
|
||||||
"Error saving board file \"%s\".\n%s" ),
|
"Error saving board file \"%s\".\n%s" ),
|
||||||
GetChars( pcbFileName.GetFullPath() ),
|
pcbFileName.GetFullPath(), ioe.What()
|
||||||
GetChars( ioe.What() )
|
|
||||||
);
|
);
|
||||||
DisplayError( this, msg );
|
DisplayError( this, msg );
|
||||||
|
|
||||||
|
@ -844,7 +839,7 @@ bool PCB_EDIT_FRAME::SavePcbCopy( const wxString& aFileName )
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplayInfoMessage( this, wxString::Format( _( "Board copied to:\n\"%s\"" ),
|
DisplayInfoMessage( this, wxString::Format( _( "Board copied to:\n\"%s\"" ),
|
||||||
GetChars( pcbFileName.GetFullPath() ) ) );
|
pcbFileName.GetFullPath() ) );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -954,8 +949,7 @@ bool PCB_EDIT_FRAME::importFile( const wxString& aFileName, int aFileType )
|
||||||
{
|
{
|
||||||
wxString msg = wxString::Format( _(
|
wxString msg = wxString::Format( _(
|
||||||
"Error occurred saving project specific footprint library "
|
"Error occurred saving project specific footprint library "
|
||||||
"table:\n\n%s" ),
|
"table:\n\n%s" ), ioe.What() );
|
||||||
GetChars( ioe.What() ) );
|
|
||||||
wxMessageBox( msg, _( "File Save Error" ), wxOK | wxICON_ERROR );
|
wxMessageBox( msg, _( "File Save Error" ), wxOK | wxICON_ERROR );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue