mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-20 13:01:41 +00:00
More error message regularization.
This commit is contained in:
parent
70ac70f360
commit
4aa8318dc2
3d-viewer/3d_viewer
common
cvpcb
eeschema
kicad/tools
pagelayout_editor
pcbnew
dialogs
drc
exporters
files.cppfootprint_edit_frame.cppfootprint_libraries_utils.cppplugins
specctra_import_export
@ -735,7 +735,7 @@ void EDA_3D_VIEWER_FRAME::takeScreenshot( wxCommandEvent& event )
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "Insufficient permissions required to save file\n%s" ), fullFileName );
|
||||
msg.Printf( _( "Insufficient permissions to save file '%s'." ), fullFileName );
|
||||
wxMessageBox( msg, _( "Error" ), wxOK | wxICON_ERROR, this );
|
||||
return;
|
||||
}
|
||||
|
@ -1035,17 +1035,17 @@ bool EDA_BASE_FRAME::IsWritable( const wxFileName& aFileName )
|
||||
|
||||
if( fn.IsDir() && !fn.IsDirWritable() )
|
||||
{
|
||||
msg.Printf( _( "You do not have write permissions to folder '%s'." ),
|
||||
msg.Printf( _( "Insufficient permissions to folder '%s'." ),
|
||||
fn.GetPath() );
|
||||
}
|
||||
else if( !fn.FileExists() && !fn.IsDirWritable() )
|
||||
{
|
||||
msg.Printf( _( "You do not have write permissions to save file '%s' to folder '%s'." ),
|
||||
msg.Printf( _( "Insufficient permissions to save file '%s'." ),
|
||||
fn.GetFullName(), fn.GetPath() );
|
||||
}
|
||||
else if( fn.FileExists() && !fn.IsFileWritable() )
|
||||
{
|
||||
msg.Printf( _( "You do not have write permissions to save file '%s'." ),
|
||||
msg.Printf( _( "Insufficient permissions to save file '%s'." ),
|
||||
fn.GetFullPath() );
|
||||
}
|
||||
|
||||
|
@ -213,7 +213,7 @@ int COMMON_CONTROL::ShowHelp( const TOOL_EVENT& aEvent )
|
||||
|
||||
if( !helpFile )
|
||||
{
|
||||
msg = wxString::Format( _( "Help file \"%s\" or\n\"%s\" could not be found.\n"
|
||||
msg = wxString::Format( _( "Help file '%s' or\n'%s' could not be found.\n"
|
||||
"Do you want to access the KiCad online help?" ),
|
||||
names[0], names[1] );
|
||||
wxMessageDialog dlg( NULL, msg, _( "File Not Found" ),
|
||||
@ -233,7 +233,7 @@ int COMMON_CONTROL::ShowHelp( const TOOL_EVENT& aEvent )
|
||||
|
||||
if( !helpFile )
|
||||
{
|
||||
msg = wxString::Format( _( "Help file \"%s\" could not be found.\n"
|
||||
msg = wxString::Format( _( "Help file '%s' could not be found.\n"
|
||||
"Do you want to access the KiCad online help?" ),
|
||||
base_name );
|
||||
wxMessageDialog dlg( NULL, msg, _( "File Not Found" ),
|
||||
|
@ -531,7 +531,7 @@ void CVPCB_MAINFRAME::AssociateFootprint( const CVPCB_ASSOCIATION& aAssociation,
|
||||
// Test for validity of the requested footprint
|
||||
if( !fpid.empty() && !fpid.IsValid() )
|
||||
{
|
||||
wxString msg = wxString::Format( _( "\"%s\" is not a valid footprint." ),
|
||||
wxString msg = wxString::Format( _( "'%s' is not a valid footprint." ),
|
||||
fpid.Format().wx_str() );
|
||||
DisplayErrorMessage( this, msg );
|
||||
return;
|
||||
@ -841,7 +841,7 @@ void CVPCB_MAINFRAME::SendMessageToEESCHEMA( bool aClearHighligntOnly )
|
||||
// Now highlight the selected symbol:
|
||||
COMPONENT* symbol = m_netlist.GetComponent( selection );
|
||||
|
||||
packet = StrPrintf( "$PART: \"%s\"", TO_UTF8( symbol->GetReference() ) );
|
||||
packet = std::string( "$PART: \"" ) + TO_UTF8( symbol->GetReference() ) + "\"";
|
||||
|
||||
if( Kiface().IsSingle() )
|
||||
SendCommand( MSG_TO_SCH, packet );
|
||||
|
@ -147,7 +147,7 @@ void DIALOG_SCHEMATIC_SETUP::OnAuxiliaryAction( wxCommandEvent& event )
|
||||
if( !m_frame->GetSettingsManager()->LoadProject( projectFn.GetFullPath(), false ) )
|
||||
{
|
||||
wxString msg = wxString::Format( _( "Error importing settings from project:\n"
|
||||
"Project file %s could not be loaded" ),
|
||||
"Project file %s could not be loaded." ),
|
||||
projectFn.GetFullPath() );
|
||||
DisplayErrorMessage( this, msg );
|
||||
|
||||
|
@ -2706,8 +2706,10 @@ void SCH_LEGACY_PLUGIN_CACHE::loadDocs()
|
||||
return;
|
||||
|
||||
if( !fn.IsFileReadable() )
|
||||
THROW_IO_ERROR( wxString::Format( _( "user does not have permission to read library "
|
||||
"document file \"%s\"" ), fn.GetFullPath() ) );
|
||||
{
|
||||
THROW_IO_ERROR( wxString::Format( _( "Insufficient permissions to read library '%s'." ),
|
||||
fn.GetFullPath() ) );
|
||||
}
|
||||
|
||||
FILE_LINE_READER reader( fn.GetFullPath() );
|
||||
|
||||
|
@ -923,7 +923,7 @@ void SCH_SHEET_LIST::UpdateSymbolInstances(
|
||||
|
||||
if( it == aSymbolInstances.end() )
|
||||
{
|
||||
wxLogTrace( traceSchSheetPaths, "No symbol instance found for path \"%s\"", path );
|
||||
wxLogTrace( traceSchSheetPaths, "No symbol instance found for path '%s'", path );
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -954,7 +954,7 @@ void SCH_SHEET_LIST::UpdateSheetInstances( const std::vector<SCH_SHEET_INSTANCE>
|
||||
|
||||
if( it == aSheetInstances.end() )
|
||||
{
|
||||
wxLogTrace( traceSchSheetPaths, "No sheet instance found for path \"%s\"",
|
||||
wxLogTrace( traceSchSheetPaths, "No sheet instance found for path '%s'",
|
||||
instance.PathWithoutRootUuid().AsString() );
|
||||
continue;
|
||||
}
|
||||
|
@ -1551,7 +1551,7 @@ bool SIM_PLOT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
|
||||
if( filename.GetName().IsEmpty() )
|
||||
filename.SetFullName( Prj().GetProjectName() + wxT( ".wbk" ) );
|
||||
|
||||
wxString msg = _( "Save changes to \"%s\" before closing?" );
|
||||
wxString msg = _( "Save changes to '%s' before closing?" );
|
||||
|
||||
return HandleUnsavedChanges( this, wxString::Format( msg, filename.GetFullName() ),
|
||||
[&]()->bool
|
||||
|
@ -274,8 +274,8 @@ bool SPICE_VALIDATOR::Validate( wxWindow* aParent )
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
DisplayError( aParent,
|
||||
wxString::Format( _( "\"%s\" is not a valid Spice value" ), text->GetValue() ) );
|
||||
DisplayError( aParent, wxString::Format( _( "'%s' is not a valid Spice value." ),
|
||||
text->GetValue() ) );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -822,7 +822,7 @@ bool SYMBOL_EDIT_FRAME::AddLibraryFile( bool aCreateNew )
|
||||
|
||||
if( m_libMgr->LibraryExists( libName ) )
|
||||
{
|
||||
DisplayError( this, wxString::Format( _( "Library \"%s\" already exists" ), libName ) );
|
||||
DisplayError( this, wxString::Format( _( "Library '%s' already exists." ), libName ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -831,7 +831,7 @@ bool SYMBOL_EDIT_FRAME::AddLibraryFile( bool aCreateNew )
|
||||
if( !m_libMgr->CreateLibrary( fn.GetFullPath(), libTable ) )
|
||||
{
|
||||
DisplayError( this, wxString::Format( _( "Could not create the library file '%s'.\n"
|
||||
"Check write permission." ),
|
||||
"Make sure you have write permissions and try again." ),
|
||||
fn.GetFullPath() ) );
|
||||
return false;
|
||||
}
|
||||
@ -1031,7 +1031,7 @@ bool SYMBOL_EDIT_FRAME::backupFile( const wxFileName& aOriginalFile, const wxStr
|
||||
|
||||
if( !wxCopyFile( aOriginalFile.GetFullPath(), backupFileName.GetFullPath() ) )
|
||||
{
|
||||
DisplayError( this, wxString::Format( _( "Failed to save backup to \"%s\"" ),
|
||||
DisplayError( this, wxString::Format( _( "Failed to save backup to '%s'." ),
|
||||
backupFileName.GetFullPath() ) );
|
||||
return false;
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ void SYMBOL_EDIT_FRAME::ExportSymbol()
|
||||
|
||||
if( fn.Exists() && !fn.IsDirWritable() )
|
||||
{
|
||||
msg.Printf( _( "Write permissions are required to save library '%s'." ),
|
||||
msg.Printf( _( "Insufficient permissions to save library '%s'." ),
|
||||
fn.GetFullPath() );
|
||||
DisplayError( this, msg );
|
||||
return;
|
||||
|
@ -23,10 +23,6 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file class_library.cpp
|
||||
*/
|
||||
|
||||
#include <algorithm>
|
||||
#include <kiface_i.h>
|
||||
#include <eda_base_frame.h>
|
||||
@ -47,12 +43,6 @@
|
||||
#include <wx/log.h>
|
||||
#include <wx/progdlg.h>
|
||||
#include <wx/tokenzr.h>
|
||||
#include <wx/regex.h>
|
||||
|
||||
#define DUPLICATE_NAME_MSG \
|
||||
_( "Library \"%s\" has duplicate entry name \"%s\".\n" \
|
||||
"This may cause some unexpected behavior when loading symbols into a schematic." )
|
||||
|
||||
|
||||
SYMBOL_LIB::SYMBOL_LIB( SCH_LIB_TYPE aType, const wxString& aFileName,
|
||||
SCH_IO_MGR::SCH_FILE_T aPluginType ) :
|
||||
@ -581,9 +571,10 @@ void SYMBOL_LIBS::LoadAllLibraries( PROJECT* aProject, bool aShowProgress )
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
wxString msg =
|
||||
wxString::Format( _( "Symbol library \"%s\" failed to load.\nError: %s" ),
|
||||
cache_name, ioe.What() );
|
||||
wxString msg = wxString::Format( _( "Error loading symbol library '%s'." )
|
||||
+ wxS( "\n%s" ),
|
||||
cache_name,
|
||||
ioe.What() );
|
||||
|
||||
THROW_IO_ERROR( msg );
|
||||
}
|
||||
|
@ -225,9 +225,8 @@ int KICAD_MANAGER_CONTROL::NewFromTemplate( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "Cannot write to folder '%s'." ), fn.GetPath() );
|
||||
msg.Printf( _( "Insufficient permissions to write to folder '%s'." ), fn.GetPath() );
|
||||
wxMessageDialog msgDlg( m_frame, msg, _( "Error" ), wxICON_ERROR | wxOK | wxCENTER );
|
||||
msgDlg.SetExtendedMessage( _( "Make sure you have write permissions and try again." ) );
|
||||
msgDlg.ShowModal();
|
||||
return -1;
|
||||
}
|
||||
@ -536,7 +535,7 @@ int KICAD_MANAGER_CONTROL::SaveProjectAs( const TOOL_EVENT& aEvent )
|
||||
|
||||
if( !wxMkdir( newProjectDir.GetFullPath() ) )
|
||||
{
|
||||
msg.Printf( _( "Directory '%s' could not be created.\n\n"
|
||||
msg.Printf( _( "Folder '%s' could not be created.\n\n"
|
||||
"Please make sure you have write permissions and try again." ),
|
||||
newProjectDir.GetPath() );
|
||||
DisplayErrorMessage( m_frame, msg );
|
||||
@ -545,10 +544,9 @@ int KICAD_MANAGER_CONTROL::SaveProjectAs( const TOOL_EVENT& aEvent )
|
||||
|
||||
if( !newProjectDir.IsDirWritable() )
|
||||
{
|
||||
msg.Printf( _( "Cannot write to folder '%s'." ), newProjectDir.GetFullPath() );
|
||||
msg.Printf( _( "Insufficient permissions to write to folder '%s'." ),
|
||||
newProjectDir.GetFullPath() );
|
||||
wxMessageDialog msgDlg( m_frame, msg, _( "Error!" ), wxICON_ERROR | wxOK | wxCENTER );
|
||||
msgDlg.SetExtendedMessage( _( "Please check your access permissions to this folder "
|
||||
"and try again." ) );
|
||||
msgDlg.ShowModal();
|
||||
return -1;
|
||||
}
|
||||
|
@ -169,12 +169,12 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event )
|
||||
case wxID_SAVE:
|
||||
if( !SaveDrawingSheetFile( filename ) )
|
||||
{
|
||||
msg.Printf( _( "Unable to write \"%s\"" ), filename );
|
||||
msg.Printf( _( "Unable to write '%s'." ), filename );
|
||||
DisplayErrorMessage( this, msg );
|
||||
}
|
||||
else
|
||||
{
|
||||
msg.Printf( _("File \"%s\" saved."), filename );
|
||||
msg.Printf( _("File '%s' saved."), filename );
|
||||
SetStatusText( msg );
|
||||
}
|
||||
break;
|
||||
|
@ -296,8 +296,8 @@ static bool validateAxisOptions( const wxTextCtrl& offsetEntry, const wxChoice&
|
||||
|
||||
if( !ok )
|
||||
{
|
||||
errors.Add( wxString::Format( _( "Could not determine numbering start from \"%s\": "
|
||||
"expected value consistent with alphabet \"%s\"" ),
|
||||
errors.Add( wxString::Format( _( "Could not determine numbering start from '%s': "
|
||||
"expected value consistent with alphabet '%s'." ),
|
||||
text,
|
||||
aAxis.GetAlphabet() ) );
|
||||
return false;
|
||||
|
@ -261,7 +261,7 @@ void DIALOG_EXPORT_SVG::ExportSVGFile( bool aOnlyOneFile )
|
||||
|
||||
if( !EnsureFileDirectoryExists( &outputDir, boardFilename, &reporter ) )
|
||||
{
|
||||
wxString msg = wxString::Format( _( "Could not write plot files to folder \"%s\"." ),
|
||||
wxString msg = wxString::Format( _( "Could not write plot files to folder '%s'." ),
|
||||
outputDir.GetPath() );
|
||||
DisplayError( this, msg );
|
||||
return;
|
||||
@ -288,11 +288,12 @@ void DIALOG_EXPORT_SVG::ExportSVGFile( bool aOnlyOneFile )
|
||||
|
||||
if( CreateSVGFile( svgPath ) )
|
||||
{
|
||||
reporter.Report( wxString::Format( _( "Exported \"%s\"." ), svgPath ), RPT_SEVERITY_ACTION );
|
||||
reporter.Report( wxString::Format( _( "Exported '%s'." ), svgPath ),
|
||||
RPT_SEVERITY_ACTION );
|
||||
}
|
||||
else // Error
|
||||
{
|
||||
reporter.Report( wxString::Format( _( "Unable to create file \"%s\"." ), svgPath ),
|
||||
reporter.Report( wxString::Format( _( "Unable to create '%s'." ), svgPath ),
|
||||
RPT_SEVERITY_ERROR );
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ public:
|
||||
m_initial_help( INITIAL_HELP ),
|
||||
m_grid_widths_dirty( true )
|
||||
{
|
||||
SetTitle( wxString::Format( _( "Options for Library \"%s\"" ), aNickname ) );
|
||||
SetTitle( wxString::Format( _( "Options for Library '%s'" ), aNickname ) );
|
||||
|
||||
// Give a bit more room for combobox editors
|
||||
m_grid->SetDefaultRowSize( m_grid->GetDefaultRowSize() + 4 );
|
||||
|
@ -1003,7 +1003,7 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintId, const BOAR
|
||||
}
|
||||
else
|
||||
{
|
||||
REPORT( wxString::Format( _( "Checking rule condition \"%s\"." ),
|
||||
REPORT( wxString::Format( _( "Checking rule condition '%s'." ),
|
||||
EscapeHTML( c->condition->GetExpression() ) ) )
|
||||
}
|
||||
|
||||
|
@ -338,7 +338,7 @@ void IPC356D_WRITER::Write( const wxString& aFilename )
|
||||
if( ( file = wxFopen( aFilename, wxT( "wt" ) ) ) == nullptr )
|
||||
{
|
||||
wxString details;
|
||||
details.Printf( "The file %s could not be opened for writing", aFilename );
|
||||
details.Printf( "The file %s could not be opened for writing.", aFilename );
|
||||
DisplayErrorMessage( m_parent, "Could not write IPC-356D file!", details );
|
||||
return;
|
||||
}
|
||||
|
@ -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( _( "Could not create file '%s'." ), path ) );
|
||||
}
|
||||
|
||||
|
@ -942,7 +942,7 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool addToHistory,
|
||||
|
||||
if( !IsWritable( pcbFileName ) )
|
||||
{
|
||||
wxString msg = wxString::Format( _( "No access rights to write to file \"%s\"" ),
|
||||
wxString msg = wxString::Format( _( "Insufficient permissions to write file '%s'." ),
|
||||
pcbFileName.GetFullPath() );
|
||||
|
||||
DisplayError( this, msg );
|
||||
@ -1081,7 +1081,7 @@ bool PCB_EDIT_FRAME::SavePcbCopy( const wxString& aFileName, bool aCreateProject
|
||||
|
||||
if( !IsWritable( pcbFileName ) )
|
||||
{
|
||||
DisplayError( this, wxString::Format( _( "No access rights to write to file '%s'." ),
|
||||
DisplayError( this, wxString::Format( _( "Insufficient permissions to write file '%s'." ),
|
||||
pcbFileName.GetFullPath() ) );
|
||||
return false;
|
||||
}
|
||||
|
@ -619,7 +619,7 @@ bool FOOTPRINT_EDIT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
|
||||
}
|
||||
|
||||
wxString footprintName = GetBoard()->GetFirstFootprint()->GetFPID().GetLibItemName();
|
||||
wxString msg = _( "Save changes to \"%s\" before closing?" );
|
||||
wxString msg = _( "Save changes to '%s' before closing?" );
|
||||
|
||||
if( !HandleUnsavedChanges( this, wxString::Format( msg, footprintName ),
|
||||
[&]() -> bool
|
||||
|
@ -356,7 +356,7 @@ void FOOTPRINT_EDIT_FRAME::ExportFootprint( FOOTPRINT* aFootprint )
|
||||
|
||||
if( fp == nullptr )
|
||||
{
|
||||
wxMessageBox( wxString::Format( _( "Unable to create or write file '%s'." ),
|
||||
wxMessageBox( wxString::Format( _( "Insufficient permissions to write file '%s'." ),
|
||||
dlg.GetPath() ) );
|
||||
return;
|
||||
}
|
||||
|
@ -1309,9 +1309,10 @@ void ALTIUM_PCB::ParseModelsData( const CFB::CompoundFileReader& aReader,
|
||||
aReader.ReadFile( stepEntry, 0, stepContent.get(), stepSize );
|
||||
|
||||
wxFileName storagePath( altiumModelsPath.GetPath(), elem.name );
|
||||
|
||||
if( !storagePath.IsDirWritable() )
|
||||
{
|
||||
wxLogError( _( "You do not have write permissions to save file '%s'." ),
|
||||
wxLogError( _( "Insufficient permissions to save file '%s'." ),
|
||||
storagePath.GetFullPath() );
|
||||
continue;
|
||||
}
|
||||
|
@ -979,7 +979,7 @@ bool GPCB_PLUGIN::FootprintLibDelete( const wxString& aLibraryPath, const PROPER
|
||||
|
||||
if( !fn.IsDirWritable() )
|
||||
{
|
||||
THROW_IO_ERROR( wxString::Format( _( "user does not have permission to delete directory \"%s\"" ),
|
||||
THROW_IO_ERROR( wxString::Format( _( "Insufficient permissions to delete folder '%s'." ),
|
||||
aLibraryPath.GetData() ) );
|
||||
}
|
||||
|
||||
@ -987,7 +987,7 @@ bool GPCB_PLUGIN::FootprintLibDelete( const wxString& aLibraryPath, const PROPER
|
||||
|
||||
if( dir.HasSubDirs() )
|
||||
{
|
||||
THROW_IO_ERROR( wxString::Format( _( "library directory \"%s\" has unexpected sub-directories" ),
|
||||
THROW_IO_ERROR( wxString::Format( _( "Library folder '%s' has unexpected sub-folders." ),
|
||||
aLibraryPath.GetData() ) );
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user