More error message regularization.

This commit is contained in:
Jeff Young 2021-06-29 00:44:07 +01:00
parent d9a11c30ef
commit a1dfc36233
48 changed files with 163 additions and 161 deletions

View File

@ -911,7 +911,7 @@ bool DS_DATA_MODEL::LoadDrawingSheet( const wxString& aFullFileName, bool Append
if( wksFile.Read( buffer.get(), filelen ) != filelen )
{
wxLogMessage( _( "The file \"%s\" was not fully read" ), fullFileName.GetData() );
wxLogMessage( _( "The file '%s' was not fully read." ), fullFileName.GetData() );
return false;
}
else

View File

@ -63,7 +63,7 @@ FOOTPRINT_INFO* FOOTPRINT_LIST::GetFootprintInfo( const wxString& aFootprintName
LIB_ID fpid;
wxCHECK_MSG( fpid.Parse( aFootprintName ) < 0, NULL,
wxString::Format( wxT( "\"%s\" is not a valid LIB_ID." ), aFootprintName ) );
wxString::Format( wxT( "'%s' is not a valid LIB_ID." ), aFootprintName ) );
return GetFootprintInfo( fpid.GetLibNickname(), fpid.GetLibItemName() );
}

View File

@ -197,8 +197,8 @@ void FP_LIB_TABLE::Parse( LIB_TABLE_LEXER* in )
{
delete tmp; // The table did not take ownership of the row.
wxString msg = wxString::Format( _( "Duplicate library nickname \"%s\" found in "
"footprint library table file line %d" ),
wxString msg = wxString::Format( _( "Duplicate library nickname '%s' found in "
"footprint library table file line %d." ),
nickname,
lineNum );

View File

@ -416,7 +416,7 @@ bool WIDGET_HOTKEY_LIST::resolveKeyConflicts( TOOL_ACTION* aAction, long aKey )
return true;
TOOL_ACTION* conflictingAction = conflictingHotKey->m_Actions[ 0 ];
wxString msg = wxString::Format( _( "\"%s\" is already assigned to \"%s\" in section \"%s\". "
wxString msg = wxString::Format( _( "'%s' is already assigned to '%s' in section '%s'. "
"Are you sure you want to change its assignment?" ),
KeyNameFromKeyCode( aKey ),
conflictingAction->GetLabel(),

View File

@ -48,7 +48,7 @@ DIALOG_CONFIG_EQUFILES::DIALOG_CONFIG_EQUFILES( CVPCB_MAINFRAME* aParent ) :
m_Parent = aParent;
PROJECT& prj = Prj();
SetTitle( wxString::Format( _( "Project file: \"%s\"" ), prj.GetProjectFullName() ) );
SetTitle( wxString::Format( _( "Project file: '%s'" ), prj.GetProjectFullName() ) );
Init( );

View File

@ -397,7 +397,7 @@ FOOTPRINT* DISPLAY_FOOTPRINTS_FRAME::GetFootprint( const wxString& aFootprintNam
if( fpid.Parse( aFootprintName ) >= 0 )
{
aReporter.Report( wxString::Format( _( "Footprint ID \"%s\" is not valid." ),
aReporter.Report( wxString::Format( _( "Footprint ID '%s' is not valid." ),
aFootprintName ),
RPT_SEVERITY_ERROR );
return NULL;
@ -412,7 +412,7 @@ FOOTPRINT* DISPLAY_FOOTPRINTS_FRAME::GetFootprint( const wxString& aFootprintNam
// See if the library requested is in the library table
if( !fpTable->HasLibrary( libNickname ) )
{
aReporter.Report( wxString::Format( _( "Library \"%s\" is not in the footprint library table." ),
aReporter.Report( wxString::Format( _( "Library '%s' is not in the footprint library table." ),
libNickname ),
RPT_SEVERITY_ERROR );
return NULL;
@ -421,7 +421,7 @@ FOOTPRINT* DISPLAY_FOOTPRINTS_FRAME::GetFootprint( const wxString& aFootprintNam
// See if the footprint requested is in the library
if( !fpTable->FootprintExists( libNickname, fpName ) )
{
aReporter.Report( wxString::Format( _( "Footprint \"%s\" not found." ), aFootprintName ),
aReporter.Report( wxString::Format( _( "Footprint '%s' not found." ), aFootprintName ),
RPT_SEVERITY_ERROR );
return NULL;
}
@ -446,7 +446,7 @@ FOOTPRINT* DISPLAY_FOOTPRINTS_FRAME::GetFootprint( const wxString& aFootprintNam
return footprint;
}
aReporter.Report( wxString::Format( _( "Footprint \"%s\" not found." ), aFootprintName ),
aReporter.Report( wxString::Format( _( "Footprint '%s' not found." ), aFootprintName ),
RPT_SEVERITY_ERROR );
return NULL;
}

View File

@ -141,19 +141,17 @@ bool CVPCB_MAINFRAME::ReadNetListAndFpFiles( const std::string& aNetlist )
break;
case 1:
msg += wxString::Format( _(
"Component \"%s\" footprint \"%s\" was <b>not found</b> in any library.\n" ),
component->GetReference(),
component->GetFPID().GetLibItemName().wx_str()
);
msg += wxString::Format( _( "Component '%s' footprint '%s' <b>not "
"found</b> in any library.\n" ),
component->GetReference(),
component->GetFPID().GetLibItemName().wx_str() );
break;
case 2:
msg += wxString::Format( _(
"Component \"%s\" footprint \"%s\" was found in <b>multiple</b> libraries.\n" ),
component->GetReference(),
component->GetFPID().GetLibItemName().wx_str()
);
msg += wxString::Format( _( "Component '%s' footprint '%s' was found "
"in <b>multiple</b> libraries.\n" ),
component->GetReference(),
component->GetFPID().GetLibItemName().wx_str() );
break;
}
}

View File

@ -204,8 +204,8 @@ int CVPCB_ASSOCIATION_TOOL::Associate( const TOOL_EVENT& aEvent )
// Test for validity of the requested footprint
if( !fpid.IsValid() )
{
wxString msg =
wxString::Format( _( "\"%s\" is not a valid footprint." ), fpid.Format().wx_str() );
wxString msg = wxString::Format( _( "'%s' is not a valid footprint." ),
fpid.Format().wx_str() );
DisplayErrorMessage( m_frame, msg );
}

View File

@ -388,7 +388,7 @@ void DIALOG_BOM::OnAddGenerator( wxCommandEvent& event )
// Verify if it does not exists
if( pluginExists( name ) )
{
wxMessageBox( wxString::Format( _( "Nickname \"%s\" already in use." ), name ) );
wxMessageBox( wxString::Format( _( "Nickname '%s' already in use." ), name ) );
return;
}

View File

@ -435,7 +435,7 @@ wxFileName DIALOG_PLOT_SCHEMATIC::createPlotFileName( const wxString& aPlotFileN
if( !EnsureFileDirectoryExists( &tmp, retv.GetFullName(), aReporter )
|| !tmp.IsDirWritable() )
{
wxString msg = wxString::Format( _( "Could not write plot files to folder \"%s\"." ),
wxString msg = wxString::Format( _( "Failed to write plot files to folder '%s'." ),
tmp.GetPath() );
aReporter->Report( msg, RPT_SEVERITY_ERROR );
retv.Clear();
@ -510,18 +510,18 @@ void DIALOG_PLOT_SCHEMATIC::createDxfFile( bool aPlotAll, bool aPlotDrawingSheet
if( plotOneSheetDxf( plotFileName.GetFullPath(), screen, aRenderSettings,
plot_offset, 1.0, aPlotDrawingSheet ) )
{
msg.Printf( _( "Plotted to '%s'.\n" ), plotFileName.GetFullPath() );
msg.Printf( _( "Plotted to '%s'." ), plotFileName.GetFullPath() );
reporter.Report( msg, RPT_SEVERITY_ACTION );
}
else // Error
{
msg.Printf( _( "Unable to create file '%s'.\n" ), plotFileName.GetFullPath() );
msg.Printf( _( "Failed to create file '%s'." ), plotFileName.GetFullPath() );
reporter.Report( msg, RPT_SEVERITY_ERROR );
}
}
catch( IO_ERROR& e )
{
msg.Printf( wxT( "DXF Plotter exception: %s\n"), e.What() );
msg.Printf( wxT( "DXF Plotter exception: %s"), e.What() );
reporter.Report( msg, RPT_SEVERITY_ERROR );
schframe->SetCurrentSheet( oldsheetpath );
schframe->GetCurrentSheet().UpdateAllScreenReferences();
@ -680,18 +680,18 @@ void DIALOG_PLOT_SCHEMATIC::createHPGLFile( bool aPlotAll, bool aPlotFrameRef,
if( plotOneSheetHpgl( plotFileName.GetFullPath(), screen, plotPage, aRenderSettings,
plotOffset, plot_scale, aPlotFrameRef, getPlotOriginAndUnits() ) )
{
msg.Printf( _( "Plotted to '%s'.\n" ), plotFileName.GetFullPath() );
msg.Printf( _( "Plotted to '%s'." ), plotFileName.GetFullPath() );
reporter.Report( msg, RPT_SEVERITY_ACTION );
}
else
{
msg.Printf( _( "Unable to create file '%s'.\n" ), plotFileName.GetFullPath() );
msg.Printf( _( "Failed to create file '%s'." ), plotFileName.GetFullPath() );
reporter.Report( msg, RPT_SEVERITY_ERROR );
}
}
catch( IO_ERROR& e )
{
msg.Printf( wxT( "HPGL Plotter exception: %s\n"), e.What() );
msg.Printf( wxT( "HPGL Plotter exception: %s"), e.What() );
reporter.Report( msg, RPT_SEVERITY_ERROR );
}
@ -837,8 +837,7 @@ void DIALOG_PLOT_SCHEMATIC::createPDFFile( bool aPlotAll, bool aPlotDrawingSheet
if( !plotter->OpenFile( plotFileName.GetFullPath() ) )
{
msg.Printf( _( "Unable to create file '%s'.\n" ),
plotFileName.GetFullPath() );
msg.Printf( _( "Failed to create file '%s'." ), plotFileName.GetFullPath() );
reporter.Report( msg, RPT_SEVERITY_ERROR );
delete plotter;
return;
@ -851,7 +850,7 @@ void DIALOG_PLOT_SCHEMATIC::createPDFFile( bool aPlotAll, bool aPlotDrawingSheet
catch( const IO_ERROR& e )
{
// Cannot plot PDF file
msg.Printf( wxT( "PDF Plotter exception: %s\n" ), e.What() );
msg.Printf( wxT( "PDF Plotter exception: %s" ), e.What() );
reporter.Report( msg, RPT_SEVERITY_ERROR );
restoreEnvironment( plotter, oldsheetpath );
@ -1034,20 +1033,20 @@ void DIALOG_PLOT_SCHEMATIC::createPSFile( bool aPlotAll, bool aPlotFrameRef,
if( plotOneSheetPS( plotFileName.GetFullPath(), screen, aRenderSettings, plotPage,
plot_offset, scale, aPlotFrameRef ) )
{
msg.Printf( _( "Plotted to '%s'.\n" ), plotFileName.GetFullPath() );
msg.Printf( _( "Plotted to '%s'." ), plotFileName.GetFullPath() );
reporter.Report( msg, RPT_SEVERITY_ACTION );
}
else
{
// Error
msg.Printf( _( "Unable to create file '%s'.\n" ), plotFileName.GetFullPath() );
msg.Printf( _( "Failed to create file '%s'." ), plotFileName.GetFullPath() );
reporter.Report( msg, RPT_SEVERITY_ERROR );
}
}
catch( IO_ERROR& e )
{
msg.Printf( wxT( "PS Plotter exception: %s\n"), e.What() );
msg.Printf( wxT( "PS Plotter exception: %s"), e.What() );
reporter.Report( msg, RPT_SEVERITY_ERROR );
}
}
@ -1160,19 +1159,19 @@ void DIALOG_PLOT_SCHEMATIC::createSVGFile( bool aPrintAll, bool aPrintFrameRef,
if( !success )
{
msg.Printf( _( "Cannot create file '%s'.\n" ), plotFileName.GetFullPath() );
msg.Printf( _( "Failed to create file '%s'." ), plotFileName.GetFullPath() );
reporter.Report( msg, RPT_SEVERITY_ERROR );
}
else
{
msg.Printf( _( "Plotted to '%s'.\n" ), plotFileName.GetFullPath() );
msg.Printf( _( "Plotted to '%s'." ), plotFileName.GetFullPath() );
reporter.Report( msg, RPT_SEVERITY_ACTION );
}
}
catch( const IO_ERROR& e )
{
// Cannot plot SVG file
msg.Printf( wxT( "SVG Plotter exception: %s\n" ), e.What() );
msg.Printf( wxT( "SVG Plotter exception: %s" ), e.What() );
reporter.Report( msg, RPT_SEVERITY_ERROR );
break;
}

View File

@ -55,8 +55,8 @@ DIALOG_SYMBOL_REMAP::DIALOG_SYMBOL_REMAP( SCH_EDIT_FRAME* aParent ) :
if( !wxFileName::IsDirWritable( Prj().GetProjectPath() ) )
{
DisplayInfoMessage( this, _( "Remapping is not possible because you do not have "
"write privileges to the project folder \"%s\"." ) );
DisplayInfoMessage( this, _( "Remapping is not possible because you have insufficient "
"privileges to the project folder '%s'." ) );
// Disable the remap button.
m_remapped = true;

View File

@ -436,11 +436,10 @@ bool PANEL_SYM_LIB_TABLE::verifyTables()
}
catch( const IO_ERROR& ioe )
{
msg = wxString::Format( _( "Symbol library \"%s\" failed to load.\n %s" ),
row.GetNickName(),
ioe.What() );
msg.Printf( _( "Symbol library '%s' failed to load." ), row.GetNickName() );
wxMessageDialog errdlg( this, msg, _( "Error Loading Library" ) );
wxMessageDialog errdlg( this, msg + wxS( "\n" ) + ioe.What(),
_( "Error Loading Library" ) );
errdlg.ShowModal();
return false;

View File

@ -649,7 +649,7 @@ bool SCH_EDIT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
if( sheetlist.IsModified() )
{
wxFileName fileName = Schematic().RootScreen()->GetFileName();
wxString msg = _( "Save changes to \"%s\" before closing?" );
wxString msg = _( "Save changes to '%s' before closing?" );
if( !HandleUnsavedChanges( this, wxString::Format( msg, fileName.GetFullName() ),
[&]()->bool { return SaveProject(); } ) )

View File

@ -2246,9 +2246,8 @@ void SCH_SEXPR_PLUGIN::CreateSymbolLib( const wxString& aLibraryPath,
{
if( wxFileExists( aLibraryPath ) )
{
THROW_IO_ERROR( wxString::Format(
_( "symbol library \"%s\" already exists, cannot create a new library" ),
aLibraryPath.GetData() ) );
THROW_IO_ERROR( wxString::Format( _( "Symbol library '%s' already exists." ),
aLibraryPath.GetData() ) );
}
LOCALE_IO toggle;
@ -2273,7 +2272,7 @@ bool SCH_SEXPR_PLUGIN::DeleteSymbolLib( const wxString& aLibraryPath,
// we don't want that. we want bare metal portability with no UI here.
if( wxRemove( aLibraryPath ) )
{
THROW_IO_ERROR( wxString::Format( _( "library \"%s\" cannot be deleted" ),
THROW_IO_ERROR( wxString::Format( _( "Symbol library '%s' cannot be deleted." ),
aLibraryPath.GetData() ) );
}

View File

@ -868,8 +868,8 @@ void SCH_LEGACY_PLUGIN::loadHeader( LINE_READER& aReader, SCH_SCREEN* aScreen )
if( !line || !strCompare( "Eeschema Schematic File Version", line, &line ) )
{
m_error.Printf(
_( "\"%s\" does not appear to be an Eeschema file" ), aScreen->GetFileName() );
m_error.Printf( _( "'%s' does not appear to be an Eeschema file." ),
aScreen->GetFileName() );
THROW_IO_ERROR( m_error );
}
@ -4396,9 +4396,8 @@ void SCH_LEGACY_PLUGIN::CreateSymbolLib( const wxString& aLibraryPath,
{
if( wxFileExists( aLibraryPath ) )
{
THROW_IO_ERROR( wxString::Format(
_( "symbol library \"%s\" already exists, cannot create a new library" ),
aLibraryPath.GetData() ) );
THROW_IO_ERROR( wxString::Format( _( "Symbol library '%s' already exists." ),
aLibraryPath.GetData() ) );
}
LOCALE_IO toggle;
@ -4423,7 +4422,7 @@ bool SCH_LEGACY_PLUGIN::DeleteSymbolLib( const wxString& aLibraryPath,
// we don't want that. we want bare metal portability with no UI here.
if( wxRemove( aLibraryPath ) )
{
THROW_IO_ERROR( wxString::Format( _( "library \"%s\" cannot be deleted" ),
THROW_IO_ERROR( wxString::Format( _( "Symbol library '%s' cannot be deleted." ),
aLibraryPath.GetData() ) );
}

View File

@ -61,8 +61,8 @@ bool SCH_EDIT_FRAME::CheckSheetForRecursion( SCH_SHEET* aSheet, SCH_SHEET_PATH*
if( hierarchy.TestForRecursion( sheetHierarchy, destFile.GetFullPath() ) )
{
msg.Printf( _( "The sheet changes cannot be made because the destination sheet already "
"has the sheet \"%s\" or one of it's subsheets as a parent somewhere in "
"the schematic hierarchy." ),
"has the sheet '%s' or one of its subsheets as a parent somewhere in the "
"schematic hierarchy." ),
destFile.GetFullPath() );
DisplayError( this, msg );
return true;

View File

@ -320,7 +320,7 @@ bool SYMBOL_EDIT_FRAME::LoadOneLibrarySymbolAux( LIB_SYMBOL* aEntry, const wxStr
if( aEntry->GetName().IsEmpty() )
{
wxLogWarning( "Symbol in library \"%s\" has empty name field.", aLibrary );
wxLogWarning( "Symbol in library '%s' has empty name field.", aLibrary );
return false;
}
@ -418,8 +418,9 @@ void SYMBOL_EDIT_FRAME::CreateNewSymbol()
// Test if there is a symbol with this name already.
if( !lib.empty() && m_libMgr->SymbolExists( name, lib ) )
{
wxString msg = wxString::Format( _( "Symbol \"%s\" already exists in library \"%s\"" ),
name, lib );
wxString msg = wxString::Format( _( "Symbol '%s' already exists in library '%s'." ),
name,
lib );
DisplayError( this, msg );
return;
}
@ -730,9 +731,9 @@ void SYMBOL_EDIT_FRAME::DeleteSymbolFromLibrary()
LIB_ID libId = GetTargetLibId();
if( m_libMgr->IsSymbolModified( libId.GetLibItemName(), libId.GetLibNickname() )
&& !IsOK( this, _( wxString::Format( "The symbol \"%s\" has been modified\n"
"Do you want to remove it from the library?",
libId.GetUniStringLibItemName() ) ) ) )
&& !IsOK( this, wxString::Format( _( "The symbol '%s' has been modified.\n"
"Do you want to remove it from the library?" ),
libId.GetUniStringLibItemName() ) ) )
{
return;
}
@ -743,7 +744,7 @@ void SYMBOL_EDIT_FRAME::DeleteSymbolFromLibrary()
msg.Printf( _( "The symbol %s is used to derive other symbols.\n"
"Deleting this symbol will delete all of the symbols derived from it.\n\n"
"Do you wish to delete this symbol and all of it's derivatives?" ),
"Do you wish to delete this symbol and all of its derivatives?" ),
libId.GetLibItemName().wx_str() );
wxMessageDialog::ButtonLabel yesButtonLabel( _( "Delete Symbol" ) );
@ -890,7 +891,7 @@ void SYMBOL_EDIT_FRAME::Revert( bool aConfirm )
// Empty if this is the library itself that is selected.
const wxString& symbolName = libId.GetLibItemName();
wxString msg = wxString::Format( _( "Revert \"%s\" to last version saved?" ),
wxString msg = wxString::Format( _( "Revert '%s' to last version saved?" ),
symbolName.IsEmpty() ? libName : symbolName );
if( aConfirm && !ConfirmRevertDialog( this, msg ) )
@ -1006,7 +1007,7 @@ bool SYMBOL_EDIT_FRAME::saveLibrary( const wxString& aLibrary, bool aNewFile )
wxString wildcards = KiCadSymbolLibFileWildcard();
wxFileDialog dlg( this, wxString::Format( _( "Save Library \"%s\" As..." ), aLibrary ),
wxFileDialog dlg( this, wxString::Format( _( "Save Library '%s' As..." ), aLibrary ),
default_path, fn.GetFullName(), wildcards,
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );

View File

@ -172,8 +172,8 @@ SYMBOL_LIB_TABLE_ROW* SYMBOL_LIBRARY_MANAGER::GetLibrary( const wxString& aLibra
}
catch( const IO_ERROR& e )
{
wxLogMessage( _( "Cannot find library \"%s\" in the Symbol Library Table (%s)" ),
aLibrary, e.What() );
wxLogMessage( _( "Library '%s' not found in the Symbol Library Table." ) + e.What(),
aLibrary );
}
return row;
@ -615,8 +615,9 @@ LIB_SYMBOL* SYMBOL_LIBRARY_MANAGER::GetAlias( const wxString& aAlias,
}
catch( const IO_ERROR& e )
{
wxLogMessage( _( "Cannot load symbol \"%s\" from library \"%s\" (%s)" ),
aAlias, aLibrary, e.What() );
wxLogMessage( _( "Cannot load symbol '%s' from library '%s'." ) + e.What(),
aAlias,
aLibrary );
}
return alias;
@ -770,7 +771,7 @@ std::set<LIB_SYMBOL*> SYMBOL_LIBRARY_MANAGER::getOriginalSymbols( const wxString
}
catch( const IO_ERROR& e )
{
wxLogMessage( _( "Cannot enumerate library \"%s\" (%s)" ), aLibrary, e.What() );
wxLogMessage( _( "Cannot enumerate library '%s'." ) + e.What(), aLibrary );
}
return symbols;

View File

@ -547,11 +547,9 @@ void SYMBOL_LIBS::LoadAllLibraries( PROJECT* aProject, bool aShowProgress )
catch( const IO_ERROR& ioe )
{
wxString msg;
msg.Printf( _( "Symbol library '%s' failed to load. Error:\n %s" ),
filename,
ioe.What() );
msg.Printf( _( "Symbol library '%s' failed to load." ), filename );
wxLogError( msg );
wxLogError( msg + wxS( "\n" ) + ioe.What() );
}
}
}

View File

@ -230,7 +230,7 @@ int SCH_EDITOR_CONTROL::ImportFPAssignments( const TOOL_EVENT& aEvent )
if( !processCmpToFootprintLinkFile( filename, forceVisibility, visibilityState ) )
{
wxString msg = wxString::Format( _( "Failed to open symbol-footprint link file \"%s\"" ),
wxString msg = wxString::Format( _( "Failed to open symbol-footprint link file '%s'." ),
filename.GetData() );
DisplayError( m_frame, msg );

View File

@ -513,7 +513,7 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent )
if( !image || !image->ReadImageFile( fullFilename ) )
{
wxMessageBox( _( "Couldn't load image from \"%s\"" ), fullFilename );
wxMessageBox( _( "Could not load image from '%s'." ), fullFilename );
delete image;
image = nullptr;
continue;

View File

@ -1537,7 +1537,7 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent )
if( hierarchy.TestForRecursion( sheetHierarchy, destFn.GetFullPath( wxPATH_UNIX ) ) )
{
auto msg = wxString::Format( _( "The pasted sheet \"%s\"\n"
auto msg = wxString::Format( _( "The pasted sheet '%s'\n"
"was dropped because the destination already has "
"the sheet or one of its subsheets as a parent." ),
sheet->GetFileName() );

View File

@ -405,7 +405,7 @@ int SYMBOL_EDITOR_CONTROL::ExportView( const TOOL_EVENT& aEvent )
if( !SaveCanvasImageToFile( editFrame, dlg.GetPath(), BITMAP_TYPE::PNG ) )
{
wxMessageBox( wxString::Format( _( "Can't save file \"%s\"." ), dlg.GetPath() ) );
wxMessageBox( wxString::Format( _( "Can't save file '%s'." ), dlg.GetPath() ) );
}
}

View File

@ -65,7 +65,7 @@ bool GBR_TO_PCB_EXPORTER::ExportPcb( const LAYER_NUM* aLayerLookUpTable, int aCo
if( m_fp == NULL )
{
wxString msg;
msg.Printf( _( "Cannot create file '%s'." ), m_pcb_file_name );
msg.Printf( _( "Failed to create file '%s'." ), m_pcb_file_name );
DisplayError( m_gerbview_frame, msg );
return false;
}

View File

@ -372,7 +372,7 @@ bool PL_EDITOR_FRAME::canCloseWindow( wxCloseEvent& aEvent )
if( IsContentModified() )
{
wxFileName filename = GetCurrentFileName();
wxString msg = _( "Save changes to \"%s\" before closing?" );
wxString msg = _( "Save changes to '%s' before closing?" );
if( !HandleUnsavedChanges( this, wxString::Format( msg, filename.GetFullName() ),
[&]() -> bool
@ -852,7 +852,7 @@ DS_DATA_ITEM* PL_EDITOR_FRAME::AddDrawingSheetItem( int aType )
if( !wxFileExists( fullFilename ) )
{
wxMessageBox( _( "Couldn't load image from \"%s\"" ), fullFilename );
wxMessageBox( _( "Could not load image from '%s'." ), fullFilename );
break;
}
@ -860,7 +860,7 @@ DS_DATA_ITEM* PL_EDITOR_FRAME::AddDrawingSheetItem( int aType )
if( !image->ReadImageFile( fullFilename ) )
{
wxMessageBox( _( "Couldn't load image from \"%s\"" ), fullFilename );
wxMessageBox( _( "Could not load image from '%s'." ), fullFilename );
delete image;
break;
}

View File

@ -161,7 +161,7 @@ void PCB_CALCULATOR_FRAME::OnDataFileSelection( wxCommandEvent& event )
else
{
wxString msg;
msg.Printf( _("Unable to read data file \"%s\""), fullfilename );
msg.Printf( _("Unable to read data file '%s'."), fullfilename );
wxMessageBox( msg );
}
}

View File

@ -99,7 +99,7 @@ void PCB_EDIT_FRAME::RecreateBOMFileFromBoard( wxCommandEvent& aEvent )
if( fp_bom == NULL )
{
msg.Printf( _( "Unable to create file '%s'." ), fn.GetFullPath() );
msg.Printf( _( "Failed to create file '%s'." ), fn.GetFullPath() );
DisplayError( this, msg );
return;
}

View File

@ -642,7 +642,7 @@ void DIALOG_BOARD_STATISTICS::saveReportClicked( wxCommandEvent& aEvent )
if( outFile == NULL )
{
msg.Printf( _( "Unable to create file '%s'." ), saveFileDialog.GetPath() );
msg.Printf( _( "Failed to create file '%s'." ), saveFileDialog.GetPath() );
DisplayErrorMessage( this, msg );
return;
}

View File

@ -251,8 +251,8 @@ void PCB_EDIT_FRAME::OnExportVRML( wxCommandEvent& event )
{
if( !modelPath.Mkdir() )
{
wxString msg = wxString::Format(
_( "Unable to create directory \"%s\"" ), modelPath.GetPath() );
wxString msg = wxString::Format( _( "Failed to create folder '%s'." ),
modelPath.GetPath() );
DisplayErrorMessage( this, msg );
return;
}
@ -261,7 +261,7 @@ void PCB_EDIT_FRAME::OnExportVRML( wxCommandEvent& event )
if( !ExportVRML_File( path, scale, export3DFiles, useRelativePaths,
modelPath.GetPath(), aXRef, aYRef ) )
{
wxString msg = wxString::Format( _( "Unable to create file \"%s\"" ), path );
wxString msg = wxString::Format( _( "Failed to create file '%s'." ), path );
DisplayErrorMessage( this, msg );
return;
}

View File

@ -334,7 +334,7 @@ void DIALOG_FIND::search( bool aDirection )
if( m_hitList.empty() )
{
m_frame->SetStatusText( wxEmptyString );
msg.Printf( _( "\"%s\" not found" ), searchString );
msg.Printf( _( "'%s' not found" ), searchString );
m_frame->ShowInfoBarMsg( msg );
m_status->SetLabel( msg );
@ -351,11 +351,12 @@ void DIALOG_FIND::search( bool aDirection )
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectItem, true, *m_it );
m_frame->FocusOnLocation( ( *m_it )->GetPosition() );
msg.Printf( _( "\"%s\" found" ), searchString );
msg.Printf( _( "'%s' found" ), searchString );
m_frame->SetStatusText( msg );
msg.Printf( _( "Hit(s): %ld / %lu" ), std::distance( m_hitList.begin(), m_it ) + 1,
m_hitList.size() );
msg.Printf( _( "Hit(s): %ld / %lu" ),
std::distance( m_hitList.begin(), m_it ) + 1,
m_hitList.size() );
m_status->SetLabel( msg );
}

View File

@ -56,11 +56,10 @@ bool DIALOG_GLOBAL_FP_LIB_TABLE_CONFIG::TransferDataFromWindow()
}
catch( const IO_ERROR& ioe )
{
DisplayError( this,
wxString::Format( _( "Error occurred writing empty footprint library "
"table file.\n\n%s" ),
FP_LIB_TABLE::GetGlobalTableFileName(),
ioe.What() ) );
DisplayError( this, wxString::Format( _( "Error occurred writing empty footprint "
"library table '%s'." ),
FP_LIB_TABLE::GetGlobalTableFileName() )
+ wxS( "\n" ) + ioe.What() );
return false;
}
@ -80,8 +79,7 @@ bool DIALOG_GLOBAL_FP_LIB_TABLE_CONFIG::TransferDataFromWindow()
// Make sure the footprint library table to copy actually exists.
if( !fn.FileExists() )
{
DisplayError( this,
wxString::Format( _( "File \"%s\" not found." ), fn.GetFullPath() ) );
DisplayError( this, wxString::Format( _( "File '%s' not found." ), fn.GetFullPath() ) );
return false;
}
@ -94,9 +92,9 @@ bool DIALOG_GLOBAL_FP_LIB_TABLE_CONFIG::TransferDataFromWindow()
}
catch( const IO_ERROR& ioe )
{
DisplayError( this,
wxString::Format( _( "File \"%s\" is not a valid footprint library table "
"file.\n\n%s" ), fn.GetFullPath(), ioe.What() ) );
DisplayError( this, wxString::Format( _( "'%s' is not a valid footprint library table." ),
fn.GetFullPath() )
+ wxS( "\n" ) + ioe.What() );
return false;
}
@ -105,19 +103,20 @@ bool DIALOG_GLOBAL_FP_LIB_TABLE_CONFIG::TransferDataFromWindow()
if( !fpTableFileName.DirExists() && !fpTableFileName.Mkdir( 0x777, wxPATH_MKDIR_FULL ) )
{
DisplayError( this,
wxString::Format( _( "Cannot create global library table path \"%s\"." ),
fpTableFileName.GetPath() ) );
DisplayError( this, wxString::Format( _( "Cannot create library table path '%s'." ),
fpTableFileName.GetPath() ) );
return false;
}
// Copy the global footprint library table file to the user config.
if( !::wxCopyFile( fn.GetFullPath(), fpTableFileName.GetFullPath() ) )
{
DisplayError( this,
wxString::Format( _( "Cannot copy global footprint library table "
"file:\n\n \"%s\"\n\n:to:\n\n\"%s\"." ),
fn.GetFullPath(), fpTableFileName.GetFullPath() ) );
DisplayError( this, wxString::Format( _( "Cannot copy footprint library table from:\n"
"%s\n"
"to:\n"
"%s." ),
fn.GetFullPath(),
fpTableFileName.GetFullPath() ) );
return false;
}
@ -131,9 +130,8 @@ bool DIALOG_GLOBAL_FP_LIB_TABLE_CONFIG::TransferDataFromWindow()
}
catch( const IO_ERROR& ioe )
{
DisplayError( this, wxString::Format( _( "Error loading global footprint library table."
"\n\n%s" ),
ioe.What() ) );
DisplayError( this, _( "Error loading footprint library table." )
+ wxS( "\n" ) + ioe.What() );
return false;
}

View File

@ -909,7 +909,7 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
}
else
{
msg.Printf( _( "Unable to create file '%s'." ), fn.GetFullPath() );
msg.Printf( _( "Failed to create file '%s'." ), fn.GetFullPath() );
reporter.Report( msg, RPT_SEVERITY_ERROR );
}

View File

@ -656,7 +656,7 @@ bool PANEL_SETUP_LAYERS::testLayerNames()
if( hasOneOf( name, badchars ) )
{
auto msg = wxString::Format(_( "\"%s\" are forbidden in layer names." ), badchars );
wxString msg = wxString::Format(_( "%s are forbidden in layer names." ), badchars );
m_parentDialog->SetError( msg, this, ctl );
return false;
}
@ -671,7 +671,7 @@ bool PANEL_SETUP_LAYERS::testLayerNames()
{
if( name == existingName )
{
auto msg = wxString::Format(_( "Layer name \"%s\" is already in use." ), name );
wxString msg = wxString::Format(_( "Layer name '%s' already in use." ), name );
m_parentDialog->SetError( msg, this, ctl );
return false;
}

View File

@ -80,6 +80,6 @@ void PCB_EDIT_FRAME::RecreateCmpFileFromBoard( wxCommandEvent& aEvent )
wxString path = dlg.GetPath();
if( !RecreateCmpFile( GetBoard(), path ) )
DisplayError( this, wxString::Format( _( "Could not create file '%s'." ), path ) );
DisplayError( this, wxString::Format( _( "Failed to create file '%s'." ), path ) );
}

View File

@ -290,7 +290,7 @@ bool DIALOG_GEN_FOOTPRINT_POSITION::CreateGerberFiles()
if( fpcount < 0 )
{
msg.Printf( _( "Unable to create file '%s'." ), filename );
msg.Printf( _( "Failed to create file '%s'." ), filename );
m_reporter->Report( msg, RPT_SEVERITY_ERROR );
wxMessageBox( msg );
return false;
@ -427,7 +427,7 @@ bool DIALOG_GEN_FOOTPRINT_POSITION::CreateAsciiFiles()
if( fpcount < 0 )
{
msg.Printf( _( "Unable to create file '%s'." ), fn.GetFullPath() );
msg.Printf( _( "Failed to create file '%s'." ), fn.GetFullPath() );
m_reporter->Report( msg, RPT_SEVERITY_ERROR );
wxMessageBox( msg );
return false;

View File

@ -121,7 +121,7 @@ void EXCELLON_WRITER::CreateDrillandMapFilesSet( const wxString& aPlotDirectory,
{
if( aReporter )
{
msg.Printf( _( "Create file %s\n" ), fullFilename );
msg.Printf( _( "Created file '%s'" ), fullFilename );
aReporter->Report( msg );
}
}

View File

@ -351,7 +351,7 @@ void GENDRILL_WRITER_BASE::CreateMapFilesSet( const wxString& aPlotDirectory,
{
if( aReporter )
{
msg.Printf( _( "Create file %s\n" ), fullfilename );
msg.Printf( _( "Created file '%s'." ), fullfilename );
aReporter->Report( msg );
}
}

View File

@ -110,7 +110,7 @@ void GERBER_WRITER::CreateDrillandMapFilesSet( const wxString& aPlotDirectory, b
{
if( aReporter )
{
msg.Printf( _( "Create file %s\n" ), fullFilename );
msg.Printf( _( "Created file '%s'." ), fullFilename );
aReporter->Report( msg );
}
}

View File

@ -246,7 +246,7 @@ FOOTPRINT* FOOTPRINT_EDIT_FRAME::ImportFootprint( const wxString& aName )
if( !fp )
{
wxString msg = wxString::Format( _( "File \"%s\" not found" ), fn.GetFullPath() );
wxString msg = wxString::Format( _( "File '%s' not found." ), fn.GetFullPath() );
DisplayError( this, msg );
return nullptr;
}
@ -258,7 +258,7 @@ FOOTPRINT* FOOTPRINT_EDIT_FRAME::ImportFootprint( const wxString& aName )
if( fileType == IO_MGR::FILE_TYPE_NONE )
{
DisplayError( this, _( "Not a footprint file" ) );
DisplayError( this, _( "Not a footprint file." ) );
return nullptr;
}
@ -1062,7 +1062,7 @@ bool FOOTPRINT_EDIT_FRAME::RevertFootprint()
{
if( GetScreen()->IsContentModified() && m_revertModule )
{
wxString msg = wxString::Format( _( "Revert \"%s\" to last version saved?" ),
wxString msg = wxString::Format( _( "Revert '%s' to last version saved?" ),
GetLoadedFPID().GetLibItemName().wx_str() );
if( ConfirmRevertDialog( this, msg ) )

View File

@ -428,7 +428,7 @@ bool FOOTPRINT_EDIT_FRAME::SaveLibraryAs( const wxString& aLibraryPath )
const FOOTPRINT* footprint = cur->GetEnumeratedFootprint( curLibPath, footprints[i] );
dst->FootprintSave( dstLibPath, footprint );
msg = wxString::Format( _( "Footprint \"%s\" saved" ), footprints[i] );
msg = wxString::Format( _( "Footprint '%s' saved." ), footprints[i] );
SetStatusText( msg );
}
}
@ -438,7 +438,7 @@ bool FOOTPRINT_EDIT_FRAME::SaveLibraryAs( const wxString& aLibraryPath )
return false;
}
msg = wxString::Format( _( "Footprint library \"%s\" saved as \"%s\"." ),
msg = wxString::Format( _( "Footprint library '%s' saved as '%s'." ),
curLibPath,
dstLibPath );

View File

@ -435,7 +435,7 @@ void KICAD_NETLIST_PARSER::parseComponent()
if( !footprint.IsEmpty() && fpid.Parse( footprint, true ) >= 0 )
{
wxString error;
error.Printf( _( "Invalid footprint ID in\nfile: \"%s\"\nline: %d\noffset: %d" ),
error.Printf( _( "Invalid footprint ID in\nfile: '%s'\nline: %d\noffset: %d" ),
CurSource(), CurLineNumber(), CurOffset() );
THROW_IO_ERROR( error );

View File

@ -1485,7 +1485,7 @@ void PCB_EDIT_FRAME::RunEeschema()
}
catch( const IO_ERROR& err )
{
wxMessageBox( _( "Eeschema failed to load:\n" ) + err.What(),
wxMessageBox( _( "Eeschema failed to load." ) + wxS( "\n" ) + err.What(),
_( "KiCad Error" ), wxOK | wxICON_ERROR, this );
return;
}

View File

@ -305,7 +305,7 @@ wxString PCB_GROUP::GetSelectMenuText( EDA_UNITS aUnits ) const
m_items.size() );
}
return wxString::Format( _( "Group \"%s\", %zu members" ),
return wxString::Format( _( "Group '%s', %zu members" ),
m_name,
m_items.size() );
}

View File

@ -860,7 +860,7 @@ void ALTIUM_PCB::ParseClasses6Data( const CFB::CompoundFileReader& aReader,
{
// Name conflict, this is likely a bad board file.
// unique_ptr will delete nc on this code path
THROW_IO_ERROR( wxString::Format( _( "Duplicated Netclass name \"%s\"" ), elem.name ) );
THROW_IO_ERROR( wxString::Format( _( "Duplicate netclass name '%s'." ), elem.name ) );
}
}
}
@ -1281,7 +1281,7 @@ void ALTIUM_PCB::ParseModelsData( const CFB::CompoundFileReader& aReader,
{
if( !altiumModelsPath.Mkdir() )
{
wxLogError( _( "Cannot create directory '%s'. No 3D-models will be imported." ),
wxLogError( _( "Failed to create folder '%s'." ) + _( "No 3D-models will be imported." ),
altiumModelsPath.GetFullPath() );
return;
}

View File

@ -1039,8 +1039,9 @@ void EAGLE_PLUGIN::loadLibrary( wxXmlNode* aLib, const wxString* aLibName )
wxString lib = aLibName ? *aLibName : m_lib_path;
const wxString& pkg = pack_ref;
wxString emsg = wxString::Format(
_( "<package> name: \"%s\" duplicated in eagle <library>: \"%s\"" ), pkg, lib );
wxString emsg = wxString::Format( _( "<package> '%s' duplicated in <library> '%s'" ),
pkg,
lib );
THROW_IO_ERROR( emsg );
}
@ -2871,8 +2872,10 @@ void EAGLE_PLUGIN::cacheLib( const wxString& aLibPath )
wxXmlDocument xmlDocument;
if( !stream.IsOk() || !xmlDocument.Load( stream ) )
THROW_IO_ERROR( wxString::Format( _( "Unable to read file \"%s\"" ),
{
THROW_IO_ERROR( wxString::Format( _( "Unable to read file '%s'." ),
fn.GetFullPath() ) );
}
doc = xmlDocument.GetRoot();

View File

@ -88,7 +88,7 @@ static inline long parseInt( const wxString& aValue, double aScalar )
aValue.ToCDouble(&value);
if( value == std::numeric_limits<double>::max() ) // conversion really failed
{
THROW_IO_ERROR( wxString::Format( _( "Cannot convert \"%s\" to an integer" ),
THROW_IO_ERROR( wxString::Format( _( "Cannot convert '%s' to an integer." ),
aValue.GetData() ) );
return 0;
}
@ -226,7 +226,7 @@ void GPCB_FPL_CACHE::Load()
if( !dir.IsOpened() )
{
THROW_IO_ERROR( wxString::Format( _( "footprint library path \"%s\" does not exist" ),
THROW_IO_ERROR( wxString::Format( _( "Footprint library '%s' not found." ),
m_lib_path.GetPath().GetData() ) );
}
@ -280,7 +280,7 @@ void GPCB_FPL_CACHE::Remove( const wxString& aFootprintName )
if( it == m_footprints.end() )
{
THROW_IO_ERROR( wxString::Format( _( "library \"%s\" has no footprint \"%s\" to delete" ),
THROW_IO_ERROR( wxString::Format( _( "Library '%s' has no footprint '%s'." ),
m_lib_path.GetPath().GetData(),
aFootprintName.GetData() ) );
}
@ -344,7 +344,7 @@ FOOTPRINT* GPCB_FPL_CACHE::parseFOOTPRINT( LINE_READER* aLineReader )
if( parameters[0].CmpNoCase( wxT( "Element" ) ) != 0 )
{
msg.Printf( _( "unknown token \"%s\"" ), parameters[0] );
msg.Printf( _( "Unknown token '%s'" ), parameters[0] );
THROW_PARSE_ERROR( msg, aLineReader->GetSource(), (const char *)aLineReader,
aLineReader->LineNumber(), 0 );
}
@ -874,7 +874,7 @@ void GPCB_PLUGIN::FootprintEnumerate( wxArrayString& aFootprintNames, const wxSt
return;
else
{
THROW_IO_ERROR( wxString::Format( _( "footprint library path \"%s\" does not exist" ),
THROW_IO_ERROR( wxString::Format( _( "Footprint library '%s' not found." ),
aLibraryPath ) );
}
}
@ -960,7 +960,7 @@ void GPCB_PLUGIN::FootprintDelete( const wxString& aLibraryPath, const wxString&
if( !m_cache->IsWritable() )
{
THROW_IO_ERROR( wxString::Format( _( "Library \"%s\" is read only" ),
THROW_IO_ERROR( wxString::Format( _( "Library '%s' is read only." ),
aLibraryPath.GetData() ) );
}
@ -1006,8 +1006,9 @@ bool GPCB_PLUGIN::FootprintLibDelete( const wxString& aLibraryPath, const PROPER
if( tmp.GetExt() != KiCadFootprintFileExtension )
{
THROW_IO_ERROR( wxString::Format( _( "unexpected file \"%s\" was found in library path \"%s\"" ),
files[i].GetData(), aLibraryPath.GetData() ) );
THROW_IO_ERROR( wxString::Format( _( "Unexpected file '%s' found in library '%s'." ),
files[i].GetData(),
aLibraryPath.GetData() ) );
}
}
@ -1024,7 +1025,7 @@ bool GPCB_PLUGIN::FootprintLibDelete( const wxString& aLibraryPath, const PROPER
// we don't want that. we want bare metal portability with no UI here.
if( !wxRmdir( aLibraryPath ) )
{
THROW_IO_ERROR( wxString::Format( _( "footprint library \"%s\" cannot be deleted" ),
THROW_IO_ERROR( wxString::Format( _( "Footprint library '%s' cannot be deleted." ),
aLibraryPath.GetData() ) );
}

View File

@ -169,13 +169,13 @@ void FP_CACHE::Save( FOOTPRINT* aFootprint )
if( !m_lib_path.DirExists() && !m_lib_path.Mkdir() )
{
THROW_IO_ERROR( wxString::Format( _( "Cannot create footprint library path '%s'." ),
THROW_IO_ERROR( wxString::Format( _( "Cannot create footprint library '%s'." ),
m_lib_raw_path ) );
}
if( !m_lib_path.IsDirWritable() )
{
THROW_IO_ERROR( wxString::Format( _( "Footprint library path '%s' is read only." ),
THROW_IO_ERROR( wxString::Format( _( "Footprint library '%s' is read only." ),
m_lib_raw_path ) );
}
@ -239,8 +239,7 @@ void FP_CACHE::Load()
if( !dir.IsOpened() )
{
wxString msg = wxString::Format( _( "Footprint library path '%s' does not exist "
"(or is not a directory)." ),
wxString msg = wxString::Format( _( "Footprint library '%s' not found." ),
m_lib_raw_path );
THROW_IO_ERROR( msg );
}

View File

@ -2463,7 +2463,7 @@ void LEGACY_PLUGIN::loadNETCLASS()
// unique_ptr will delete nc on this code path
m_error.Printf( _( "duplicate NETCLASS name \"%s\"" ), nc->GetName().GetData() );
m_error.Printf( _( "Duplicate NETCLASS name '%s'." ), nc->GetName().GetData() );
THROW_IO_ERROR( m_error );
}
@ -2980,18 +2980,20 @@ BIU LEGACY_PLUGIN::biuParse( const char* aValue, const char** nptrptr )
if( errno )
{
m_error.Printf( _( "invalid float number in file: \"%s\"\nline: %d, offset: %d" ),
m_reader->GetSource().GetData(),
m_reader->LineNumber(), aValue - m_reader->Line() + 1 );
m_error.Printf( _( "Invalid floating point number in file: '%s'\nline: %d, offset: %d" ),
m_reader->GetSource().GetData(),
m_reader->LineNumber(),
aValue - m_reader->Line() + 1 );
THROW_IO_ERROR( m_error );
}
if( aValue == nptr )
{
m_error.Printf( _( "missing float number in file: \"%s\"\nline: %d, offset: %d" ),
m_reader->GetSource().GetData(),
m_reader->LineNumber(), aValue - m_reader->Line() + 1 );
m_error.Printf( _( "Missing floating point number in file: '%s'\nline: %d, offset: %d" ),
m_reader->GetSource().GetData(),
m_reader->LineNumber(),
aValue - m_reader->Line() + 1 );
THROW_IO_ERROR( m_error );
}
@ -3017,16 +3019,20 @@ double LEGACY_PLUGIN::degParse( const char* aValue, const char** nptrptr )
if( errno )
{
m_error.Printf( _( "invalid float number in file: \"%s\"\nline: %d, offset: %d" ),
m_reader->GetSource().GetData(), m_reader->LineNumber(), aValue - m_reader->Line() + 1 );
m_error.Printf( _( "Invalid floating point number in file: '%s'\nline: %d, offset: %d" ),
m_reader->GetSource().GetData(),
m_reader->LineNumber(),
aValue - m_reader->Line() + 1 );
THROW_IO_ERROR( m_error );
}
if( aValue == nptr )
{
m_error.Printf( _( "missing float number in file: \"%s\"\nline: %d, offset: %d" ),
m_reader->GetSource().GetData(), m_reader->LineNumber(), aValue - m_reader->Line() + 1 );
m_error.Printf( _( "Missing floating point number in file: '%s'\nline: %d, offset: %d" ),
m_reader->GetSource().GetData(),
m_reader->LineNumber(),
aValue - m_reader->Line() + 1 );
THROW_IO_ERROR( m_error );
}
@ -3396,7 +3402,7 @@ bool LEGACY_PLUGIN::FootprintLibDelete( const wxString& aLibraryPath,
// we don't want that. we want bare metal portability with no UI here.
if( wxRemove( aLibraryPath ) )
{
THROW_IO_ERROR( wxString::Format( _( "library \"%s\" cannot be deleted" ),
THROW_IO_ERROR( wxString::Format( _( "Footprint library '%s' cannot be deleted." ),
aLibraryPath.GetData() ) );
}