KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PGM_KICAD Class Reference

PGM_KICAD extends PGM_BASE to bring in FileHistory() and PdfBrowser() which were moved from EDA_APP into KIFACE_BASE. More...

#include <pgm_kicad.h>

Inheritance diagram for PGM_KICAD:
PGM_BASE

Public Member Functions

 PGM_KICAD ()
 
 ~PGM_KICAD () throw ()
 
bool OnPgmInit ()
 
void OnPgmExit ()
 
int OnPgmRun ()
 
void MacOpenFile (const wxString &aFileName) override
 Specific to MacOSX (not used under Linux or Windows).
 
APP_SETTINGS_BASEPgmSettings ()
 
SEARCH_STACKSysSearch ()
 
wxString GetHelpFileName ()
 
void Destroy ()
 
void BuildArgvUtf8 ()
 Builds the UTF8 based argv variable.
 
virtual SETTINGS_MANAGERGetSettingsManager () const
 
virtual COMMON_SETTINGSGetCommonSettings () const
 
virtual BACKGROUND_JOBS_MONITORGetBackgroundJobMonitor () const
 
virtual NOTIFICATIONS_MANAGERGetNotificationsManager () const
 
virtual void SetTextEditor (const wxString &aFileName)
 
virtual const wxString & GetTextEditor (bool aCanShowFileChooser=true)
 Return the path to the preferred text editor application.
 
virtual const wxString AskUserForPreferredEditor (const wxString &aDefaultEditor=wxEmptyString)
 Shows a dialog that instructs the user to select a new preferred editor.
 
virtual bool IsKicadEnvVariableDefined () const
 
virtual const wxString & GetKicadEnvVariable () const
 
virtual const wxString & GetExecutablePath () const
 
virtual wxLocale * GetLocale ()
 
virtual const wxString & GetPdfBrowserName () const
 
virtual void SetPdfBrowserName (const wxString &aFileName)
 
virtual bool UseSystemPdfBrowser () const
 
virtual void ForceSystemPdfBrowser (bool aFlg)
 Force the use of system PDF browser, even if a preferred PDF browser is set.
 
virtual bool SetLanguage (wxString &aErrMsg, bool first_time=false)
 Set the dictionary file name for internationalization.
 
bool SetDefaultLanguage (wxString &aErrMsg)
 Set the default language without reference to any preferences.
 
virtual void SetLanguageIdentifier (int menu_id)
 Set in .m_language_id member the wxWidgets language identifier ID from the KiCad menu id (internal menu identifier).
 
virtual int GetSelectedLanguageIdentifier () const
 
virtual wxString GetLanguageTag ()
 
virtual void SetLanguagePath ()
 
virtual void ReadPdfBrowserInfos ()
 Read the PDF browser choice from the common configuration.
 
virtual void WritePdfBrowserInfos ()
 Save the PDF browser choice to the common configuration.
 
virtual bool SetLocalEnvVariable (const wxString &aName, const wxString &aValue)
 Sets the environment variable aName to aValue.
 
virtual void SetLocalEnvVariables ()
 Updates the local environment with the contents of the current ENV_VAR_MAP stored in the COMMON_SETTINGS.
 
virtual ENV_VAR_MAPGetLocalEnvVariables () const
 
virtual wxApp & App ()
 Returns a bare naked wxApp which may come from wxPython, SINGLE_TOP, or kicad.exe.
 
bool InitPgm (bool aHeadless=false, bool aSkipPyInit=false, bool aIsUnitTest=false)
 Initialize this program.
 
void SaveCommonSettings ()
 Save the program (process) settings subset which are stored .kicad_common.
 
void HandleException (std::exception_ptr aPtr)
 A exception handler to be used at the top level if exceptions bubble up that for.
 
void HandleAssert (const wxString &aFile, int aLine, const wxString &aFunc, const wxString &aCond, const wxString &aMsg)
 A common assert handler to be used between single_top and kicad.
 
bool IsGUI ()
 Determine if the application is running with a GUI.
 
void ShowSplash ()
 
void HideSplash ()
 
std::unique_ptr< wxSingleInstanceChecker > & SingleInstance ()
 Allows access to the wxSingleInstanceChecker to test for other running KiCads.
 

Public Attributes

bool m_Printing
 wxWidgets on MSW tends to crash if you spool up more than one print job at a time.
 
std::vector< void * > m_ModalDialogs
 
bool m_Quitting
 
bool m_PropertyGridInitialized
 

Static Public Attributes

static const wxChar workingDirKey []
 

Protected Member Functions

void loadCommonSettings ()
 Loads internal settings from COMMON_SETTINGS.
 
void setLanguageId (int aId)
 Trap all changes in here, simplifies debugging.
 

Protected Attributes

BIN_MOD m_bm
 
std::unique_ptr< SETTINGS_MANAGERm_settings_manager
 
std::unique_ptr< BACKGROUND_JOBS_MONITORm_background_jobs_monitor
 
std::unique_ptr< NOTIFICATIONS_MANAGERm_notifications_manager
 
std::unique_ptr< SCRIPTING > m_python_scripting
 
std::unique_ptr< wxSingleInstanceChecker > m_pgm_checker
 Checks if there is another copy of Kicad running at the same time.
 
wxString m_kicad_env
 
wxLocale * m_locale
 The KICAD system environment variable.
 
int m_language_id
 
bool m_use_system_pdf_browser
 
wxString m_pdf_browser
 
wxString m_text_editor
 Filename of the app selected for browsing PDFs.
 
char ** m_argvUtf8
 
int m_argcUtf8
 argv parameters converted to utf8 form, because wxwidgets has opinions and will return argv as either force converted to ascii in char* or wchar_t only
 
wxSplashScreen * m_splash
 

Detailed Description

PGM_KICAD extends PGM_BASE to bring in FileHistory() and PdfBrowser() which were moved from EDA_APP into KIFACE_BASE.

KIFACE_BASE is not applicable in the project manager since it is not a KIFACE. This header is in the kicad directory since nobody else needs to know about it.

