pcbnew: Update strings

Moving pcbnew error strings that may be seen by the user to translated
strings.  Strings that denote unexpected cases are moved to debug logs
as they are essentially asserts that should never be shown.  The
exceptions are the messages shown when files are loaded.  All unknown
items should show an error here.
This commit is contained in:
Seth Hillbrand 2019-01-01 21:43:13 -07:00
parent 5c055f3f80
commit aeedb3543b
18 changed files with 38 additions and 68 deletions

View File

@ -1080,7 +1080,7 @@ bool DRC::checkClearancePadToPad( D_PAD* aRefPad, D_PAD* aPad )
} }
default: default:
wxMessageBox( wxT( "DRC::checkClearancePadToPad: unknown pad shape" ) ); wxLogDebug( wxT( "DRC::checkClearancePadToPad: unknown pad shape" ) );
break; break;
} }

View File

@ -248,7 +248,7 @@ void FOOTPRINT_EDIT_FRAME::Delete_Edge_Module( EDGE_MODULE* aEdge )
if( aEdge->Type() != PCB_MODULE_EDGE_T ) if( aEdge->Type() != PCB_MODULE_EDGE_T )
{ {
DisplayError( this, wxT( "StructType error: PCB_MODULE_EDGE_T expected" ) ); wxLogDebug( wxT( "StructType error: PCB_MODULE_EDGE_T expected" ) );
return; return;
} }
@ -380,7 +380,7 @@ EDGE_MODULE* FOOTPRINT_EDIT_FRAME::Begin_Edge_Module( EDGE_MODULE* aEdge,
} }
else else
{ {
wxMessageBox( wxT( "Begin_Edge() error" ) ); wxLogDebug( wxT( "Begin_Edge() error" ) );
} }
} }

View File

@ -1249,9 +1249,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
default: default:
wxString msg; wxLogDebug( wxT( "PCB_EDIT_FRAME::Process_Special_Functions() unknown event id %d" ), id );
msg.Printf( wxT( "PCB_EDIT_FRAME::Process_Special_Functions() unknown event id %d" ), id );
DisplayError( this, msg );
break; break;
} }
@ -1327,11 +1325,7 @@ void PCB_EDIT_FRAME::RemoveStruct( BOARD_ITEM* Item, wxDC* DC )
case TYPE_NOT_INIT: case TYPE_NOT_INIT:
case PCB_T: case PCB_T:
default: default:
{ wxLogDebug( wxT( "Remove: item type %d unknown." ), Item->Type() );
wxString msg = wxString::Format(
wxT( "Remove: item type %d unknown." ), Item->Type() );
DisplayError( this, msg );
}
break; break;
} }
} }

View File

@ -175,12 +175,8 @@ void PCB_EDIT_FRAME::Delete_Drawings_All_Layer( PCB_LAYER_ID aLayer )
break; break;
default: default:
{ wxLogDebug( wxT( "Delete_Drawings_All_Layer() error: unknown type %d" ), item->Type() );
msg.Printf( wxT("Delete_Drawings_All_Layer() error: unknown type %d"),
item->Type() );
wxMessageBox( msg );
break;
}
} }
} }

View File

@ -153,7 +153,7 @@ void PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event( wxCommandEvent& event )
break; break;
default: default:
wxMessageBox( wxT( "PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event() error") ); wxLogDebug( wxT( "PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event() error") );
break; break;
} }

View File

@ -357,7 +357,7 @@ bool PCB_EDIT_FRAME::Files_io_from_id( int id )
} }
default: default:
DisplayError( this, wxT( "File_io Internal Error" ) ); wxLogDebug( wxT( "File_io Internal Error" ) );
return false; return false;
} }
} }

View File

