Improved various error messages
- Moved developer "jargon" to details pane - Changed error messages to "WHAT" rather than "WHY" or "WHERE"
This commit is contained in:
parent
a0a3ca6646
commit
c27f5b725d
|
@ -67,6 +67,7 @@ int DisplayExitDialog( wxWindow* parent, const wxString& aMessage )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// DisplayError should be deprecated, use DisplayErrorMessage instead
|
||||||
void DisplayError( wxWindow* parent, const wxString& text, int displaytime )
|
void DisplayError( wxWindow* parent, const wxString& text, int displaytime )
|
||||||
{
|
{
|
||||||
wxMessageDialog* dialog;
|
wxMessageDialog* dialog;
|
||||||
|
|
|
@ -76,7 +76,10 @@ int checkGlError( const std::string& aInfo, bool aThrow )
|
||||||
if( aThrow )
|
if( aThrow )
|
||||||
throw std::runtime_error( (const char*) errorMsg.char_str() );
|
throw std::runtime_error( (const char*) errorMsg.char_str() );
|
||||||
else
|
else
|
||||||
DisplayError( nullptr, errorMsg );
|
DisplayErrorMessage(
|
||||||
|
nullptr,
|
||||||
|
_( "OpenGL error occurred" ),
|
||||||
|
errorMsg );
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -248,7 +248,7 @@ static bool copy_pro_file_template( const SEARCH_STACK& aSearchS, const wxString
|
||||||
"Unable to find '%s' template config file." ),
|
"Unable to find '%s' template config file." ),
|
||||||
GetChars( templateFile ) );
|
GetChars( templateFile ) );
|
||||||
|
|
||||||
DisplayError( NULL, msg );
|
DisplayErrorMessage( nullptr, _( "Error copying project file template" ), msg );
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -412,7 +412,7 @@ FP_LIB_TABLE* PROJECT::PcbFootprintLibs( KIWAY& aKiway )
|
||||||
}
|
}
|
||||||
catch( const IO_ERROR& ioe )
|
catch( const IO_ERROR& ioe )
|
||||||
{
|
{
|
||||||
DisplayError( NULL, ioe.What() );
|
DisplayErrorMessage( NULL, _( "Error loading project footprint library table" ), ioe.What() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -177,12 +177,10 @@ bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits )
|
||||||
}
|
}
|
||||||
catch( const IO_ERROR& ioe )
|
catch( const IO_ERROR& ioe )
|
||||||
{
|
{
|
||||||
wxString msg = wxString::Format( _(
|
DisplayErrorMessage(
|
||||||
"An error occurred attempting to load the global footprint library "
|
nullptr,
|
||||||
"table:\n\n%s" ),
|
_( "An error occurred attempting to load the global footprint library table" ),
|
||||||
GetChars( ioe.What() )
|
ioe.What() );
|
||||||
);
|
|
||||||
DisplayError( NULL, msg );
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -267,13 +267,12 @@ bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits )
|
||||||
// if we are here, a incorrect global symbol library table was found.
|
// if we are here, a incorrect global symbol library table was found.
|
||||||
// Incorrect global symbol library table is not a fatal error:
|
// Incorrect global symbol library table is not a fatal error:
|
||||||
// the user just has to edit the (partially) loaded table.
|
// the user just has to edit the (partially) loaded table.
|
||||||
wxString msg = wxString::Format( _(
|
wxString msg = _(
|
||||||
"An error occurred attempting to load the global symbol library table:"
|
"An error occurred attempting to load the global symbol library table.\n"
|
||||||
"\n\n%s\n\n"
|
"Please edit this global symbol library table in Preferences menu"
|
||||||
"Please edit this global symbol library table in Preferences menu" ),
|
|
||||||
GetChars( ioe.What() )
|
|
||||||
);
|
);
|
||||||
DisplayError( NULL, msg );
|
|
||||||
|
DisplayErrorMessage( NULL, msg, ioe.What() );
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
* Copyright (C) 2007 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||||
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -86,13 +86,11 @@ bool PCB_EDIT_FRAME::AppendBoardFile( const wxString& aFullFileName, int aCtl )
|
||||||
catch( const IO_ERROR& ioe )
|
catch( const IO_ERROR& ioe )
|
||||||
{
|
{
|
||||||
for( TRACK* track = GetBoard()->m_Track; track; track = track->Next() )
|
for( TRACK* track = GetBoard()->m_Track; track; track = track->Next() )
|
||||||
|
{
|
||||||
track->ClearFlags( FLAG0 );
|
track->ClearFlags( FLAG0 );
|
||||||
|
}
|
||||||
|
|
||||||
wxString msg = wxString::Format( _(
|
DisplayErrorMessage( this, _( "Error loading board in AppendBoardFile" ), ioe.What() );
|
||||||
"Error loading board.\n%s" ),
|
|
||||||
GetChars( ioe.What() )
|
|
||||||
);
|
|
||||||
DisplayError( this, msg );
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,7 +160,9 @@ FP_LIB_TABLE* PROJECT::PcbFootprintLibs()
|
||||||
}
|
}
|
||||||
catch( const IO_ERROR& ioe )
|
catch( const IO_ERROR& ioe )
|
||||||
{
|
{
|
||||||
DisplayError( NULL, ioe.What() );
|
DisplayErrorMessage( nullptr,
|
||||||
|
_( "Error loading project footprint libraries" ),
|
||||||
|
ioe.What() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -520,11 +520,9 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
|
||||||
}
|
}
|
||||||
catch( const IO_ERROR& ioe )
|
catch( const IO_ERROR& ioe )
|
||||||
{
|
{
|
||||||
wxString msg = wxString::Format( _(
|
DisplayErrorMessage( this,
|
||||||
"Error loading board.\n%s" ),
|
wxString::Format( _( "Error loading board file:\n%s" ), fullFileName ),
|
||||||
GetChars( ioe.What() )
|
ioe.What() );
|
||||||
);
|
|
||||||
DisplayError( this, msg );
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -544,7 +544,11 @@ void PCB_EDIT_FRAME::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition )
|
||||||
|
|
||||||
if( curr_item->Type() != PCB_LINE_T )
|
if( curr_item->Type() != PCB_LINE_T )
|
||||||
{
|
{
|
||||||
DisplayError( this, wxT( "curr_item Type error" ) );
|
DisplayErrorMessage(
|
||||||
|
this,
|
||||||
|
_( "Item type is incorrect" ),
|
||||||
|
wxString::Format( _( "Selected item type is %d\n"
|
||||||
|
"Expected: %d" ), curr_item->Type(), PCB_LINE_T ) );
|
||||||
m_canvas->SetAutoPanRequest( false );
|
m_canvas->SetAutoPanRequest( false );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -357,13 +357,13 @@ bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits )
|
||||||
// if we are here, a incorrect global footprint library table was found.
|
// if we are here, a incorrect global footprint library table was found.
|
||||||
// Incorrect global footprint library table is not a fatal error:
|
// Incorrect global footprint library table is not a fatal error:
|
||||||
// the user just has to edit the (partially) loaded table.
|
// the user just has to edit the (partially) loaded table.
|
||||||
wxString msg = wxString::Format( _(
|
|
||||||
"An error occurred attempting to load the global footprint library "
|
wxString msg = _(
|
||||||
"table:\n\n%s\n\n"
|
"An error occurred attempting to load the global footprint library table:\n"
|
||||||
"Please edit this global footprint library table in Preferences menu" ),
|
"Please edit this global footprint library table in Preferences menu"
|
||||||
GetChars( ioe.What() )
|
|
||||||
);
|
);
|
||||||
DisplayError( NULL, msg );
|
|
||||||
|
DisplayErrorMessage( NULL, msg, ioe.What() );
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(KICAD_SCRIPTING)
|
#if defined(KICAD_SCRIPTING)
|
||||||
|
|
|
@ -256,7 +256,11 @@ void PCB_EDIT_FRAME::Process_Config( wxCommandEvent& event )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
DisplayError( this, wxT( "PCB_EDIT_FRAME::Process_Config error" ) );
|
DisplayErrorMessage(
|
||||||
|
this,
|
||||||
|
_( "Unkown ID in Process Config" ),
|
||||||
|
wxString::Format( _( "PCB_EDIT_FRAME::Process_Config received ID %d" ), id ) );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -151,9 +151,9 @@ bool PCB_EDIT_FRAME::ExportSpecctraFile( const wxString& aFullFilename )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
errorText += '\n';
|
DisplayErrorMessage( this,
|
||||||
errorText += _( "Unable to export, please fix and try again." );
|
_( "Unable to export, please fix and try again" ),
|
||||||
DisplayError( this, errorText );
|
errorText );
|
||||||
}
|
}
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
|
|
|
@ -85,9 +85,11 @@ void PCB_EDIT_FRAME::ImportSpecctraSession( wxCommandEvent& event )
|
||||||
false );
|
false );
|
||||||
|
|
||||||
if( fullFileName == wxEmptyString )
|
if( fullFileName == wxEmptyString )
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
SetCurItem( NULL );
|
SetCurItem( NULL );
|
||||||
|
|
||||||
// To avoid issues with undo/redo lists (dangling pointers)
|
// To avoid issues with undo/redo lists (dangling pointers)
|
||||||
// clear the lists
|
// clear the lists
|
||||||
|
@ -104,13 +106,14 @@ void PCB_EDIT_FRAME::ImportSpecctraSession( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
catch( const IO_ERROR& ioe )
|
catch( const IO_ERROR& ioe )
|
||||||
{
|
{
|
||||||
wxString msg = ioe.What();
|
wxString msg = _(
|
||||||
msg += '\n';
|
"Board may be corrupted, do not save it.\n"
|
||||||
msg += _("BOARD may be corrupted, do not save it.");
|
"Fix problem and try again"
|
||||||
msg += '\n';
|
);
|
||||||
msg += _("Fix problem and try again.");
|
|
||||||
|
|
||||||
DisplayError( this, msg );
|
wxString extra = ioe.What();
|
||||||
|
|
||||||
|
DisplayErrorMessage( this, msg, extra);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,7 +132,9 @@ void PCB_EDIT_FRAME::ImportSpecctraSession( wxCommandEvent& event )
|
||||||
|
|
||||||
// add imported tracks (previous tracks are removed, therfore all are new)
|
// add imported tracks (previous tracks are removed, therfore all are new)
|
||||||
for( TRACK* track = GetBoard()->m_Track; track; track = track->Next() )
|
for( TRACK* track = GetBoard()->m_Track; track; track = track->Next() )
|
||||||
|
{
|
||||||
view->Add( track );
|
view->Add( track );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SetStatusText( wxString( _( "Session file imported and merged OK." ) ) );
|
SetStatusText( wxString( _( "Session file imported and merged OK." ) ) );
|
||||||
|
|
|
@ -101,7 +101,9 @@ void FOOTPRINT_EDIT_FRAME::ToolOnRightClick( wxCommandEvent& event )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
DisplayError( this, wxT( "ToolOnRightClick() error" ) );
|
DisplayErrorMessage( this,
|
||||||
|
_( "Invalid tool ID "),
|
||||||
|
wxString::Format( _( "ToolOnRightClick called with ID %d" ), id ) );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -813,8 +813,9 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
DisplayError( this,
|
DisplayErrorMessage( this,
|
||||||
wxT( "PCB_EDIT_FRAME::OnSelectOptionToolbar error \n (event not handled!)" ) );
|
_( "Invalid toolbar option" ),
|
||||||
|
_( "PCB_EDIT_FRAME::OnSelectOptionToolbar error \n (event not handled!)" ) );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,7 +129,7 @@ void PCB_EDIT_FRAME::duplicateZone( wxDC* aDC, ZONE_CONTAINER* aZone )
|
||||||
// do nothing
|
// do nothing
|
||||||
if( success && ( aZone->GetLayer() == zoneSettings.m_CurrentZone_Layer ) )
|
if( success && ( aZone->GetLayer() == zoneSettings.m_CurrentZone_Layer ) )
|
||||||
{
|
{
|
||||||
DisplayError( this,
|
DisplayErrorMessage( this,
|
||||||
_( "The duplicated zone cannot be on the same layer as the original zone." ) );
|
_( "The duplicated zone cannot be on the same layer as the original zone." ) );
|
||||||
success = false;
|
success = false;
|
||||||
}
|
}
|
||||||
|
@ -360,7 +360,7 @@ void PCB_EDIT_FRAME::End_Move_Zone_Corner_Or_Outlines( wxDC* DC, ZONE_CONTAINER*
|
||||||
|
|
||||||
if( error_count )
|
if( error_count )
|
||||||
{
|
{
|
||||||
DisplayError( this, _( "Area: DRC outline error" ) );
|
DisplayErrorMessage( this, _( "Area: DRC outline error" ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -418,7 +418,7 @@ void PCB_EDIT_FRAME::Remove_Zone_Corner( wxDC* DC, ZONE_CONTAINER* aZone )
|
||||||
|
|
||||||
if( error_count )
|
if( error_count )
|
||||||
{
|
{
|
||||||
DisplayError( this, _( "Area: DRC outline error" ) );
|
DisplayErrorMessage( this, _( "Area: DRC outline error" ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -532,7 +532,7 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC )
|
||||||
{
|
{
|
||||||
if( GetToolId() == ID_PCB_KEEPOUT_AREA_BUTT && !IsCopperLayer( GetActiveLayer() ) )
|
if( GetToolId() == ID_PCB_KEEPOUT_AREA_BUTT && !IsCopperLayer( GetActiveLayer() ) )
|
||||||
{
|
{
|
||||||
DisplayError( this,
|
DisplayErrorMessage( this,
|
||||||
_( "Error: a keepout area is allowed only on copper layers" ) );
|
_( "Error: a keepout area is allowed only on copper layers" ) );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -682,7 +682,7 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC )
|
||||||
// SCREEN::SetCurItem(), so the DRC error remains on screen.
|
// SCREEN::SetCurItem(), so the DRC error remains on screen.
|
||||||
// PCB_EDIT_FRAME::SetCurItem() calls DisplayInfo().
|
// PCB_EDIT_FRAME::SetCurItem() calls DisplayInfo().
|
||||||
GetScreen()->SetCurItem( NULL );
|
GetScreen()->SetCurItem( NULL );
|
||||||
DisplayError( this,
|
DisplayErrorMessage( this,
|
||||||
_( "DRC error: this start point is inside or too close an other area" ) );
|
_( "DRC error: this start point is inside or too close an other area" ) );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -747,7 +747,7 @@ bool PCB_EDIT_FRAME::End_Zone( wxDC* DC )
|
||||||
|
|
||||||
if( g_Drc_On && m_drc->Drc( zone, icorner ) == BAD_DRC ) // we can't validate the closing edge
|
if( g_Drc_On && m_drc->Drc( zone, icorner ) == BAD_DRC ) // we can't validate the closing edge
|
||||||
{
|
{
|
||||||
DisplayError( this,
|
DisplayErrorMessage( this,
|
||||||
_( "DRC error: closing this area creates a DRC error with an other area" ) );
|
_( "DRC error: closing this area creates a DRC error with an other area" ) );
|
||||||
m_canvas->MoveCursorToCrossHair();
|
m_canvas->MoveCursorToCrossHair();
|
||||||
return false;
|
return false;
|
||||||
|
@ -809,7 +809,7 @@ bool PCB_EDIT_FRAME::End_Zone( wxDC* DC )
|
||||||
|
|
||||||
if( error_count )
|
if( error_count )
|
||||||
{
|
{
|
||||||
DisplayError( this, _( "Area: DRC outline error" ) );
|
DisplayErrorMessage( this, _( "Area: DRC outline error" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateCopyOfZonesList( s_PickedList, s_AuxiliaryList, GetBoard() );
|
UpdateCopyOfZonesList( s_PickedList, s_AuxiliaryList, GetBoard() );
|
||||||
|
|
Loading…
Reference in New Issue