PCBNew: Display a warning on a file format version mismatch. Minor language fix.

This commit is contained in:
diemer 2008-04-06 16:05:23 +00:00
parent 7ce55e4839
commit 03569ca112
3 changed files with 16 additions and 3 deletions

View File

@ -8,7 +8,8 @@ email address.
2008-Mar-30 UPDATE Jonas Diemer <diemer-at-gmx.de>
================================================================================
+eeschema
EESchema displays a warning now on a file format mismatch.
+pcbnew
Display a warning on a file format version mismatch.
2008-Mar-31 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================

View File

@ -115,7 +115,7 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, const wxString& F
|| strncmp( Line + 9, SCHEMATIC_HEAD_STRING, sizeof(SCHEMATIC_HEAD_STRING) - 1 )
!= 0 )
{
MsgDiag = FullFileName + _( " is NOT EESchema file" );
MsgDiag = FullFileName + _( " is NOT an EESchema file!" );
DisplayError( this, MsgDiag );
fclose( f );
return FALSE;
@ -137,7 +137,7 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, const wxString& F
LineCount++;
if( fgets( Line, 1024 - 1, f ) == NULL || strncmp( Line, "LIBS:", 5 ) != 0 )
{
MsgDiag = FullFileName + _( " is NOT EESchema file" );
MsgDiag = FullFileName + _( " is NOT an EESchema file!" );
DisplayError( this, MsgDiag );
fclose( f );
return FALSE;

View File

@ -194,6 +194,18 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append )
return 0;
}
int ver;
sscanf(cbuf, "PCBNEW-BOARD Version %d date", &ver );
printf("version: %d -> %d - %s\n", ver, g_CurrentVersionPCB, cbuf);
if ( ver > g_CurrentVersionPCB )
{
DisplayInfo( this, _( "This file was created by a more recent version of PCBnew and may not load correctly. Please consider updating!"));
}
else if ( ver < g_CurrentVersionPCB )
{
DisplayInfo( this, _( "This file was created by an older version of EESchema. It will be stored in the new file format when you save this file again."));
}
SetTitle( GetScreen()->m_FileName );
SetLastProject( GetScreen()->m_FileName );