KiCad PCB EDA Suite
Loading...
Searching...
No Matches
import_local_footprint_libs.cpp File Reference
#include "import_local_footprint_libs.h"
#include <wx/filefn.h>
#include <wx/filename.h>
#include <wx/log.h>
#include <footprint_library_adapter.h>
#include <libraries/library_manager.h>
#include <libraries/library_table.h>
#include <pgm_base.h>
#include <project.h>
#include <project_pcb.h>
#include <reporter.h>
#include <pcb_io/pcb_io_mgr.h>

Go to the source code of this file.

Functions

std::vector< wxString > RegisterLocalFootprintLibraries (PROJECT &aProject, const wxString &aSourceProjectDir, const std::vector< wxString > &aLibraries, REPORTER &aReporter)
 Register the footprint libraries a source project names in the project footprint library table.
 

Function Documentation

◆ RegisterLocalFootprintLibraries()

std::vector< wxString > RegisterLocalFootprintLibraries ( PROJECT & aProject,
const wxString & aSourceProjectDir,
const std::vector< wxString > & aLibraries,
REPORTER & aReporter )

Register the footprint libraries a source project names in the project footprint library table.

A library inside aSourceProjectDir is copied into the project and referenced relative to it; any other library keeps its absolute path. A nickname the table already holds is left alone.

Shared by the project manager's import mail handler and the kicad-cli import job.

Parameters
[in]aProjectis the project whose table receives the rows.
[in]aSourceProjectDiris the directory of the source project.
[in]aLibrariesare the absolute paths of the libraries to register.
[in]aReporterreceives table save errors.
Returns
the nicknames of the rows that were added.

Definition at line 36 of file import_local_footprint_libs.cpp.

References _, LIBRARY_MANAGER::AbortAsyncLoads(), PCB_IO_MGR::FILE_TYPE_NONE, FOOTPRINT, PROJECT_PCB::FootprintLibAdapter(), PGM_BASE::GetLibraryManager(), PROJECT::GetProjectPath(), PCB_IO_MGR::GuessPluginTypeFromLibPath(), FOOTPRINT_LIBRARY_ADAPTER::LoadOne(), LIBRARY_MANAGER::LoadProjectTables(), LIBRARY_ERROR::message, Pgm(), PROJECT, REPORTER::Report(), RPT_SEVERITY_ERROR, LIBRARY_TABLE_ROW::SetNickname(), LIBRARY_TABLE_ROW::SetType(), LIBRARY_TABLE_ROW::SetURI(), PCB_IO_MGR::ShowType(), LIBRARY_MANAGER::Table(), and table.

Referenced by PCB_EDIT_FRAME::KiwayMailIn().