63 wxString::Format(
_(
"Error creating design block library table '%s'.\n"
74 if( fileName.IsEmpty() )
76 DisplayError(
this,
_(
"Please select a design block library table file." ) );
80 wxFileName fn = fileName;
83 if( !fn.FileExists() )
85 DisplayError(
this, wxString::Format(
_(
"File '%s' not found." ), fn.GetFullPath() ) );
94 tmpTable.
Load( fn.GetFullPath() );
99 wxString::Format(
_(
"Error reading design block library table '%s'.\n"
101 fn.GetFullPath(), ioe.
What() ) );
108 if( !designBlockTableFileName.DirExists()
109 && !designBlockTableFileName.Mkdir( 0x777, wxPATH_MKDIR_FULL ) )
111 DisplayError(
this, wxString::Format(
_(
"Cannot create global library table '%s'." ),
112 designBlockTableFileName.GetPath() ) );
117 if( !::wxCopyFile( fn.GetFullPath(), designBlockTableFileName.GetFullPath() ) )
121 wxString::Format(
_(
"Error copying global design block library table '%s' "
123 fn.GetFullPath(), designBlockTableFileName.GetFullPath() ) );
static wxString GetGlobalTableFileName()
static bool LoadGlobalTable(DESIGN_BLOCK_LIB_TABLE &aTable)
Load the global design block library table into aTable.
static DESIGN_BLOCK_LIB_TABLE & GetGlobalLibTable()
virtual wxFileName GetGlobalTableFileName() override
bool TransferDataFromWindow() override
virtual ~DIALOG_GLOBAL_DESIGN_BLOCK_LIB_TABLE_CONFIG()
DIALOG_GLOBAL_DESIGN_BLOCK_LIB_TABLE_CONFIG(wxWindow *aParent)
wxFilePickerCtrl * m_filePicker1
wxRadioButton * m_emptyRb
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.
This file contains miscellaneous commonly used macros and functions.