Definition at line 41 of file pgm_kicad.h.

Constructor & Destructor Documentation

◆ PGM_KICAD()

PGM_KICAD::PGM_KICAD ( )
inline

Definition at line 44 of file pgm_kicad.h.

◆ ~PGM_KICAD()

PGM_KICAD::~PGM_KICAD ( )
throw (
)
inline

Definition at line 48 of file pgm_kicad.h.

References Destroy().

Member Function Documentation

◆ App()

wxApp & PGM_BASE::App ( )
virtualinherited

Returns a bare naked wxApp which may come from wxPython, SINGLE_TOP, or kicad.exe.

This should return what wxGetApp() returns.

Definition at line 182 of file pgm_base.cpp.

Referenced by PGM_BASE::BuildArgvUtf8(), DIALOG_SHIM::DIALOG_SHIM(), drawShapes(), PGM_BASE::InitPgm(), PGM_SINGLE_TOP::MacOpenFile(), MacOpenFile(), PGM_TEST_FRAME::MacOpenFile(), OnPgmInit(), playground_main_func(), PROJECT_SCH::SchLibs(), SetTopFrame(), and DIALOG_DRC::updateUI().

◆ AskUserForPreferredEditor()

const wxString PGM_BASE::AskUserForPreferredEditor ( const wxString &  aDefaultEditor = wxEmptyString)
virtualinherited

Shows a dialog that instructs the user to select a new preferred editor.

Parameters
aDefaultEditorDefault full path for the default editor this dialog should show by default.
Returns
Returns the full path of the editor, or an empty string if no editor was chosen.

Definition at line 232 of file pgm_base.cpp.

References _, name, and path.

Referenced by PGM_BASE::GetTextEditor(), and PANEL_COMMON_SETTINGS::OnTextEditorClick().

◆ BuildArgvUtf8()

void PGM_BASE::BuildArgvUtf8 ( )
inherited

Builds the UTF8 based argv variable.

Definition at line 412 of file pgm_base.cpp.

References PGM_BASE::App(), PGM_BASE::m_argcUtf8, and PGM_BASE::m_argvUtf8.

◆ Destroy()

void PGM_KICAD::Destroy ( )

Definition at line 410 of file kicad.cpp.

References PGM_BASE::Destroy(), BIN_MOD::End(), and m_bm.

Referenced by OnPgmExit(), and ~PGM_KICAD().

◆ ForceSystemPdfBrowser()

virtual void PGM_BASE::ForceSystemPdfBrowser ( bool  aFlg)
inlinevirtualinherited

Force the use of system PDF browser, even if a preferred PDF browser is set.

Definition at line 204 of file pgm_base.h.

Referenced by PGM_BASE::PGM_BASE(), and PANEL_COMMON_SETTINGS::TransferDataFromWindow().

◆ GetBackgroundJobMonitor()

◆ GetCommonSettings()

COMMON_SETTINGS * PGM_BASE::GetCommonSettings ( ) const
virtualinherited

Definition at line 679 of file pgm_base.cpp.

References PGM_BASE::m_settings_manager.

