Browse Source

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

pull/1/head
diemer 18 years ago
parent
commit
03569ca112
  1. 3
      change_log.txt
  2. 4
      eeschema/load_one_schematic_file.cpp
  3. 12
      pcbnew/files.cpp

3
change_log.txt

@ -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>
================================================================================

4
eeschema/load_one_schematic_file.cpp

@ -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;

12
pcbnew/files.cpp

@ -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 );

Loading…
Cancel
Save