diff --git a/change_log.txt b/change_log.txt index 6abaae9ba4..e8e78c8977 100644 --- a/change_log.txt +++ b/change_log.txt @@ -8,7 +8,8 @@ email address. 2008-Mar-30 UPDATE Jonas Diemer ================================================================================ +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 ================================================================================ diff --git a/eeschema/load_one_schematic_file.cpp b/eeschema/load_one_schematic_file.cpp index 1f325929a9..53871bf7f4 100644 --- a/eeschema/load_one_schematic_file.cpp +++ b/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; diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index 661b7aa80b..fd7e741f9f 100644 --- a/pcbnew/files.cpp +++ b/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 );