![]() |
KiCad PCB EDA Suite
|
Public Member Functions | |
bool | OnPgmInit () |
void | OnPgmExit () |
void | MacOpenFile (const wxString &aFileName) override |
Specific to MacOSX (not used under Linux or Windows). More... | |
virtual SETTINGS_MANAGER & | GetSettingsManager () const |
virtual COMMON_SETTINGS * | GetCommonSettings () const |
virtual void | SetTextEditor (const wxString &aFileName) |
virtual const wxString & | GetTextEditor (bool aCanShowFileChooser=true) |
Return the path to the preferred text editor application. More... | |
virtual const wxString | AskUserForPreferredEditor (const wxString &aDefaultEditor=wxEmptyString) |
Shows a dialog that instructs the user to select a new preferred editor. More... | |
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. More... | |
virtual bool | SetLanguage (wxString &aErrMsg, bool first_time=false) |
Set the dictionary file name for internationalization. More... | |
bool | SetDefaultLanguage (wxString &aErrMsg) |
Set the default language without reference to any preferences. More... | |
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). More... | |
virtual int | GetSelectedLanguageIdentifier () const |
virtual void | SetLanguagePath () |
virtual void | ReadPdfBrowserInfos () |
Read the PDF browser choice from the common configuration. More... | |
virtual void | WritePdfBrowserInfos () |
Save the PDF browser choice to the common configuration. More... | |
virtual bool | SetLocalEnvVariable (const wxString &aName, const wxString &aValue) |
Sets the environment variable aName to aValue. More... | |
virtual void | SetLocalEnvVariables () |
Updates the local environment with the contents of the current ENV_VAR_MAP stored in the COMMON_SETTINGS. More... | |
virtual ENV_VAR_MAP & | GetLocalEnvVariables () const |
virtual wxApp & | App () |
Returns a bare naked wxApp which may come from wxPython, SINGLE_TOP, or kicad.exe. More... | |
bool | InitPgm (bool aHeadless=false, bool aSkipPyInit=false) |
Initialize this program. More... | |
void | Destroy () |
void | SaveCommonSettings () |
Save the program (process) settings subset which are stored .kicad_common. More... | |
Public Attributes | |
bool | m_Printing |
wxWidgets on MSW tends to crash if you spool up more than one print job at a time. More... | |
int | m_ModalDialogCount |
bool | m_Quitting |
Static Public Attributes | |
static const wxChar | workingDirKey [] |
Protected Member Functions | |
void | loadCommonSettings () |
Loads internal settings from COMMON_SETTINGS. More... | |
void | setLanguageId (int aId) |
Trap all changes in here, simplifies debugging. More... | |
bool | setExecutablePath () |
Find the path to the executable and stores it in PGM_BASE::m_bin_dir. More... | |
Protected Attributes | |
std::unique_ptr< SETTINGS_MANAGER > | m_settings_manager |
std::unique_ptr< SCRIPTING > | m_python_scripting |
wxString | m_bin_dir |
wxString | m_kicad_env |
full path to this program More... | |
wxLocale * | m_locale |
The KICAD system environment variable. More... | |
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. More... | |
Definition at line 79 of file mocks_eeschema.cpp.
|
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 135 of file pgm_base.cpp.
Referenced by PGM_BASE::InitPgm(), PGM_KICAD::MacOpenFile(), PGM_SINGLE_TOP::MacOpenFile(), MacOpenFile(), and PGM_KICAD::OnPgmInit().
|
virtualinherited |
Shows a dialog that instructs the user to select a new preferred editor.
aDefaultEditor | Default full path for the default editor this dialog should show by default. |
Definition at line 185 of file pgm_base.cpp.
Referenced by PGM_BASE::GetTextEditor().
|
inherited |
Definition at line 127 of file pgm_base.cpp.
References PGM_BASE::m_locale.
Referenced by CreateWindow(), PGM_KICAD::Destroy(), PGM_SINGLE_TOP::OnPgmExit(), and PGM_BASE::~PGM_BASE().
|
inlinevirtualinherited |
Force the use of system PDF browser, even if a preferred PDF browser is set.
Definition at line 181 of file pgm_base.h.
References PGM_BASE::m_use_system_pdf_browser.
Referenced by PGM_BASE::PGM_BASE().
|
virtualinherited |
Definition at line 385 of file pgm_base.cpp.
References PGM_BASE::m_settings_manager.
Referenced by PGM_BASE::GetLocalEnvVariables(), PGM_BASE::InitPgm(), PGM_BASE::loadCommonSettings(), PGM_BASE::ReadPdfBrowserInfos(), PGM_BASE::SaveCommonSettings(), PGM_BASE::SetLanguage(), PGM_BASE::SetLocalEnvVariables(), PGM_BASE::SetTextEditor(), and PGM_BASE::WritePdfBrowserInfos().
|
inlinevirtualinherited |
Definition at line 160 of file pgm_base.h.
References PGM_BASE::m_bin_dir.
Referenced by PGM_SINGLE_TOP::OnPgmInit(), and PGM_BASE::SetLanguagePath().
|
inlinevirtualinherited |
|
inlinevirtualinherited |
Definition at line 162 of file pgm_base.h.
References PGM_BASE::m_locale.
|
virtualinherited |
Definition at line 600 of file pgm_base.cpp.
References PGM_BASE::GetCommonSettings(), COMMON_SETTINGS::m_Env, and COMMON_SETTINGS::ENVIRONMENT::vars.
Referenced by FILENAME_RESOLVER::GetKicadPaths(), and PGM_KICAD::OnPgmInit().
|
inlinevirtualinherited |
Definition at line 164 of file pgm_base.h.
References PGM_BASE::m_pdf_browser.
Referenced by PGM_BASE::WritePdfBrowserInfos().
|
inlinevirtualinherited |
Definition at line 215 of file pgm_base.h.
References PGM_BASE::m_language_id.
|
inlinevirtualinherited |
Definition at line 129 of file pgm_base.h.
References PGM_BASE::m_settings_manager.
Referenced by PGM_BASE::InitPgm(), LIB_PIN::LIB_PIN(), PCBCALC::IFACE::OnKifaceStart(), CV::IFACE::OnKifaceStart(), PGE::IFACE::OnKifaceStart(), GERBV::IFACE::OnKifaceStart(), PCB::IFACE::OnKifaceStart(), SCH::IFACE::OnKifaceStart(), PGM_KICAD::OnPgmInit(), SCH::readSchematicFromFile(), and PGM_BASE::SetLanguage().
|
virtualinherited |
Return the path to the preferred text editor application.
aCanShowFileChooser | If 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. |
Definition at line 149 of file pgm_base.cpp.
References _, PGM_BASE::AskUserForPreferredEditor(), DisplayInfoMessage(), PGM_BASE::m_text_editor, and PGM_BASE::SetTextEditor().
|
inherited |
Initialize this program.
Initialize the process in a KiCad standard way using some generalized techniques:
aHeadless | If true, run in headless mode (e.g. for unit tests) |
aSkipPyInit | If true, do not init python stuff. Useful in application that do not use python, to disable python dependency at run time |
Should never happen but boost unit_test isn't playing nicely in some cases
Definition at line 206 of file pgm_base.cpp.
References _, PGM_BASE::App(), DisplayErrorMessage(), PGM_BASE::GetCommonSettings(), PGM_BASE::GetSettingsManager(), COMMON_SETTINGS::InitializeEnvironment(), SETTINGS_MANAGER::Load(), PGM_BASE::loadCommonSettings(), SETTINGS_MANAGER::LoadProject(), PGM_BASE::m_kicad_env, PGM_BASE::m_python_scripting, PGM_BASE::m_settings_manager, PGM_BASE::ReadPdfBrowserInfos(), PGM_BASE::SetDefaultLanguage(), PGM_BASE::setExecutablePath(), PGM_BASE::SetLanguage(), PGM_BASE::SetLanguagePath(), UNIX_STRING_DIR_SEP, WarnUserIfOperatingSystemUnsupported(), and WIN_STRING_DIR_SEP.
Referenced by PGM_KICAD::OnPgmInit().
|
inlinevirtualinherited |
|
protectedinherited |
Loads internal settings from COMMON_SETTINGS.
Definition at line 349 of file pgm_base.cpp.
References PGM_BASE::GetCommonSettings(), COMMON_SETTINGS::m_System, PGM_BASE::m_text_editor, PROJECT_VAR_NAME, PGM_BASE::SetLocalEnvVariable(), COMMON_SETTINGS::SYSTEM::text_editor, and traceEnvVars.
Referenced by PGM_BASE::InitPgm().
|
inlineoverridevirtual |
Specific to MacOSX (not used under Linux or Windows).
MacOSX requires it for file association.
Implements PGM_BASE.
Definition at line 92 of file mocks_eeschema.cpp.
References PGM_BASE::App(), and KIWAY_PLAYER::OpenProjectFiles().
|
inline |
Definition at line 83 of file mocks_eeschema.cpp.
References Kiway, and KIWAY::OnKiwayEnd().
bool PGM_MOCK_EESCHEMA_FRAME::OnPgmInit | ( | ) |
|
virtualinherited |
Read the PDF browser choice from the common configuration.
Definition at line 37 of file eda_doc.cpp.
References PGM_BASE::GetCommonSettings(), COMMON_SETTINGS::m_System, PGM_BASE::m_use_system_pdf_browser, PGM_BASE::SetPdfBrowserName(), and COMMON_SETTINGS::SYSTEM::use_system_pdf_viewer.
Referenced by PGM_BASE::InitPgm().
|
inherited |
Save the program (process) settings subset which are stored .kicad_common.
Definition at line 376 of file pgm_base.cpp.
References PGM_BASE::GetCommonSettings(), COMMON_SETTINGS::m_System, and COMMON_SETTINGS::SYSTEM::working_dir.
Referenced by PGM_KICAD::OnPgmExit(), and PGM_SINGLE_TOP::OnPgmExit().
|
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
aErrMsg | String to return the error message(s) in |
Definition at line 488 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().
|
protectedinherited |
Find the path to the executable and stores it in PGM_BASE::m_bin_dir.
Definition at line 307 of file pgm_base.cpp.
References PGM_BASE::m_bin_dir, UNIX_STRING_DIR_SEP, and WIN_STRING_DIR_SEP.
Referenced by PGM_BASE::InitPgm().
|
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
aErrMsg | is the string to return the error message it. |
first_time | must be set to true the first time this function is called, false otherwise. |
Definition at line 391 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().
|
inlineprotectedinherited |
Trap all changes in here, simplifies debugging.
Definition at line 302 of file pgm_base.h.
References PGM_BASE::m_language_id.
Referenced by PGM_BASE::PGM_BASE(), PGM_BASE::SetDefaultLanguage(), PGM_BASE::SetLanguage(), and PGM_BASE::SetLanguageIdentifier().
|
virtualinherited |
Set in .m_language_id member the wxWidgets language identifier ID from the KiCad menu id (internal menu identifier).
menu_id | The KiCad menuitem id (returned by Menu Event, when clicking on a menu item) |
Definition at line 526 of file pgm_base.cpp.
References arrayDim(), LanguagesList, LANGUAGE_DESCR::m_KI_Lang_Identifier, PGM_BASE::setLanguageId(), and traceLocale.
|
virtualinherited |
Definition at line 542 of file pgm_base.cpp.
References PGM_BASE::GetExecutablePath(), PATHS::GetLocaleDataPath(), and Pgm().
Referenced by PGM_BASE::InitPgm().
|
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.
aName | is a wxString containing the environment variable name. |
aValue | is a wxString containing the environment variable value. |
Definition at line 556 of file pgm_base.cpp.
References traceEnvVars.
Referenced by PGM_BASE::loadCommonSettings().
|
virtualinherited |
Updates the local environment with the contents of the current ENV_VAR_MAP stored in the COMMON_SETTINGS.
Definition at line 585 of file pgm_base.cpp.
References PGM_BASE::GetCommonSettings(), and traceEnvVars.
|
inlinevirtualinherited |
Definition at line 166 of file pgm_base.h.
References PGM_BASE::m_pdf_browser.
Referenced by PGM_BASE::ReadPdfBrowserInfos().
|
virtualinherited |
Definition at line 142 of file pgm_base.cpp.
References PGM_BASE::GetCommonSettings(), COMMON_SETTINGS::m_System, PGM_BASE::m_text_editor, and COMMON_SETTINGS::SYSTEM::text_editor.
Referenced by PGM_BASE::GetTextEditor().
|
inlinevirtualinherited |
Definition at line 173 of file pgm_base.h.
References PGM_BASE::m_pdf_browser, and PGM_BASE::m_use_system_pdf_browser.
|
virtualinherited |
Save the PDF browser choice to the common configuration.
Definition at line 44 of file eda_doc.cpp.
References PGM_BASE::GetCommonSettings(), PGM_BASE::GetPdfBrowserName(), COMMON_SETTINGS::m_System, PGM_BASE::m_use_system_pdf_browser, COMMON_SETTINGS::SYSTEM::pdf_viewer_name, and COMMON_SETTINGS::SYSTEM::use_system_pdf_viewer.
|
protectedinherited |
Definition at line 316 of file pgm_base.h.
Referenced by PGM_BASE::GetExecutablePath(), and PGM_BASE::setExecutablePath().
|
protectedinherited |
full path to this program
Definition at line 317 of file pgm_base.h.
Referenced by PGM_BASE::GetKicadEnvVariable(), PGM_BASE::InitPgm(), and PGM_BASE::IsKicadEnvVariableDefined().
|
protectedinherited |
Definition at line 320 of file pgm_base.h.
Referenced by PGM_BASE::GetSelectedLanguageIdentifier(), PGM_BASE::SetDefaultLanguage(), PGM_BASE::SetLanguage(), and PGM_BASE::setLanguageId().
|
protectedinherited |
The KICAD system environment variable.
Definition at line 319 of file pgm_base.h.
Referenced by PGM_BASE::Destroy(), PGM_BASE::GetLocale(), PGM_BASE::PGM_BASE(), PGM_BASE::SetDefaultLanguage(), and PGM_BASE::SetLanguage().
|
inherited |
Definition at line 293 of file pgm_base.h.
Referenced by APP_KICAD::FilterEvent(), and PGM_BASE::PGM_BASE().
|
protectedinherited |
Definition at line 323 of file pgm_base.h.
Referenced by PGM_BASE::GetPdfBrowserName(), PGM_BASE::SetPdfBrowserName(), and PGM_BASE::UseSystemPdfBrowser().
|
inherited |
wxWidgets on MSW tends to crash if you spool up more than one print job at a time.
Definition at line 291 of file pgm_base.h.
Referenced by BOARD::ComputeBoundingBox(), and PGM_BASE::PGM_BASE().
|
protectedinherited |
Definition at line 314 of file pgm_base.h.
Referenced by PGM_BASE::InitPgm().
|
inherited |
Definition at line 295 of file pgm_base.h.
Referenced by PGM_BASE::PGM_BASE().
|
protectedinherited |
Definition at line 312 of file pgm_base.h.
Referenced by PGM_BASE::GetCommonSettings(), PGM_BASE::GetSettingsManager(), PGM_BASE::InitPgm(), PGM_KICAD::OnPgmExit(), and PGM_SINGLE_TOP::OnPgmExit().
|
protectedinherited |
Filename of the app selected for browsing PDFs.
Definition at line 325 of file pgm_base.h.
Referenced by PGM_BASE::GetTextEditor(), PGM_BASE::loadCommonSettings(), and PGM_BASE::SetTextEditor().
|
protectedinherited |
Definition at line 322 of file pgm_base.h.
Referenced by PGM_BASE::ForceSystemPdfBrowser(), PGM_BASE::ReadPdfBrowserInfos(), PGM_BASE::UseSystemPdfBrowser(), and PGM_BASE::WritePdfBrowserInfos().
|
staticinherited |
Definition at line 259 of file pgm_base.h.