Commit 03569ca1 authored by diemer's avatar diemer

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

parent 7ce55e48
......@@ -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>
================================================================================
......
......@@ -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;
......
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment