Simplify some error messages.
This commit is contained in:
parent
91ab540d18
commit
1c0d4ac02d
|
@ -290,9 +290,8 @@ const FP_LIB_TABLE_ROW* FP_LIB_TABLE::FindRow( const wxString& aNickname )
|
||||||
|
|
||||||
if( !row )
|
if( !row )
|
||||||
{
|
{
|
||||||
wxString msg = wxString::Format(
|
wxString msg = wxString::Format( _( "fp-lib-table files contain no library named '%s'." ),
|
||||||
_( "fp-lib-table files contain no library with nickname \"%s\"" ),
|
aNickname );
|
||||||
aNickname );
|
|
||||||
|
|
||||||
THROW_IO_ERROR( msg );
|
THROW_IO_ERROR( msg );
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,12 +112,10 @@ bool CVPCB_MAINFRAME::ReadNetListAndFpFiles( const std::string& aNetlist )
|
||||||
// Check if footprint links were generated before the footprint library table was implemented.
|
// Check if footprint links were generated before the footprint library table was implemented.
|
||||||
if( hasMissingNicks )
|
if( hasMissingNicks )
|
||||||
{
|
{
|
||||||
msg = _(
|
msg = _( "Some of the assigned footprints are legacy entries with no library names. Would "
|
||||||
"Some of the assigned footprints are legacy entries (are missing lib nicknames). "
|
"you like Kicad to attempt to convert them to the new required LIB_ID format? "
|
||||||
"Would you like CvPcb to attempt to convert them to the new required LIB_ID format? "
|
"(If you answer no, then these assignments will be cleared and you will need to "
|
||||||
"(If you answer no, then these assignments will be cleared out and you will "
|
"re-assign them manually.)" );
|
||||||
"have to re-assign these footprints yourself.)"
|
|
||||||
);
|
|
||||||
|
|
||||||
if( IsOK( this, msg ) )
|
if( IsOK( this, msg ) )
|
||||||
{
|
{
|
||||||
|
|
|
@ -331,7 +331,7 @@ bool PANEL_SYM_LIB_TABLE::verifyTables()
|
||||||
}
|
}
|
||||||
else if( ( illegalCh = LIB_ID::FindIllegalLibraryNameChar( nick ) ) )
|
else if( ( illegalCh = LIB_ID::FindIllegalLibraryNameChar( nick ) ) )
|
||||||
{
|
{
|
||||||
wxString msg = wxString::Format( _( "Illegal character '%c' in Nickname: \"%s\"" ),
|
wxString msg = wxString::Format( _( "Illegal character '%c' in nickname '%s'" ),
|
||||||
illegalCh,
|
illegalCh,
|
||||||
nick );
|
nick );
|
||||||
|
|
||||||
|
@ -342,7 +342,7 @@ bool PANEL_SYM_LIB_TABLE::verifyTables()
|
||||||
m_cur_grid->MakeCellVisible( r, 0 );
|
m_cur_grid->MakeCellVisible( r, 0 );
|
||||||
m_cur_grid->SetGridCursor( r, 1 );
|
m_cur_grid->SetGridCursor( r, 1 );
|
||||||
|
|
||||||
wxMessageDialog errdlg( this, msg, _( "No Colon in Nicknames" ) );
|
wxMessageDialog errdlg( this, msg, _( "Library Nickname Error" ) );
|
||||||
errdlg.ShowModal();
|
errdlg.ShowModal();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -372,7 +372,9 @@ bool PANEL_SYM_LIB_TABLE::verifyTables()
|
||||||
|
|
||||||
if( nick1 == nick2 )
|
if( nick1 == nick2 )
|
||||||
{
|
{
|
||||||
wxString msg = wxString::Format( _( "Duplicate Nickname: \"%s\"." ), nick1 );
|
wxString msg = wxString::Format( _( "Multiple libraries cannot share the same "
|
||||||
|
"nickname ('%s')." ),
|
||||||
|
nick1 );
|
||||||
|
|
||||||
// show the tabbed panel holding the grid we have flunked:
|
// show the tabbed panel holding the grid we have flunked:
|
||||||
if( model != cur_model() )
|
if( model != cur_model() )
|
||||||
|
@ -382,7 +384,7 @@ bool PANEL_SYM_LIB_TABLE::verifyTables()
|
||||||
m_cur_grid->MakeCellVisible( r2, 0 );
|
m_cur_grid->MakeCellVisible( r2, 0 );
|
||||||
m_cur_grid->SetGridCursor( r2, 1 );
|
m_cur_grid->SetGridCursor( r2, 1 );
|
||||||
|
|
||||||
wxMessageDialog errdlg( this, msg, _( "Please Delete or Modify One" ) );
|
wxMessageDialog errdlg( this, msg, _( "Library Nickname Error" ) );
|
||||||
errdlg.ShowModal();
|
errdlg.ShowModal();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -460,27 +462,28 @@ void PANEL_SYM_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event )
|
||||||
bool addDuplicates = false;
|
bool addDuplicates = false;
|
||||||
bool applyToAll = false;
|
bool applyToAll = false;
|
||||||
wxString warning = _( "Warning: Duplicate Nickname" );
|
wxString warning = _( "Warning: Duplicate Nickname" );
|
||||||
wxString msg = _( "A library nicknamed \"%s\" already exists." );
|
wxString msg = _( "A library nicknamed '%s' already exists." );
|
||||||
wxString detailedMsg = _( "Please change the library nickname after adding this library." );
|
wxString detailedMsg = _( "One of the nicknames will need to be changed after "
|
||||||
|
"adding this library." );
|
||||||
|
|
||||||
wxArrayString files;
|
wxArrayString files;
|
||||||
dlg.GetFilenames( files );
|
dlg.GetFilenames( files );
|
||||||
|
|
||||||
for( const auto& file : files )
|
for( const wxString& file : files )
|
||||||
{
|
{
|
||||||
wxString filePath = dlg.GetDirectory() + wxFileName::GetPathSeparator() + file;
|
wxString filePath = dlg.GetDirectory() + wxFileName::GetPathSeparator() + file;
|
||||||
wxFileName fn( filePath );
|
wxFileName fn( filePath );
|
||||||
wxString nickname = LIB_ID::FixIllegalChars( fn.GetName() );
|
wxString nickname = LIB_ID::FixIllegalChars( fn.GetName() );
|
||||||
bool doAdd = true;
|
bool doAdd = true;
|
||||||
|
|
||||||
if( cur_model()->ContainsNickname( nickname ) )
|
if( cur_model()->ContainsNickname( nickname ) )
|
||||||
{
|
{
|
||||||
if( !applyToAll )
|
if( !applyToAll )
|
||||||
{
|
{
|
||||||
// The cancel button adds the library to the table anyway
|
// The cancel button adds the library to the table anyway
|
||||||
addDuplicates = ( OKOrCancelDialog( this, warning,
|
addDuplicates = OKOrCancelDialog( this, warning, wxString::Format( msg, nickname ),
|
||||||
wxString::Format( msg, nickname ),
|
detailedMsg, _( "Skip" ), _( "Add Anyway" ),
|
||||||
detailedMsg, _( "Skip" ), _( "Add Anyway" ), &applyToAll ) == wxID_CANCEL );
|
&applyToAll ) == wxID_CANCEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
doAdd = addDuplicates;
|
doAdd = addDuplicates;
|
||||||
|
|
|
@ -225,9 +225,10 @@ void SYMBOL_LIB_TABLE::Parse( LIB_TABLE_LEXER* in )
|
||||||
{
|
{
|
||||||
delete tmp; // The table did not take ownership of the row.
|
delete tmp; // The table did not take ownership of the row.
|
||||||
|
|
||||||
wxString msg = wxString::Format(
|
wxString msg = wxString::Format( _( "Duplicate library nickname '%s' found in symbol "
|
||||||
_( "Duplicate library nickname \"%s\" found in symbol library "
|
"library table file line %d" ),
|
||||||
"table file line %d" ), nickname, lineNum );
|
nickname,
|
||||||
|
lineNum );
|
||||||
|
|
||||||
if( !errMsg.IsEmpty() )
|
if( !errMsg.IsEmpty() )
|
||||||
errMsg << '\n';
|
errMsg << '\n';
|
||||||
|
|
|
@ -534,7 +534,7 @@ bool PANEL_FP_LIB_TABLE::verifyTables()
|
||||||
}
|
}
|
||||||
else if( ( illegalCh = LIB_ID::FindIllegalLibraryNameChar( nick ) ) )
|
else if( ( illegalCh = LIB_ID::FindIllegalLibraryNameChar( nick ) ) )
|
||||||
{
|
{
|
||||||
wxString msg = wxString::Format( _( "Illegal character '%c' in Nickname: \"%s\"" ),
|
wxString msg = wxString::Format( _( "Illegal character '%c' in nickname '%s'." ),
|
||||||
illegalCh,
|
illegalCh,
|
||||||
nick );
|
nick );
|
||||||
|
|
||||||
|
@ -575,7 +575,9 @@ bool PANEL_FP_LIB_TABLE::verifyTables()
|
||||||
|
|
||||||
if( nick1 == nick2 )
|
if( nick1 == nick2 )
|
||||||
{
|
{
|
||||||
wxString msg = wxString::Format( _( "Duplicate nicknames \"%s\"." ), nick1 );
|
wxString msg = wxString::Format( _( "Multiple libraries cannot share the same "
|
||||||
|
"nickname ('%s')." ),
|
||||||
|
nick1 );
|
||||||
|
|
||||||
// show the tabbed panel holding the grid we have flunked:
|
// show the tabbed panel holding the grid we have flunked:
|
||||||
if( model != cur_model() )
|
if( model != cur_model() )
|
||||||
|
@ -840,9 +842,10 @@ void PANEL_FP_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event )
|
||||||
const ENV_VAR_MAP& envVars = Pgm().GetLocalEnvVariables();
|
const ENV_VAR_MAP& envVars = Pgm().GetLocalEnvVariables();
|
||||||
bool addDuplicates = false;
|
bool addDuplicates = false;
|
||||||
bool applyToAll = false;
|
bool applyToAll = false;
|
||||||
wxString warning = _( "Warning: Duplicate Nickname" );
|
wxString warning = _( "Warning: Duplicate Nicknames" );
|
||||||
wxString msg = _( "A library nicknamed \"%s\" already exists." );
|
wxString msg = _( "A library nicknamed '%s' already exists." );
|
||||||
wxString detailedMsg = _( "Please change the library nickname after adding this library." );
|
wxString detailedMsg = _( "One of the nicknames will need to be changed after "
|
||||||
|
"adding this library." );
|
||||||
|
|
||||||
for( const auto& filePath : files )
|
for( const auto& filePath : files )
|
||||||
{
|
{
|
||||||
|
@ -855,11 +858,9 @@ void PANEL_FP_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event )
|
||||||
if( !applyToAll )
|
if( !applyToAll )
|
||||||
{
|
{
|
||||||
// The cancel button adds the library to the table anyway
|
// The cancel button adds the library to the table anyway
|
||||||
addDuplicates = ( OKOrCancelDialog( this, warning,
|
addDuplicates = OKOrCancelDialog( this, warning, wxString::Format( msg, nickname ),
|
||||||
wxString::Format( msg, nickname ),
|
detailedMsg, _( "Skip" ), _( "Add Anyway" ),
|
||||||
detailedMsg,
|
&applyToAll ) == wxID_CANCEL;
|
||||||
_( "Skip" ), _( "Add Anyway" ),
|
|
||||||
&applyToAll ) == wxID_CANCEL );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
doAdd = addDuplicates;
|
doAdd = addDuplicates;
|
||||||
|
|
|
@ -270,16 +270,16 @@ void FOOTPRINT_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
|
||||||
if( !payload.empty() )
|
if( !payload.empty() )
|
||||||
{
|
{
|
||||||
wxFileName fpFileName( payload );
|
wxFileName fpFileName( payload );
|
||||||
wxString libNickname;
|
wxString libNickname;
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
|
||||||
FP_LIB_TABLE* libTable = Prj().PcbFootprintLibs();
|
FP_LIB_TABLE* libTable = Prj().PcbFootprintLibs();
|
||||||
const LIB_TABLE_ROW* libTableRow = libTable->FindRowByURI( fpFileName.GetPath() );
|
const LIB_TABLE_ROW* libTableRow = libTable->FindRowByURI( fpFileName.GetPath() );
|
||||||
|
|
||||||
if( !libTableRow )
|
if( !libTableRow )
|
||||||
{
|
{
|
||||||
msg.Printf( _( "The current configuration does not include the footprint library\n"
|
msg.Printf( _( "The current configuration does not include a library named '%s'.\n"
|
||||||
"\"%s\".\nUse Manage Footprint Libraries to edit the configuration." ),
|
"Use Manage Footprint Libraries to edit the configuration." ),
|
||||||
fpFileName.GetPath() );
|
fpFileName.GetPath() );
|
||||||
DisplayErrorMessage( this, _( "Library not found in footprint library table." ), msg );
|
DisplayErrorMessage( this, _( "Library not found in footprint library table." ), msg );
|
||||||
break;
|
break;
|
||||||
|
@ -289,9 +289,9 @@ void FOOTPRINT_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
|
||||||
|
|
||||||
if( !libTable->HasLibrary( libNickname, true ) )
|
if( !libTable->HasLibrary( libNickname, true ) )
|
||||||
{
|
{
|
||||||
msg.Printf( _( "The library with the nickname \"%s\" is not enabled\n"
|
msg.Printf( _( "The library '%s' is not enabled in the current configuration.\n"
|
||||||
"in the current configuration. Use Manage Footprint Libraries to\n"
|
"Use Manage Footprint Libraries to edit the configuration." ),
|
||||||
"edit the configuration." ), libNickname );
|
libNickname );
|
||||||
DisplayErrorMessage( this, _( "Footprint library not enabled." ), msg );
|
DisplayErrorMessage( this, _( "Footprint library not enabled." ), msg );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue