IPC-2581 has a hyphen in it.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19770
This commit is contained in:
Jeff Young 2025-02-03 20:15:42 +00:00
parent 3fff89820d
commit 40daacbeeb
4 changed files with 18 additions and 16 deletions

View File

@ -69,13 +69,13 @@ JOB_EXPORT_PCB_IPC2581::JOB_EXPORT_PCB_IPC2581() :
wxString JOB_EXPORT_PCB_IPC2581::GetDefaultDescription() const wxString JOB_EXPORT_PCB_IPC2581::GetDefaultDescription() const
{ {
return _( "Export IPC2581" ); return _( "Export IPC-2581" );
} }
wxString JOB_EXPORT_PCB_IPC2581::GetSettingsDialogTitle() const wxString JOB_EXPORT_PCB_IPC2581::GetSettingsDialogTitle() const
{ {
return _( "Export IPC2581 Job Settings" ); return _( "Export IPC-2581 Job Settings" );
} }
@ -88,5 +88,5 @@ void JOB_EXPORT_PCB_IPC2581::SetDefaultOutputPath( const wxString& aReferenceNam
SetConfiguredOutputPath( fn.GetFullName() ); SetConfiguredOutputPath( fn.GetFullName() );
} }
REGISTER_JOB( pcb_export_ipc2581, _HKI( "PCB: Export IPC2581" ), KIWAY::FACE_PCB, REGISTER_JOB( pcb_export_ipc2581, _HKI( "PCB: Export IPC-2581" ), KIWAY::FACE_PCB,
JOB_EXPORT_PCB_IPC2581 ); JOB_EXPORT_PCB_IPC2581 );

View File

@ -45,7 +45,7 @@ CLI::PCB_EXPORT_IPC2581_COMMAND::PCB_EXPORT_IPC2581_COMMAND() :
addDrawingSheetArg(); addDrawingSheetArg();
addDefineArg(); addDefineArg();
m_argParser.add_description( std::string( "Export the PCB in IPC2581 format" ) ); m_argParser.add_description( std::string( "Export the PCB in IPC-2581 format" ) );
m_argParser.add_argument( ARG_PRECISION ) m_argParser.add_argument( ARG_PRECISION )
.help( std::string( "Precision" ) ) .help( std::string( "Precision" ) )
@ -59,7 +59,7 @@ CLI::PCB_EXPORT_IPC2581_COMMAND::PCB_EXPORT_IPC2581_COMMAND() :
m_argParser.add_argument( ARG_VERSION ) m_argParser.add_argument( ARG_VERSION )
.default_value( std::string( "C" ) ) .default_value( std::string( "C" ) )
.help( std::string( "IPC2581 standard version" ) ) .help( std::string( "IPC-2581 standard version" ) )
.choices( "B", "C" ); .choices( "B", "C" );
m_argParser.add_argument( ARG_UNITS ) m_argParser.add_argument( ARG_UNITS )

View File

@ -1299,7 +1299,7 @@ void PCB_EDIT_FRAME::GenIPC2581File( wxCommandEvent& event )
if( pcbFileName.GetName().empty() ) if( pcbFileName.GetName().empty() )
{ {
DisplayError( this, _( "The board must be saved before generating IPC2581 file." ) ); DisplayError( this, _( "The board must be saved before generating IPC-2581 file." ) );
return; return;
} }
@ -1315,7 +1315,7 @@ void PCB_EDIT_FRAME::GenIPC2581File( wxCommandEvent& event )
wxString tempFile = wxFileName::CreateTempFileName( wxS( "pcbnew_ipc" ) ); wxString tempFile = wxFileName::CreateTempFileName( wxS( "pcbnew_ipc" ) );
wxString upperTxt; wxString upperTxt;
wxString lowerTxt; wxString lowerTxt;
WX_PROGRESS_REPORTER reporter( this, _( "Generating IPC2581 file" ), 5 ); WX_PROGRESS_REPORTER reporter( this, _( "Generating IPC-2581 file" ), 5 );
std::map<std::string, UTF8> props; std::map<std::string, UTF8> props;
props["units"] = dlg.GetUnitsString(); props["units"] = dlg.GetUnitsString();
@ -1339,8 +1339,10 @@ void PCB_EDIT_FRAME::GenIPC2581File( wxCommandEvent& event )
} }
catch( const IO_ERROR& ioe ) catch( const IO_ERROR& ioe )
{ {
DisplayError( this, wxString::Format( _( "Error generating IPC2581 file '%s'.\n%s" ), DisplayError( this,
pcbFileName.GetFullPath(), ioe.What() ) ); wxString::Format( _( "Error generating IPC-2581 file '%s'.\n%s" ),
pcbFileName.GetFullPath(),
ioe.What() ) );
lowerTxt.Printf( _( "Failed to create temporary file '%s'." ), tempFile ); lowerTxt.Printf( _( "Failed to create temporary file '%s'." ), tempFile );
@ -1372,7 +1374,7 @@ void PCB_EDIT_FRAME::GenIPC2581File( wxCommandEvent& event )
} }
catch( const std::exception& e ) catch( const std::exception& e )
{ {
wxLogError( "Exception in IPC2581 generation: %s", e.what() ); wxLogError( "Exception in IPC-2581 generation: %s", e.what() );
GetScreen()->SetContentModified( false ); GetScreen()->SetContentModified( false );
return; return;
} }
@ -1403,7 +1405,7 @@ void PCB_EDIT_FRAME::GenIPC2581File( wxCommandEvent& event )
// If save succeeded, replace the original with what we just wrote // If save succeeded, replace the original with what we just wrote
if( !wxRenameFile( tempFile, pcbFileName.GetFullPath() ) ) if( !wxRenameFile( tempFile, pcbFileName.GetFullPath() ) )
{ {
DisplayError( this, wxString::Format( _( "Error generating IPC2581 file '%s'.\n" DisplayError( this, wxString::Format( _( "Error generating IPC-2581 file '%s'.\n"
"Failed to rename temporary file '%s." ), "Failed to rename temporary file '%s." ),
pcbFileName.GetFullPath(), pcbFileName.GetFullPath(),
tempFile ) ); tempFile ) );

View File

@ -2009,7 +2009,7 @@ int PCBNEW_JOBS_HANDLER::JobExportIpc2581( JOB* aJob )
} }
catch( const IO_ERROR& ioe ) catch( const IO_ERROR& ioe )
{ {
m_reporter->Report( wxString::Format( _( "Error generating IPC2581 file '%s'.\n%s" ), m_reporter->Report( wxString::Format( _( "Error generating IPC-2581 file '%s'.\n%s" ),
job->m_filename, job->m_filename,
ioe.What() ), ioe.What() ),
RPT_SEVERITY_ERROR ); RPT_SEVERITY_ERROR );
@ -2042,10 +2042,10 @@ int PCBNEW_JOBS_HANDLER::JobExportIpc2581( JOB* aJob )
// If save succeeded, replace the original with what we just wrote // If save succeeded, replace the original with what we just wrote
if( !wxRenameFile( tempFile, outPath ) ) if( !wxRenameFile( tempFile, outPath ) )
{ {
m_reporter->Report( wxString::Format( _( "Error generating IPC2581 file '%s'.\n" m_reporter->Report( wxString::Format( _( "Error generating IPC-2581 file '%s'.\n"
"Failed to rename temporary file '%s." ) "Failed to rename temporary file '%s." ),
+ wxS( "\n" ), outPath,
outPath, tempFile ), tempFile ),
RPT_SEVERITY_ERROR ); RPT_SEVERITY_ERROR );
} }