65 wxString::Format(
_(
"Error creating design block library table '%s'.\n"
76 if( fileName.IsEmpty() )
78 DisplayError(
this,
_(
"Please select a design block library table file." ) );
82 wxFileName fn = fileName;
85 if( !fn.FileExists() )
87 DisplayError(
this, wxString::Format(
_(
"File '%s' not found." ), fn.GetFullPath() ) );
97 tmpTable.
Load( fn.GetFullPath() );
102 wxString::Format(
_(
"Error reading design block library table '%s'.\n"
104 fn.GetFullPath(), ioe.
What() ) );
111 if( !wxFileName::DirExists( designBlockTableFileName.GetPath() )
112 && !wxFileName::Mkdir( designBlockTableFileName.GetPath(), 0x777, wxPATH_MKDIR_FULL ) )
114 DisplayError(
this, wxString::Format(
_(
"Cannot create global library table '%s'." ),
115 designBlockTableFileName.GetPath() ) );
120 if( !::wxCopyFile( fn.GetFullPath(), designBlockTableFileName.GetFullPath() ) )
124 wxString::Format(
_(
"Error copying global design block library table '%s' "
126 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
DIALOG_GLOBAL_LIB_TABLE_CONFIG(wxWindow *aParent, const wxString &aTableName, const KIWAY::FACE_T aFaceType)
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)
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.