@ -71,14 +71,9 @@ void FOOTPRINT_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
break; break;
default: default:
{ wxLogDebug( wxT( "WinEDA_ModEditFrame::OnLeftClick err:Struct %d, m_Flag %X" ),
wxString msg;
msg.Printf( wxT( "WinEDA_ModEditFrame::OnLeftClick err:Struct %d, m_Flag %X" ),
item->Type(), item->GetFlags() ); item->Type(), item->GetFlags() );
DisplayError( this, msg );
item->ClearFlags(); item->ClearFlags();
break;
}
} }
} }
@ -134,9 +129,7 @@ void FOOTPRINT_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
SetCurItem( Begin_Edge_Module( (EDGE_MODULE*) item, DC, S_SEGMENT ) ); SetCurItem( Begin_Edge_Module( (EDGE_MODULE*) item, DC, S_SEGMENT ) );
} }
else else
{ wxLogDebug( wxT( "ProcessCommand error: unknown shape" ) );
wxMessageBox( wxT( "ProcessCommand error: unknown shape" ) );
}
} }
break; break;
@ -202,12 +195,12 @@ void FOOTPRINT_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
break; break;
case ID_MODEDIT_MEASUREMENT_TOOL: case ID_MODEDIT_MEASUREMENT_TOOL:
DisplayError( this, wxT( "Measurement Tool not available in Legacy Toolset" ) ); DisplayError( this, _( "Measurement Tool not available in Legacy Toolset" ) );
SetNoToolSelected(); SetNoToolSelected();
break; break;
default: default:
DisplayError( this, wxT( "FOOTPRINT_EDIT_FRAME::ProcessCommand error" ) ); wxLogDebug( wxT( "FOOTPRINT_EDIT_FRAME::ProcessCommand error" ) );
SetNoToolSelected(); SetNoToolSelected();
} }
@ -448,23 +441,20 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen
case PCB_MARKER_T: case PCB_MARKER_T:
case PCB_DIMENSION_T: case PCB_DIMENSION_T:
case PCB_TARGET_T: case PCB_TARGET_T:
msg.Printf( wxT( "FOOTPRINT_EDIT_FRAME::OnRightClick Error: Unexpected DrawType %d" ), wxLogDebug( wxT( "FOOTPRINT_EDIT_FRAME::OnRightClick Error: Unexpected DrawType %d" ),
item->Type() ); item->Type() );
DisplayError( this, msg );
break; break;
case SCREEN_T: case SCREEN_T:
case TYPE_NOT_INIT: case TYPE_NOT_INIT:
case PCB_T: case PCB_T:
msg.Printf( wxT( "FOOTPRINT_EDIT_FRAME::OnRightClick Error: illegal DrawType %d" ), wxLogDebug( wxT( "FOOTPRINT_EDIT_FRAME::OnRightClick Error: illegal DrawType %d" ),
item->Type() ); item->Type() );
DisplayError( this, msg );
break; break;
default: default:
msg.Printf( wxT( "FOOTPRINT_EDIT_FRAME::OnRightClick Error: unknown DrawType %d" ), wxLogDebug( wxT( "FOOTPRINT_EDIT_FRAME::OnRightClick Error: unknown DrawType %d" ),
item->Type() ); item->Type() );
DisplayError( this, msg );
break; break;
} }
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();

View File

@ -74,7 +74,7 @@ void FOOTPRINT_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
break; break;
default: default:
wxMessageBox( wxT( "FOOTPRINT_EDIT_FRAME::OnSelectOptionToolbar error" ) ); wxLogDebug( wxT( "FOOTPRINT_EDIT_FRAME::OnSelectOptionToolbar error" ) );
break; break;
} }
} }

View File

@ -805,8 +805,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break; break;
default: default:
DisplayError( this, wxLogDebug( wxT( "FOOTPRINT_EDIT_FRAME::Process_Special_Functions error" ) );
wxT( "FOOTPRINT_EDIT_FRAME::Process_Special_Functions error" ) );
break; break;
} }
} }

View File