Referenced by ACTION_TOOLBAR_PALETTE::AddAction(), KIUI::AddBitmapToMenuItem(), SYMBOL_TREE_MODEL_ADAPTER::AddLibraries(), DESIGN_BLOCK_TREE_MODEL_ADAPTER::AddLibraries(), FP_TREE_MODEL_ADAPTER::AddLibraries(), DIALOG_FOOTPRINT_CHOOSER::build3DCanvas(), CVPCB_MAINFRAME::BuildLibrariesList(), PROJECT_PCB::Cleanup3DCache(), TOOLS_HOLDER::CommonSettingsChanged(), EDA_BASE_FRAME::CommonSettingsChanged(), EDA_DRAW_FRAME::CommonSettingsChanged(), KICAD_MANAGER_FRAME::CommonSettingsChanged(), DESIGN_BLOCK_PREVIEW_WIDGET::DESIGN_BLOCK_PREVIEW_WIDGET(), DIALOG_EXPORT_STEP::DIALOG_EXPORT_STEP(), GERBVIEW_FRAME::GERBVIEW_FRAME(), EDA_BASE_FRAME::GetAutoSaveInterval(), PGM_BASE::GetLocalEnvVariables(), WX_AUI_TOOLBAR_ART::GetToolSize(), EDA_DRAW_PANEL_GAL::GetVcSettings(), SCH_DRAWING_TOOLS::ImportSheet(), PGM_BASE::InitPgm(), KIGFX::PCB_RENDER_SETTINGS::LoadColors(), EDA_3D_VIEWER_FRAME::loadCommonSettings(), PGM_BASE::loadCommonSettings(), PANEL_PREVIEW_3D_MODEL::loadSettings(), KIGFX::WX_VIEW_CONTROLS::LoadSettings(), EDA_BASE_FRAME::LoadSettings(), EDA_DRAW_FRAME::LoadSettings(), APP_SETTINGS_BASE::MigrateFromLegacy(), EESCHEMA_SETTINGS::MigrateFromLegacy(), GERBVIEW_SETTINGS::MigrateFromLegacy(), PROJECT_TREE_PANE::onGitCommit(), DIALOG_CONFIGURE_PATHS::OnGridCellChanging(), KICAD_MANAGER_FRAME::OnIdle(), BITMAP_BUTTON::OnPaint(), SYMBOL_EDITOR_CONTROL::OpenDirectory(), FOOTPRINT_EDITOR_CONTROL::OpenDirectory(), PANEL_EESCHEMA_COLOR_SETTINGS::PANEL_EESCHEMA_COLOR_SETTINGS(), PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES(), PANEL_SETUP_RULES::PANEL_SETUP_RULES(), PANEL_SYMBOL_CHOOSER::PANEL_SYMBOL_CHOOSER(), PROJECT::PinLibrary(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceReferenceImage(), SCH_DRAWING_TOOLS::PlaceSymbol(), DRAWING_TOOL::PlaceText(), PGM_BASE::ReadPdfBrowserInfos(), SCH_EDIT_FRAME::ReCreateHToolbar(), PCB_EDIT_FRAME::ReCreateHToolbar(), SYMBOL_VIEWER_FRAME::ReCreateLibList(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), SAVE_AS_DIALOG::SAVE_AS_DIALOG(), PGM_BASE::SaveCommonSettings(), PCB_BASE_FRAME::SelectLibrary(), SCH_BASE_FRAME::SelectLibraryFromList(), PGM_BASE::SetLanguage(), PGM_BASE::SetLocalEnvVariables(), PANEL_PACKAGES_VIEW::SetSashOnIdle(), PGM_BASE::SetTextEditor(), SYMBOL_PREVIEW_WIDGET::SYMBOL_PREVIEW_WIDGET(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync(), FP_TREE_SYNCHRONIZING_ADAPTER::Sync(), BITMAP_STORE::ThemeChanged(), PANEL_GIT_REPOS::TransferDataFromWindow(), PANEL_COMMON_SETTINGS::TransferDataFromWindow(), PANEL_MOUSE_SETTINGS::TransferDataFromWindow(), PANEL_GIT_REPOS::TransferDataToWindow(), PANEL_COMMON_SETTINGS::TransferDataToWindow(), PANEL_MOUSE_SETTINGS::TransferDataToWindow(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), PCB_CONTROL::unfilledZoneCheck(), PROJECT::UnpinLibrary(), PGM_BASE::WritePdfBrowserInfos(), PANEL_PACKAGES_VIEW::~PANEL_PACKAGES_VIEW(), PANEL_SETUP_NETCLASSES::~PANEL_SETUP_NETCLASSES(), and PANEL_SETUP_RULES::~PANEL_SETUP_RULES().

◆ GetExecutablePath()

◆ GetHelpFileName()

wxString PGM_KICAD::GetHelpFileName ( )
inline

Definition at line 63 of file pgm_kicad.h.

References m_bm, and BIN_MOD::m_help_file.

Referenced by KICAD_MANAGER_FRAME::help_name().

◆ GetKicadEnvVariable()

virtual const wxString & PGM_BASE::GetKicadEnvVariable ( ) const
inlinevirtualinherited

Definition at line 181 of file pgm_base.h.

Referenced by FindKicadFile().

◆ GetLanguageTag()

wxString PGM_BASE::GetLanguageTag ( )
virtualinherited
Returns
the current selected language in rfc3066 format

Definition at line 843 of file pgm_base.cpp.

References PGM_BASE::m_language_id.

Referenced by UPDATE_MANAGER::CheckForUpdate().

◆ GetLocale()

virtual wxLocale * PGM_BASE::GetLocale ( )
inlinevirtualinherited

◆ GetLocalEnvVariables()

◆ GetNotificationsManager()

◆ GetPdfBrowserName()

virtual const wxString & PGM_BASE::GetPdfBrowserName ( ) const
inlinevirtualinherited

◆ GetSelectedLanguageIdentifier()

virtual int PGM_BASE::GetSelectedLanguageIdentifier ( ) const
inlinevirtualinherited
Returns
the wxWidgets language identifier Id of the language currently selected.

Definition at line 238 of file pgm_base.h.

Referenced by InitTables(), and EDA_BASE_FRAME::setupUIConditions().

◆ GetSettingsManager()

virtual SETTINGS_MANAGER & PGM_BASE::GetSettingsManager ( ) const
inlinevirtualinherited

Definition at line 142 of file pgm_base.h.

Referenced by PANEL_DESIGN_BLOCK_LIB_TABLE::browseLibrariesHandler(), PANEL_FP_LIB_TABLE::browseLibrariesHandler(), PANEL_SYM_LIB_TABLE::browseLibrariesHandler(), DIALOG_FOOTPRINT_CHOOSER::build3DCanvas(), FOOTPRINT_CHOOSER_FRAME::build3DCanvas(), PCB_NET_INSPECTOR_PANEL::buildColumns(), PCB_NET_INSPECTOR_PANEL::buildNetsList(), UPDATE_MANAGER::CheckForUpdate(), KICAD_MANAGER_FRAME::CloseProject(), EDA_BASE_FRAME::commonInit(), SCH_EDIT_FRAME::CommonSettingsChanged(), SYMBOL_VIEWER_FRAME::CommonSettingsChanged(), GERBVIEW_FRAME::CommonSettingsChanged(), PL_EDITOR_FRAME::CommonSettingsChanged(), FOOTPRINT_EDIT_FRAME::CommonSettingsChanged(), FOOTPRINT_EDIT_FRAME::config(), PANEL_SYMBOL_CHOOSER::constructRightPanel(), BMP2CMP::IFACE::CreateKiWindow(), PCB::IFACE::CreateKiWindow(), DESIGN_BLOCK_PREVIEW_WIDGET::DESIGN_BLOCK_PREVIEW_WIDGET(), DIALOG_FOOTPRINT_WIZARD_LIST::DIALOG_FOOTPRINT_WIZARD_LIST(), SYMBOL_EDITOR_DRAWING_TOOLS::doDrawShape(), SCH_MOVE_TOOL::doMoveSelection(), GRID_CELL_LAYER_RENDERER::Draw(), BIN_MOD::End(), EVT_TOOL_RANGE(), GERBVIEW_DRAW_PANEL_GAL::GERBVIEW_DRAW_PANEL_GAL(), PCB_EDITOR_CONDITIONS::get45degModeFunc(), PCB_EDIT_FRAME::GetActionPluginButtonVisible(), PCBNEW_JOBS_HANDLER::getBoard(), BOARD_ADAPTER::GetBoardEditorCopperLayerColors(), SCH_MARKER::getColor(), PCB_MARKER::getColor(), FOOTPRINT_CHOOSER_FRAME::GetColorSettings(), EDA_DRAW_FRAME::GetColorSettings(), DISPLAY_FOOTPRINTS_FRAME::GetColorSettings(), SCH_BASE_FRAME::GetColorSettings(), SYMBOL_EDIT_FRAME::GetColorSettings(), GERBVIEW_FRAME::GetColorSettings(), FOOTPRINT_EDIT_FRAME::GetColorSettings(), FOOTPRINT_VIEWER_FRAME::GetColorSettings(), FOOTPRINT_WIZARD_FRAME::GetColorSettings(), PCB_BASE_EDIT_FRAME::GetColorSettings(), SCH_ITEM::GetDefaultFont(), PCB_BASE_FRAME::GetFootprintEditorSettings(), GetLastPinLength(), GetLastPinNameSize(), GetLastPinNumSize(), PCB_LAYER_PRESENTATION::getLayerColor(), GetLayerColor(), BOARD_ADAPTER::GetLayerColors(), DISPLAY_FOOTPRINTS_FRAME::GetMagneticItemsSettings(), PCB_EDIT_FRAME::GetOrderedActionPlugins(), PCB_BASE_FRAME::GetPcbNewSettings(), KICAD_MANAGER_FRAME::GetProjectFileName(), EESCHEMA_JOBS_HANDLER::getSchematic(), FOOTPRINT_EDIT_FRAME::GetSettings(), SCH_BASE_FRAME::GetViewerSettingsBase(), PCB_BASE_FRAME::GetViewerSettingsBase(), DISPLAY_FOOTPRINTS_FRAME::GetViewerSettingsBase(), DISPLAY_FOOTPRINTS_FRAME::GetWindowSettings(), gvconfig(), API_HANDLER_COMMON::handleExpandTextVariables(), API_HANDLER_COMMON::handleGetNetClasses(), HandleJobConfig(), IfaceOrAddress(), DIALOG_EXPORT_2581::Init(), DIALOG_EXPORT_ODBPP::Init(), init_unit_test(), DIALOG_PLOT_SCHEMATIC::initDlg(), PGM_BASE::InitPgm(), EESCHEMA_JOBS_HANDLER::InitRenderSettings(), PCB_TOOL_BASE::Is45Limited(), PCBNEW_JOBS_HANDLER::JobExportPdf(), PCBNEW_JOBS_HANDLER::JobExportRender(), EESCHEMA_JOBS_HANDLER::JobSymExportSvg(), PANEL_EESCHEMA_EDITING_OPTIONS::loadEEschemaSettings(), DESIGN_BLOCK_LIB_TABLE::LoadGlobalTable(), FP_LIB_TABLE::LoadGlobalTable(), SYMBOL_LIB_TABLE::LoadGlobalTable(), loadKicadProject(), KICAD_MANAGER_FRAME::LoadProject(), PANEL_PREVIEW_3D_MODEL::loadSettings(), PCB_TEST_FRAME_BASE::LoadSettings(), SYMBOL_VIEWER_FRAME::LoadSettings(), FOOTPRINT_VIEWER_FRAME::LoadSettings(), PCB_VIEWER_TOOLS::MeasureTool(), EESCHEMA_SETTINGS::MigrateFromLegacy(), GERBVIEW_SETTINGS::MigrateFromLegacy(), FOOTPRINT_EDITOR_SETTINGS::MigrateFromLegacy(), PCBNEW_SETTINGS::MigrateFromLegacy(), PCB_NET_INSPECTOR_PANEL::netFilterMatches(), FOOTPRINT_PREVIEW_PANEL::New(), KICAD_MANAGER_CONTROL::NewFromTemplate(), PCB_NET_INSPECTOR_PANEL::OnBoardChanged(), PCB_NET_INSPECTOR_PANEL::OnConfigButton(), LIB_TREE::onDetailsLink(), PANEL_PACKAGES_VIEW::OnDownloadVersionClicked(), CV::IFACE::OnKifaceStart(), SCH::IFACE::OnKifaceStart(), GERBV::IFACE::OnKifaceStart(), PGE::IFACE::OnKifaceStart(), PCBCALC::IFACE::OnKifaceStart(), PCB::IFACE::OnKifaceStart(), DIALOG_PCM::OnManageRepositoriesClicked(), DIALOG_CONFIG_EQUFILES::OnOkClick(), OnPgmInit(), PANEL_COLOR_SETTINGS::OnThemeChanged(), PANEL_DESIGN_BLOCK_CHOOSER::PANEL_DESIGN_BLOCK_CHOOSER(), PANEL_DESIGN_BLOCK_LIB_TABLE::PANEL_DESIGN_BLOCK_LIB_TABLE(), PANEL_EESCHEMA_COLOR_SETTINGS::PANEL_EESCHEMA_COLOR_SETTINGS(), PANEL_FP_EDITOR_COLOR_SETTINGS::PANEL_FP_EDITOR_COLOR_SETTINGS(), PANEL_FP_LIB_TABLE::PANEL_FP_LIB_TABLE(), PANEL_FP_PROPERTIES_3D_MODEL::PANEL_FP_PROPERTIES_3D_MODEL(), PANEL_GERBVIEW_COLOR_SETTINGS::PANEL_GERBVIEW_COLOR_SETTINGS(), PANEL_GERBVIEW_DISPLAY_OPTIONS::PANEL_GERBVIEW_DISPLAY_OPTIONS(), PANEL_PCBNEW_COLOR_SETTINGS::PANEL_PCBNEW_COLOR_SETTINGS(), PANEL_SYM_LIB_TABLE::PANEL_SYM_LIB_TABLE(), PANEL_SYMBOL_CHOOSER::PANEL_SYMBOL_CHOOSER(), PANEL_TEMPLATE_FIELDNAMES::PANEL_TEMPLATE_FIELDNAMES(), PROJECT::PinLibrary(), PL_DRAW_PANEL_GAL::PL_DRAW_PANEL_GAL(), EXPORT_SVG::Plot(), SCH_PLOTTER::Plot(), SCH_SHEET::Plot(), DIALOG_PLOT::Plot(), SCH_SYMBOL::PlotDNP(), POSITION_RELATIVE_TOOL::PositionRelativeInteractively(), SCH_PRINTOUT::PrintPage(), KIWAY::Prj(), EDA_3D_VIEWER_FRAME::Process_Special_Functions(), SCH::readSchematicFromFile(), PIN_LAYOUT_CACHE::recomputeCaches(), BOARD_ADAPTER::ReloadColorSettings(), EDA_3D_CANVAS::RenderEngineChanged(), SCH_EDIT_TOOL::RepeatDrawItem(), SYMBOL_EDITOR_PIN_TOOL::RepeatPin(), PANEL_COLOR_SETTINGS::saveCurrentTheme(), SaveFileAs(), PCB_NET_INSPECTOR_PANEL::SaveSettings(), EDA_3D_VIEWER_FRAME::SaveSettings(), SYMBOL_VIEWER_FRAME::SaveSettings(), GERBVIEW_FRAME::SaveSettings(), SCH_DRAW_PANEL::SCH_DRAW_PANEL(), SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS(), PCB_TEST_FRAME_BASE::SetBoard(), PGM_BASE::SetLanguage(), BOARD_ADAPTER::SetLayerColors(), PANEL_SYM_LIB_TABLE::setupGrid(), PANEL_FP_LIB_TABLE::setupGrid(), PIN_TABLE_DATA_MODEL::SetValue(), KICAD_MANAGER_CONTROL::ShowPluginManager(), EDA_BASE_FRAME::ShowPreferences(), SCH_EDIT_FRAME::ShowSchematicSetupDialog(), SYMBOL_EDIT_FRAME::SYMBOL_EDIT_FRAME(), SYMBOL_PREVIEW_WIDGET::SYMBOL_PREVIEW_WIDGET(), EDA_3D_VIEWER_FRAME::ToggleAppearanceManager(), DRAWING_TOOL::ToggleHV45Mode(), PANEL_3D_DISPLAY_OPTIONS::TransferDataFromWindow(), PANEL_3D_OPENGL_OPTIONS::TransferDataFromWindow(), PANEL_3D_RAYTRACING_OPTIONS::TransferDataFromWindow(), PANEL_PACKAGES_AND_UPDATES::TransferDataFromWindow(), PANEL_EESCHEMA_ANNOTATION_OPTIONS::TransferDataFromWindow(), PANEL_EESCHEMA_COLOR_SETTINGS::TransferDataFromWindow(), PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataFromWindow(), PANEL_EESCHEMA_EDITING_OPTIONS::TransferDataFromWindow(), PANEL_SIMULATOR_PREFERENCES::TransferDataFromWindow(), PANEL_SYM_COLOR_SETTINGS::TransferDataFromWindow(), PANEL_SYM_DISPLAY_OPTIONS::TransferDataFromWindow(), PANEL_SYM_EDITING_OPTIONS::TransferDataFromWindow(), PANEL_TEMPLATE_FIELDNAMES::TransferDataFromWindow(), PANEL_GERBVIEW_COLOR_SETTINGS::TransferDataFromWindow(), PANEL_GERBVIEW_DISPLAY_OPTIONS::TransferDataFromWindow(), PANEL_GERBVIEW_EXCELLON_SETTINGS::TransferDataFromWindow(), PANEL_COMMON_SETTINGS::TransferDataFromWindow(), PANEL_PLUGIN_SETTINGS::TransferDataFromWindow(), DIALOG_UPDATE_CHECK_PROMPT::TransferDataFromWindow(), PANEL_PL_EDITOR_COLOR_SETTINGS::TransferDataFromWindow(), DIALOG_EXPORT_2581::TransferDataFromWindow(), DIALOG_EXPORT_ODBPP::TransferDataFromWindow(), PANEL_EDIT_OPTIONS::TransferDataFromWindow(), PANEL_FP_EDITOR_COLOR_SETTINGS::TransferDataFromWindow(), PANEL_FP_EDITOR_DEFAULTS::TransferDataFromWindow(), PANEL_PCB_DISPLAY_OPTIONS::TransferDataFromWindow(), PANEL_PCBNEW_COLOR_SETTINGS::TransferDataFromWindow(), PANEL_3D_DISPLAY_OPTIONS::TransferDataToWindow(), PANEL_3D_OPENGL_OPTIONS::TransferDataToWindow(), PANEL_3D_RAYTRACING_OPTIONS::TransferDataToWindow(), PANEL_PACKAGES_AND_UPDATES::TransferDataToWindow(), PANEL_EESCHEMA_ANNOTATION_OPTIONS::TransferDataToWindow(), PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataToWindow(), PANEL_EESCHEMA_EDITING_OPTIONS::TransferDataToWindow(), PANEL_SIMULATOR_PREFERENCES::TransferDataToWindow(), PANEL_SYM_COLOR_SETTINGS::TransferDataToWindow(), PANEL_SYM_DISPLAY_OPTIONS::TransferDataToWindow(), PANEL_SYM_EDITING_OPTIONS::TransferDataToWindow(), PANEL_GERBVIEW_DISPLAY_OPTIONS::TransferDataToWindow(), PANEL_GERBVIEW_EXCELLON_SETTINGS::TransferDataToWindow(), PANEL_PLUGIN_SETTINGS::TransferDataToWindow(), PANEL_PL_EDITOR_COLOR_SETTINGS::TransferDataToWindow(), PANEL_EDIT_OPTIONS::TransferDataToWindow(), PANEL_FP_EDITOR_DEFAULTS::TransferDataToWindow(), PANEL_PCB_DISPLAY_OPTIONS::TransferDataToWindow(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), PROJECT::UnpinLibrary(), PCB_DRAW_PANEL_GAL::UpdateColors(), DRAWING_TOOL::UpdateStatusBar(), KIGFX::PCB_PAINTER::viewer_settings(), DIALOG_FOOTPRINT_WIZARD_LIST::~DIALOG_FOOTPRINT_WIZARD_LIST(), PANEL_FOOTPRINT_CHOOSER::~PANEL_FOOTPRINT_CHOOSER(), and SYMBOL_EDIT_FRAME::~SYMBOL_EDIT_FRAME().

◆ GetTextEditor()

const wxString & PGM_BASE::GetTextEditor ( bool  aCanShowFileChooser = true)
virtualinherited

Return the path to the preferred text editor application.

Parameters
aCanShowFileChooserIf no editor is currently set and this argument is 'true' then this method will show a file chooser dialog asking for the editor's executable.
Returns
Returns the full path of the editor, or an empty string if no editor has been set.

Definition at line 196 of file pgm_base.cpp.

References _, PGM_BASE::AskUserForPreferredEditor(), DisplayInfoMessage(), PGM_BASE::m_text_editor, and PGM_BASE::SetTextEditor().

Referenced by KICAD_MANAGER_CONTROL::Execute(), DIALOG_CONFIG_EQUFILES::OnEditEquFile(), DIALOG_BOM::OnEditGenerator(), PROJECT_TREE_PANE::onOpenSelectedFileWithTextEditor(), SYMBOL_EDITOR_CONTROL::OpenWithTextEditor(), FOOTPRINT_EDITOR_CONTROL::OpenWithTextEditor(), and GERBVIEW_INSPECTION_TOOL::ShowSource().

◆ HandleAssert()

void PGM_BASE::HandleAssert ( const wxString &  aFile,
int  aLine,
const wxString &  aFunc,
const wxString &  aCond,
const wxString &  aMsg 
)
inherited

A common assert handler to be used between single_top and kicad.

This lets us have a common set of assert handling, including triggering sentry reports

Parameters
aFilethe file path of the assert
aLinethe line number of the assert
aFuncthe function name the assert is within
aCondthe condition of the assert
aMsgthe attached assert message (can be empty)

Definition at line 996 of file pgm_base.cpp.

◆ HandleException()

void PGM_BASE::HandleException ( std::exception_ptr  aPtr)
inherited

A exception handler to be used at the top level if exceptions bubble up that for.

The purpose is to have a central place to log a wxWidgets error message and/or sentry report

Parameters
aPtrPass the std::current_exception() from within the catch block

Definition at line 939 of file pgm_base.cpp.

References From_UTF8(), name, and IO_ERROR::What().

Referenced by KIWAY::KiFACE(), APP_SINGLE_TOP::OnInit(), APP_SINGLE_TOP::OnRun(), APP_KICAD::OnRun(), APP_KICAD_CLI::OnRun(), and KIWAY::Player().

◆ HideSplash()

void PGM_BASE::HideSplash ( )
inherited

◆ InitPgm()

bool PGM_BASE::InitPgm ( bool  aHeadless = false,
bool  aSkipPyInit = false,
bool  aIsUnitTest = false 
)
inherited

Initialize this program.

Initialize the process in a KiCad standard way using some generalized techniques:

  • Default paths (help, libs, bin) and configuration file names
  • Language and locale
  • fonts
Note
Do not initialize anything relating to DSOs or projects.
Parameters
aHeadlessIf true, run in headless mode (e.g. for unit tests)
aSkipPyInitIf true, do not init python stuff. Useful in application that do not use python, to disable python dependency at run time
Returns
true if success, false if failure and program is to terminate.

Should never happen but boost unit_test isn't playing nicely in some cases

Definition at line 457 of file pgm_base.cpp.

References _, PGM_BASE::App(), DisplayErrorMessage(), PATHS::EnsurePathExists(), PATHS::EnsureUserPathsExist(), ADVANCED_CFG::GetCfg(), PGM_BASE::GetCommonSettings(), PATHS::GetInstanceCheckerPath(), GetMajorMinorVersion(), PGM_BASE::GetNotificationsManager(), PGM_BASE::GetSettingsManager(), KICAD_CURL::Init(), COMMON_SETTINGS::InitializeEnvironment(), NOTIFICATIONS_MANAGER::Load(), SETTINGS_MANAGER::Load(), PGM_BASE::loadCommonSettings(), SETTINGS_MANAGER::LoadProject(), COMMON_SETTINGS::m_Api, PGM_BASE::m_background_jobs_monitor, PGM_BASE::m_kicad_env, PGM_BASE::m_notifications_manager, PGM_BASE::m_pgm_checker, PGM_BASE::m_python_scripting, PGM_BASE::m_settings_manager, COMMON_SETTINGS::API::python_interpreter, PGM_BASE::ReadPdfBrowserInfos(), PGM_BASE::SetDefaultLanguage(), PGM_BASE::SetLanguage(), PGM_BASE::SetLanguagePath(), PGM_BASE::ShowSplash(), UNIX_STRING_DIR_SEP, WarnUserIfOperatingSystemUnsupported(), WIN_STRING_DIR_SEP, and wxPGGlobalVars.

Referenced by init_unit_test(), main(), and OnPgmInit().

◆ IsGUI()

bool PGM_BASE::IsGUI ( )
inherited

Determine if the application is running with a GUI.

Returns
true if there is a GUI and false otherwise

Definition at line 930 of file pgm_base.cpp.

◆ IsKicadEnvVariableDefined()

virtual bool PGM_BASE::IsKicadEnvVariableDefined ( ) const
inlinevirtualinherited

Definition at line 179 of file pgm_base.h.

◆ loadCommonSettings()

void PGM_BASE::loadCommonSettings ( )
protectedinherited

◆ MacOpenFile()

void PGM_KICAD::MacOpenFile ( const wxString &  aFileName)
overridevirtual

Specific to MacOSX (not used under Linux or Windows).

MacOSX requires it for file association.

See also
http://wiki.wxwidgets.org/WxMac-specific_topics

Implements PGM_BASE.

Definition at line 397 of file kicad.cpp.

References PGM_BASE::App(), and KICAD_MANAGER_FRAME::LoadProject().

◆ OnPgmExit()

◆ OnPgmInit()

◆ OnPgmRun()

int PGM_KICAD::OnPgmRun ( )

Definition at line 369 of file kicad.cpp.

Referenced by APP_KICAD_CLI::OnRun().

◆ PgmSettings()

APP_SETTINGS_BASE * PGM_KICAD::PgmSettings ( )
inline

Definition at line 59 of file pgm_kicad.h.

References m_bm, and BIN_MOD::m_config.

Referenced by KICAD_MANAGER_FRAME::config(), and OnPgmInit().

◆ ReadPdfBrowserInfos()

void PGM_BASE::ReadPdfBrowserInfos ( )
virtualinherited

◆ SaveCommonSettings()

void PGM_BASE::SaveCommonSettings ( )
inherited

Save the program (process) settings subset which are stored .kicad_common.

Definition at line 670 of file pgm_base.cpp.

References PGM_BASE::GetCommonSettings(), COMMON_SETTINGS::m_System, and COMMON_SETTINGS::SYSTEM::working_dir.

Referenced by PGM_SINGLE_TOP::OnPgmExit(), and OnPgmExit().

◆ SetDefaultLanguage()

bool PGM_BASE::SetDefaultLanguage ( wxString &  aErrMsg)
inherited

Set the default language without reference to any preferences.

Can be used to set the language for dialogs that show before preferences are loaded

Parameters
aErrMsgString to return the error message(s) in
Returns
false if the language could not be set

Definition at line 786 of file pgm_base.cpp.

References _, PGM_BASE::m_language_id, PGM_BASE::m_locale, PGM_BASE::setLanguageId(), and traceLocale.

Referenced by PGM_BASE::InitPgm().

◆ SetLanguage()

bool PGM_BASE::SetLanguage ( wxString &  aErrMsg,
bool  first_time = false 
)
virtualinherited

Set the dictionary file name for internationalization.

The files are in kicad/internat/xx or kicad/internat/xx_XX and are named kicad.mo

Parameters
aErrMsgis the string to return the error message it.
first_timemust be set to true the first time this function is called, false otherwise.
Returns
false if there was an error setting the language.

Definition at line 685 of file pgm_base.cpp.

References _, PGM_BASE::GetCommonSettings(), PGM_BASE::GetSettingsManager(), COMMON_SETTINGS::SYSTEM::language, LanguagesList, LANGUAGE_DESCR::m_KI_Lang_Identifier, LANGUAGE_DESCR::m_Lang_Label, PGM_BASE::m_language_id, PGM_BASE::m_locale, COMMON_SETTINGS::m_System, JSON_SETTINGS::SaveToFile(), PGM_BASE::setLanguageId(), and traceLocale.

Referenced by PGM_BASE::InitPgm(), and KIWAY::SetLanguage().

◆ setLanguageId()

void PGM_BASE::setLanguageId ( int  aId)
inlineprotectedinherited

Trap all changes in here, simplifies debugging.

Definition at line 399 of file pgm_base.h.

Referenced by PGM_BASE::PGM_BASE(), PGM_BASE::SetDefaultLanguage(), PGM_BASE::SetLanguage(), and PGM_BASE::SetLanguageIdentifier().

◆ SetLanguageIdentifier()

void PGM_BASE::SetLanguageIdentifier ( int  menu_id)
virtualinherited

Set in .m_language_id member the wxWidgets language identifier ID from the KiCad menu id (internal menu identifier).

Parameters
menu_idThe KiCad menuitem id (returned by Menu Event, when clicking on a menu item)

Definition at line 827 of file pgm_base.cpp.

References arrayDim(), LanguagesList, LANGUAGE_DESCR::m_KI_Lang_Identifier, PGM_BASE::setLanguageId(), and traceLocale.

Referenced by KIWAY::SetLanguage().

◆ SetLanguagePath()

void PGM_BASE::SetLanguagePath ( )
virtualinherited

Definition at line 859 of file pgm_base.cpp.

References PGM_BASE::GetExecutablePath(), PATHS::GetLocaleDataPath(), and Pgm().

Referenced by PGM_BASE::InitPgm().

◆ SetLocalEnvVariable()

bool PGM_BASE::SetLocalEnvVariable ( const wxString &  aName,
const wxString &  aValue 
)
virtualinherited

Sets the environment variable aName to aValue.

This function first checks to see if the environment variable aName is already defined. If it is not defined, then the environment variable aName is set to a value. Otherwise, the environment variable is left unchanged. This allows the user to override environment variables for testing purposes.

Parameters
aNameis a wxString containing the environment variable name.
aValueis a wxString containing the environment variable value.
Returns
true if the environment variable Name was set to aValue.

Definition at line 877 of file pgm_base.cpp.

References traceEnvVars.

Referenced by PGM_BASE::loadCommonSettings().

◆ SetLocalEnvVariables()

void PGM_BASE::SetLocalEnvVariables ( )
virtualinherited

Updates the local environment with the contents of the current ENV_VAR_MAP stored in the COMMON_SETTINGS.

See also
GetLocalEnvVariables()

Definition at line 908 of file pgm_base.cpp.

References PGM_BASE::GetCommonSettings(), and traceEnvVars.

Referenced by DIALOG_CONFIGURE_PATHS::TransferDataFromWindow().

◆ SetPdfBrowserName()

virtual void PGM_BASE::SetPdfBrowserName ( const wxString &  aFileName)
inlinevirtualinherited

◆ SetTextEditor()

void PGM_BASE::SetTextEditor ( const wxString &  aFileName)
virtualinherited

◆ ShowSplash()

void PGM_BASE::ShowSplash ( )
inherited

Definition at line 427 of file pgm_base.cpp.

References KiBitmap(), and PGM_BASE::m_splash.

Referenced by PGM_BASE::InitPgm().

◆ SingleInstance()

std::unique_ptr< wxSingleInstanceChecker > & PGM_BASE::SingleInstance ( )
inlineinherited

Allows access to the wxSingleInstanceChecker to test for other running KiCads.

Definition at line 378 of file pgm_base.h.

◆ SysSearch()

SEARCH_STACK & PGM_KICAD::SysSearch ( )
inline

Definition at line 61 of file pgm_kicad.h.

References m_bm, and BIN_MOD::m_search.

Referenced by KICAD_MANAGER_FRAME::sys_search().

◆ UseSystemPdfBrowser()

virtual bool PGM_BASE::UseSystemPdfBrowser ( ) const
inlinevirtualinherited
Returns
true if the PDF browser is the default (system) PDF browser and false if the PDF browser is the preferred (selected) browser, else returns false if there is no selected browser.

Definition at line 196 of file pgm_base.h.

◆ WritePdfBrowserInfos()

void PGM_BASE::WritePdfBrowserInfos ( )
virtualinherited

Member Data Documentation

◆ m_argcUtf8

int PGM_BASE::m_argcUtf8
protectedinherited

argv parameters converted to utf8 form, because wxwidgets has opinions and will return argv as either force converted to ascii in char* or wchar_t only

Definition at line 441 of file pgm_base.h.

Referenced by PGM_BASE::BuildArgvUtf8(), PGM_BASE::PGM_BASE(), and PGM_BASE::~PGM_BASE().

◆ m_argvUtf8

char** PGM_BASE::m_argvUtf8
protectedinherited

Definition at line 438 of file pgm_base.h.

Referenced by PGM_BASE::BuildArgvUtf8(), PGM_BASE::PGM_BASE(), and PGM_BASE::~PGM_BASE().

◆ m_background_jobs_monitor

std::unique_ptr<BACKGROUND_JOBS_MONITOR> PGM_BASE::m_background_jobs_monitor
protectedinherited

Definition at line 409 of file pgm_base.h.

Referenced by PGM_BASE::InitPgm().

◆ m_bm

BIN_MOD PGM_KICAD::m_bm
protected

Definition at line 72 of file pgm_kicad.h.

Referenced by Destroy(), GetHelpFileName(), OnPgmInit(), PgmSettings(), and SysSearch().

◆ m_kicad_env

wxString PGM_BASE::m_kicad_env
protectedinherited

Definition at line 422 of file pgm_base.h.

Referenced by PGM_BASE::InitPgm().

◆ m_language_id

int PGM_BASE::m_language_id
protectedinherited

◆ m_locale

wxLocale* PGM_BASE::m_locale
protectedinherited

The KICAD system environment variable.

Definition at line 424 of file pgm_base.h.

Referenced by PGM_BASE::PGM_BASE(), PGM_BASE::SetDefaultLanguage(), PGM_BASE::SetLanguage(), and PGM_BASE::~PGM_BASE().

◆ m_ModalDialogs

std::vector<void*> PGM_BASE::m_ModalDialogs
inherited

◆ m_notifications_manager

std::unique_ptr<NOTIFICATIONS_MANAGER> PGM_BASE::m_notifications_manager
protectedinherited

Definition at line 410 of file pgm_base.h.

Referenced by PGM_BASE::InitPgm().

◆ m_pdf_browser

wxString PGM_BASE::m_pdf_browser
protectedinherited

Definition at line 428 of file pgm_base.h.

◆ m_pgm_checker

std::unique_ptr<wxSingleInstanceChecker> PGM_BASE::m_pgm_checker
protectedinherited

Checks if there is another copy of Kicad running at the same time.

Definition at line 415 of file pgm_base.h.

Referenced by PGM_BASE::Destroy(), and PGM_BASE::InitPgm().

◆ m_Printing

bool PGM_BASE::m_Printing
inherited

wxWidgets on MSW tends to crash if you spool up more than one print job at a time.

Definition at line 386 of file pgm_base.h.

Referenced by DIALOG_PRINT_GENERIC::onPrintButtonClick(), PGM_BASE::PGM_BASE(), and DIALOG_PRINT_USING_PRINTER::TransferDataFromWindow().

◆ m_PropertyGridInitialized

bool PGM_BASE::m_PropertyGridInitialized
inherited

Definition at line 392 of file pgm_base.h.

Referenced by PGM_BASE::PGM_BASE(), and PROPERTIES_PANEL::PROPERTIES_PANEL().

◆ m_python_scripting

std::unique_ptr<SCRIPTING> PGM_BASE::m_python_scripting
protectedinherited

Definition at line 412 of file pgm_base.h.

Referenced by PGM_BASE::InitPgm().

◆ m_Quitting

bool PGM_BASE::m_Quitting
inherited

Definition at line 390 of file pgm_base.h.

Referenced by KICAD_MANAGER_FRAME::doCloseWindow(), and PGM_BASE::PGM_BASE().

◆ m_settings_manager

std::unique_ptr<SETTINGS_MANAGER> PGM_BASE::m_settings_manager
protectedinherited

◆ m_splash

wxSplashScreen* PGM_BASE::m_splash
protectedinherited

Definition at line 443 of file pgm_base.h.

Referenced by PGM_BASE::HideSplash(), PGM_BASE::PGM_BASE(), and PGM_BASE::ShowSplash().

◆ m_text_editor

wxString PGM_BASE::m_text_editor
protectedinherited

Filename of the app selected for browsing PDFs.

Definition at line 430 of file pgm_base.h.

Referenced by PGM_BASE::GetTextEditor(), PGM_BASE::loadCommonSettings(), and PGM_BASE::SetTextEditor().

◆ m_use_system_pdf_browser

bool PGM_BASE::m_use_system_pdf_browser
protectedinherited

Definition at line 427 of file pgm_base.h.

Referenced by PGM_BASE::ReadPdfBrowserInfos(), and PGM_BASE::WritePdfBrowserInfos().

◆ workingDirKey

const wxChar PGM_BASE::workingDirKey[]
staticinherited

Definition at line 287 of file pgm_base.h.


The documentation for this class was generated from the following files: