Gerbview: show a message instead of an error when trying to open a job file as plot file.
From master branch, commit ef0ae8
This commit is contained in:
parent
1797a9c61a
commit
86a710e175
|
@ -322,7 +322,17 @@ bool GERBVIEW_FRAME::loadListOfGerberAndDrillFiles( const wxString& aPath,
|
|||
}
|
||||
else
|
||||
{
|
||||
if( Read_GERBER_File( filename.GetFullPath() ) )
|
||||
if( filename.GetExt() == GerberJobFileExtension.c_str() )
|
||||
{
|
||||
//We cannot read a gerber job file as a gerber plot file: skip it
|
||||
wxString txt;
|
||||
txt.Printf(
|
||||
_( "<b>A gerber job file cannot be loaded as a plot file</b> <i>%s</i>" ),
|
||||
filename.GetFullName() );
|
||||
success = false;
|
||||
reporter.Report( txt, REPORTER::RPT_WARNING );
|
||||
}
|
||||
else if( Read_GERBER_File( filename.GetFullPath() ) )
|
||||
{
|
||||
UpdateFileHistory( m_lastFileName );
|
||||
|
||||
|
@ -552,6 +562,18 @@ bool GERBVIEW_FRAME::unarchiveFiles( const wxString& aFullFileName, REPORTER* aR
|
|||
continue;
|
||||
}
|
||||
|
||||
if( curr_ext == GerberJobFileExtension.c_str() )
|
||||
{
|
||||
//We cannot read a gerber job file as a gerber plot file: skip it
|
||||
if( aReporter )
|
||||
{
|
||||
msg.Printf( _( "Info: skip file \"%s\" (gerber job file)\n" ), entry->GetName() );
|
||||
aReporter->Report( msg, REPORTER::RPT_WARNING );
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
int layer = GetActiveLayer();
|
||||
|
||||
if( layer == NO_AVAILABLE_LAYERS )
|
||||
|
|
|
@ -54,20 +54,23 @@ void GERBVIEW_FRAME::ReCreateMenuBar()
|
|||
|
||||
// Open Gerber file(s)
|
||||
AddMenuItem( fileMenu, wxID_FILE,
|
||||
_( "Open &Gerber File(s)..." ),
|
||||
_( "Open Gerber file(s) on the current layer. Previous data will be deleted" ),
|
||||
_( "Open &Gerber Plot File(s)..." ),
|
||||
_( "Open Gerber plot file(s) on the current layer."
|
||||
" Previous data will be deleted" ),
|
||||
KiBitmap( load_gerber_xpm ) );
|
||||
|
||||
// Open Excellon drill file(s)
|
||||
AddMenuItem( fileMenu, ID_GERBVIEW_LOAD_DRILL_FILE,
|
||||
_( "Open &Excellon Drill File(s)..." ),
|
||||
_( "Open Excellon drill file(s) on the current layer. Previous data will be deleted" ),
|
||||
_( "Open Excellon drill file(s) on the current layer."
|
||||
" Previous data will be deleted" ),
|
||||
KiBitmap( gerbview_drill_file_xpm ) );
|
||||
|
||||
// Open Gerber job files
|
||||
AddMenuItem( fileMenu, ID_GERBVIEW_LOAD_JOB_FILE,
|
||||
_( "Open Gerber &Job File..." ),
|
||||
_( "Open a Gerber job file, and it's associated gerber files depending on the job" ),
|
||||
_( "Open a Gerber job file, and it's associated gerber plot"
|
||||
" files depending on the job" ),
|
||||
KiBitmap( gerber_job_file_xpm ) );
|
||||
|
||||
// Open Zip archive files
|
||||
|
|
Loading…
Reference in New Issue