@ -68,9 +68,8 @@ void FOOTPRINT_WIZARD_FRAME::Process_Special_Functions( wxCommandEvent& event )
break; break;
default: default:
msg << wxT( "FOOTPRINT_WIZARD_FRAME::Process_Special_Functions error: id = " ) wxLogDebug( wxT( "FOOTPRINT_WIZARD_FRAME::Process_Special_Functions error: id = %d" ),
<< event.GetId(); event.GetId() );
wxMessageBox( msg );
break; break;
} }
} }

View File

@ -77,8 +77,7 @@ void PCB_EDIT_FRAME::ProcessMuWaveFunctions( wxCommandEvent& event )
break; break;
default: default:
DisplayError( this, wxLogDebug( wxT( "id %d error" ), id );
wxT( "PCB_EDIT_FRAME::ProcessMuWaveFunctions() id error" ) );
break; break;
} }
} }
@ -112,7 +111,7 @@ void PCB_EDIT_FRAME::MuWaveCommand( wxDC* DC, const wxPoint& MousePos )
default: default:
m_canvas->SetCursor( wxCURSOR_ARROW ); m_canvas->SetCursor( wxCURSOR_ARROW );
DisplayError( this, wxT( "PCB_EDIT_FRAME::MuWaveCommand() id error" ) ); wxLogDebug( wxT( "id %d error" ), GetToolId() );
SetNoToolSelected(); SetNoToolSelected();
break; break;
} }

View File

@ -240,7 +240,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
} }
else else
{ {
DisplayError( this, wxT( "OnLeftClick err: not a PCB_TARGET_T" ) ); wxLogDebug( wxT( "OnLeftClick err: not a PCB_TARGET_T" ) );
} }
break; break;
@ -327,7 +327,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
} }
else else
{ {
DisplayError( this, wxT( "PCB_EDIT_FRAME::OnLeftClick() zone internal error" ) ); wxLogDebug( wxT( "PCB_EDIT_FRAME::OnLeftClick() zone internal error" ) );
} }
break; break;
@ -353,7 +353,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
} }
else else
{ {
DisplayError( this, wxT( "OnLeftClick err: not a PCB_TEXT_T" ) ); wxLogDebug( wxT( "OnLeftClick err: not a PCB_TEXT_T" ) );
} }
break; break;
@ -385,7 +385,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
} }
else else
{ {
DisplayError( this, wxT( "Internal err: Struct not PCB_MODULE_T" ) ); wxLogDebug( wxT( "Internal err: Struct not PCB_MODULE_T" ) );
} }
break; break;
@ -411,8 +411,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
} }
else else
{ {
DisplayError( this, wxLogDebug( wxT( "PCB_EDIT_FRAME::OnLeftClick() error item is not a DIMENSION" ) );
wxT( "PCB_EDIT_FRAME::OnLeftClick() error item is not a DIMENSION" ) );
} }
break; break;
@ -456,7 +455,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
break; break;
default: default:
DisplayError( this, wxT( "PCB_EDIT_FRAME::OnLeftClick() id error" ) ); wxLogDebug( wxT( "PCB_EDIT_FRAME::OnLeftClick() id error" ) );
SetNoToolSelected(); SetNoToolSelected();
break; break;
} }

View File

@ -293,16 +293,14 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
case SCREEN_T: case SCREEN_T:
case TYPE_NOT_INIT: case TYPE_NOT_INIT:
case PCB_T: case PCB_T:
msg.Printf( wxT( "PCB_EDIT_FRAME::OnRightClick() Error: unexpected DrawType %d" ), wxLogDebug( wxT( "PCB_EDIT_FRAME::OnRightClick() Error: unexpected DrawType %d" ),
item->Type() ); item->Type() );
wxMessageBox( msg );
SetCurItem( NULL ); SetCurItem( NULL );
break; break;
default: default:
msg.Printf( wxT( "PCB_EDIT_FRAME::OnRightClick() Error: unknown DrawType %d" ), wxLogDebug( wxT( "PCB_EDIT_FRAME::OnRightClick() Error: unknown DrawType %d" ),
item->Type() ); item->Type() );
wxMessageBox( msg );
// Attempt to clear error (but should no occurs ) // Attempt to clear error (but should no occurs )
if( item->Type() >= MAX_STRUCT_TYPE_ID ) if( item->Type() >= MAX_STRUCT_TYPE_ID )

