60 DisplayError(
this, wxString::Format(
_(
"Error occurred writing empty footprint "
61 "library table '%s'." ),
63 + wxS(
"\n" ) + ioe.
What() );
71 if( fileName.IsEmpty() )
73 DisplayError(
this,
_(
"Please select a footprint library table file." ) );
77 wxFileName fn = fileName;
80 if( !fn.FileExists() )
82 DisplayError(
this, wxString::Format(
_(
"File '%s' not found." ), fn.GetFullPath() ) );
91 tmpTable.
Load( fn.GetFullPath() );
96 wxString::Format(
_(
"'%s' is not a valid footprint library table." ),
98 + wxS(
"\n" ) + ioe.
What() );
105 if( !fpTableFileName.DirExists() && !fpTableFileName.Mkdir( 0x777, wxPATH_MKDIR_FULL ) )
107 DisplayError(
this, wxString::Format(
_(
"Cannot create library table path '%s'." ),
108 fpTableFileName.GetPath() ) );
113 if( !::wxCopyFile( fn.GetFullPath(), fpTableFileName.GetFullPath() ) )
116 wxString::Format(
_(
"Cannot copy footprint library table from:\n"
120 fn.GetFullPath(), fpTableFileName.GetFullPath() ) );
135 DisplayError(
this,
_(
"Error loading footprint library table." )
136 + wxS(
"\n" ) + ioe.
What() );
virtual wxFileName GetGlobalTableFileName() override
bool TransferDataFromWindow() override
virtual ~DIALOG_GLOBAL_FP_LIB_TABLE_CONFIG()
DIALOG_GLOBAL_FP_LIB_TABLE_CONFIG(wxWindow *aParent)
wxFilePickerCtrl * m_filePicker1
wxRadioButton * m_emptyRb
static bool LoadGlobalTable(FP_LIB_TABLE &aTable)
Load the global footprint library table into aTable.
static wxString GetGlobalTableFileName()
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
void Load(const wxString &aFileName)
Load the library table using the path defined by aFileName aFallBackTable.
void Save(const wxString &aFileName) const
Write this library table to aFileName in s-expression form.
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
This file is part of the common library.
FP_LIB_TABLE GFootprintTable
The global footprint library table.