View File

@ -68,10 +68,10 @@ void PCB_BASE_FRAME::Compile_Ratsnest( wxDC* aDC, bool aDisplayStatus )
std::shared_ptr<CONNECTIVITY_DATA> conn = m_Pcb->GetConnectivity(); std::shared_ptr<CONNECTIVITY_DATA> conn = m_Pcb->GetConnectivity();
msg.Printf( wxT( " %d" ), conn->GetPadCount() ); msg.Printf( wxT( " %d" ), conn->GetPadCount() );
AppendMsgPanel( wxT( "Pads" ), msg, RED ); AppendMsgPanel( _( "Pads" ), msg, RED );
msg.Printf( wxT( " %d" ), conn->GetNetCount() - 1 /* Don't include "No Net" in count */ ); msg.Printf( wxT( " %d" ), conn->GetNetCount() - 1 /* Don't include "No Net" in count */ );
AppendMsgPanel( wxT( "Nets" ), msg, CYAN ); AppendMsgPanel( _( "Nets" ), msg, CYAN );
SetMsgPanel( m_Pcb ); SetMsgPanel( m_Pcb );
} }

View File

@ -234,7 +234,7 @@ bool EDIT_TOOL::Init()
if( !m_selectionTool ) if( !m_selectionTool )
{ {
DisplayError( NULL, wxT( "pcbnew.InteractiveSelection tool is not available" ) ); DisplayError( NULL, _( "pcbnew.InteractiveSelection tool is not available" ) );
return false; return false;
} }

View File

@ -98,7 +98,7 @@ bool ALIGN_DISTRIBUTE_TOOL::Init()
if( !m_selectionTool ) if( !m_selectionTool )
{ {
DisplayError( NULL, wxT( "pcbnew.InteractiveSelection tool is not available" ) ); DisplayError( NULL, _( "pcbnew.InteractiveSelection tool is not available" ) );
return false; return false;
} }

View File

@ -260,7 +260,7 @@ bool POINT_EDITOR::Init()
if( !m_selectionTool ) if( !m_selectionTool )
{ {
DisplayError( NULL, wxT( "pcbnew.InteractiveSelection tool is not available" ) ); DisplayError( NULL, _( "pcbnew.InteractiveSelection tool is not available" ) );
return false; return false;
} }

View File

@ -322,9 +322,7 @@ void PCB_BASE_EDIT_FRAME::SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsLis
default: default:
{ {
wxString msg; wxLogDebug( wxT( "SaveCopyInUndoList() error (unknown code %X)" ), command );
msg.Printf( wxT( "SaveCopyInUndoList() error (unknown code %X)" ), command );
wxMessageBox( msg );
} }
break; break;
@ -570,17 +568,15 @@ void PCB_BASE_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool
default: default:
{ {
wxString msg; wxLogDebug( wxT( "PutDataInPreviousState() error (unknown code %X)" ),
msg.Printf( wxT( "PutDataInPreviousState() error (unknown code %X)" ),
aList->GetPickedItemStatus( ii ) ); aList->GetPickedItemStatus( ii ) );
wxMessageBox( msg );
} }
break; break;
} }
} }
if( not_found ) if( not_found )
wxMessageBox( wxT( "Incomplete undo/redo operation: some items not found" ) ); wxMessageBox( _( "Incomplete undo/redo operation: some items not found" ) );
// Rebuild pointers and connectivity that can be changed. // Rebuild pointers and connectivity that can be changed.
// connectivity can be rebuilt only in the board editor frame // connectivity can be rebuilt only in the board editor frame