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... | |
void | BuildArgvUtf8 () |
Builds the UTF8 based argv variable. More... | |
virtual SETTINGS_MANAGER & | GetSettingsManager () const |
virtual COMMON_SETTINGS * | GetCommonSettings () const |
virtual BACKGROUND_JOBS_MONITOR & | GetBackgroundJobMonitor () const |
virtual NOTIFICATIONS_MANAGER & | GetNotificationsManager () 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 wxString | GetLanguageTag () |
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, bool aIsUnitTest=false) |
Initialize this program. More... | |
void | Destroy () |
void | SaveCommonSettings () |
Save the program (process) settings subset which are stored .kicad_common. More... | |
void | HandleException (std::exception_ptr aPtr) |
A exception handler to be used at the top level if exceptions bubble up that for. More... | |
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. More... | |
bool | IsGUI () |
Determine if the application is running with a GUI. More... | |
void | ShowSplash () |
void | HideSplash () |
std::unique_ptr< wxSingleInstanceChecker > & | SingleInstance () |
Allows access to the wxSingleInstanceChecker to test for other running KiCads. 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... | |
std::vector< void * > | m_ModalDialogs |
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... | |
Protected Attributes | |
std::unique_ptr< SETTINGS_MANAGER > | m_settings_manager |
std::unique_ptr< BACKGROUND_JOBS_MONITOR > | m_background_jobs_monitor |
std::unique_ptr< NOTIFICATIONS_MANAGER > | m_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. More... | |
wxString | m_kicad_env |
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... | |
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 More... | |
wxSplashScreen * | m_splash |
Definition at line 95 of file test_app_main.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 173 of file pgm_base.cpp.
Referenced by PGM_BASE::BuildArgvUtf8(), PGM_BASE::InitPgm(), PGM_SINGLE_TOP::MacOpenFile(), PGM_KICAD::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 223 of file pgm_base.cpp.
Referenced by PGM_BASE::GetTextEditor().
|
inherited |
Builds the UTF8 based argv variable.
Definition at line 403 of file pgm_base.cpp.
References PGM_BASE::App(), PGM_BASE::m_argcUtf8, and PGM_BASE::m_argvUtf8.
|
inherited |
Definition at line 157 of file pgm_base.cpp.
References KICAD_CURL::Cleanup(), PGM_BASE::m_locale, and PGM_BASE::m_pgm_checker.
Referenced by PGM_KICAD::Destroy(), PGM_SINGLE_TOP::OnPgmExit(), 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 195 of file pgm_base.h.
References PGM_BASE::m_use_system_pdf_browser.
Referenced by PGM_BASE::PGM_BASE().
|
inlinevirtualinherited |
Definition at line 143 of file pgm_base.h.
References PGM_BASE::m_background_jobs_monitor.
|
virtualinherited |
Definition at line 634 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().
|
virtualinherited |
Definition at line 990 of file pgm_base.cpp.
References PATHS::GetExecutablePath().
Referenced by PGM_SINGLE_TOP::OnPgmInit(), and PGM_BASE::SetLanguagePath().
|
inlinevirtualinherited |
Definition at line 172 of file pgm_base.h.
References PGM_BASE::m_kicad_env.
|
virtualinherited |
Definition at line 798 of file pgm_base.cpp.
References PGM_BASE::m_language_id.
|
inlinevirtualinherited |
Definition at line 176 of file pgm_base.h.
References PGM_BASE::m_locale.
|
virtualinherited |
Definition at line 875 of file pgm_base.cpp.
References PGM_BASE::GetCommonSettings(), COMMON_SETTINGS::m_Env, and COMMON_SETTINGS::ENVIRONMENT::vars.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), FILENAME_RESOLVER::GetKicadPaths(), and PGM_KICAD::OnPgmInit().
|
inlinevirtualinherited |
Definition at line 145 of file pgm_base.h.
References PGM_BASE::m_notifications_manager.
Referenced by PGM_BASE::InitPgm().
|
inlinevirtualinherited |
Definition at line 178 of file pgm_base.h.
References PGM_BASE::m_pdf_browser.
Referenced by PGM_BASE::WritePdfBrowserInfos().
|
inlinevirtualinherited |
Definition at line 229 of file pgm_base.h.
References PGM_BASE::m_language_id.
|
inlinevirtualinherited |
Definition at line 139 of file pgm_base.h.
References PGM_BASE::m_settings_manager.
Referenced by PGM_BASE::InitPgm(), LIB_PIN::LIB_PIN(), CV::IFACE::OnKifaceStart(), SCH::IFACE::OnKifaceStart(), GERBV::IFACE::OnKifaceStart(), PGE::IFACE::OnKifaceStart(), PCBCALC::IFACE::OnKifaceStart(), PCB::IFACE::OnKifaceStart(), PGM_KICAD::OnPgmInit(), 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 187 of file pgm_base.cpp.
References _, PGM_BASE::AskUserForPreferredEditor(), DisplayInfoMessage(), PGM_BASE::m_text_editor, and PGM_BASE::SetTextEditor().
|
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
aFile | the file path of the assert |
aLine | the line number of the assert |
aFunc | the function name the assert is within |
aCond | the condition of the assert |
aMsg | the attached assert message (can be empty) |
Definition at line 947 of file pgm_base.cpp.
|
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
aPtr | Pass the std::current_exception() from within the catch block |
Definition at line 890 of file pgm_base.cpp.
References From_UTF8(), name, and IO_ERROR::What().
Referenced by APP_KICAD::OnRun(), and APP_KICAD_CLI::OnRun().
|
inherited |
Definition at line 430 of file pgm_base.cpp.
References PGM_BASE::m_splash.
Referenced by PGM_KICAD::OnPgmInit(), and PGM_BASE::~PGM_BASE().
|
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 441 of file pgm_base.cpp.
References _, PGM_BASE::App(), DisplayErrorMessage(), PATHS::EnsureUserPathsExist(), ADVANCED_CFG::GetCfg(), PGM_BASE::GetCommonSettings(), PGM_BASE::GetNotificationsManager(), PGM_BASE::GetSettingsManager(), KICAD_CURL::Init(), COMMON_SETTINGS::InitializeEnvironment(), NOTIFICATIONS_MANAGER::Load(), SETTINGS_MANAGER::Load(), PGM_BASE::loadCommonSettings(), SETTINGS_MANAGER::LoadProject(), 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, 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 PGM_KICAD::OnPgmInit().
|
inherited |
Determine if the application is running with a GUI.
Definition at line 881 of file pgm_base.cpp.
|
inlinevirtualinherited |
Definition at line 170 of file pgm_base.h.
References PGM_BASE::m_kicad_env.
|
protectedinherited |
Loads internal settings from COMMON_SETTINGS.
Definition at line 598 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 110 of file test_app_main.cpp.
References PGM_BASE::App(), and KIWAY_PLAYER::OpenProjectFiles().
|
inline |
Definition at line 99 of file test_app_main.cpp.
References PGM_BASE::Destroy(), Kiway, and KIWAY::OnKiwayEnd().
Referenced by APP_TEST::OnExit(), APP_TEST::OnInit(), and APP_TEST::OnRun().
bool PGM_TEST_FRAME::OnPgmInit | ( | ) |
Definition at line 236 of file test_app_main.cpp.
Referenced by APP_TEST::OnInit().
|
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 625 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 PGM_KICAD::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 741 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().
|
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 640 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 388 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 782 of file pgm_base.cpp.
References arrayDim(), LanguagesList, LANGUAGE_DESCR::m_KI_Lang_Identifier, PGM_BASE::setLanguageId(), and traceLocale.
|
virtualinherited |
Definition at line 814 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 828 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 859 of file pgm_base.cpp.
References PGM_BASE::GetCommonSettings(), and traceEnvVars.
|
inlinevirtualinherited |
Definition at line 180 of file pgm_base.h.
References PGM_BASE::m_pdf_browser.
Referenced by PGM_BASE::ReadPdfBrowserInfos().
|
virtualinherited |
Definition at line 180 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().
|
inherited |
Definition at line 418 of file pgm_base.cpp.
References KiBitmap(), and PGM_BASE::m_splash.
Referenced by PGM_BASE::InitPgm().
|
inlineinherited |
Allows access to the wxSingleInstanceChecker to test for other running KiCads.
Definition at line 369 of file pgm_base.h.
References PGM_BASE::m_pgm_checker.
|
inlinevirtualinherited |
Definition at line 187 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 |
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 426 of file pgm_base.h.
Referenced by PGM_BASE::BuildArgvUtf8(), PGM_BASE::PGM_BASE(), and PGM_BASE::~PGM_BASE().
|
protectedinherited |
Definition at line 423 of file pgm_base.h.
Referenced by PGM_BASE::BuildArgvUtf8(), PGM_BASE::PGM_BASE(), and PGM_BASE::~PGM_BASE().
|
protectedinherited |
Definition at line 398 of file pgm_base.h.
Referenced by PGM_BASE::GetBackgroundJobMonitor(), and PGM_BASE::InitPgm().
|
protectedinherited |
Definition at line 407 of file pgm_base.h.
Referenced by PGM_BASE::GetKicadEnvVariable(), PGM_BASE::InitPgm(), and PGM_BASE::IsKicadEnvVariableDefined().
|
protectedinherited |
Definition at line 410 of file pgm_base.h.
Referenced by PGM_BASE::GetLanguageTag(), PGM_BASE::GetSelectedLanguageIdentifier(), PGM_BASE::SetDefaultLanguage(), PGM_BASE::SetLanguage(), and PGM_BASE::setLanguageId().
|
protectedinherited |
The KICAD system environment variable.
Definition at line 409 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 379 of file pgm_base.h.
Referenced by APP_KICAD::FilterEvent().
|
protectedinherited |
Definition at line 399 of file pgm_base.h.
Referenced by PGM_BASE::GetNotificationsManager(), and PGM_BASE::InitPgm().
|
protectedinherited |
Definition at line 413 of file pgm_base.h.
Referenced by PGM_BASE::GetPdfBrowserName(), PGM_BASE::SetPdfBrowserName(), and PGM_BASE::UseSystemPdfBrowser().
|
protectedinherited |
Checks if there is another copy of Kicad running at the same time.
Definition at line 404 of file pgm_base.h.
Referenced by PGM_BASE::Destroy(), PGM_BASE::InitPgm(), and PGM_BASE::SingleInstance().
|
inherited |
wxWidgets on MSW tends to crash if you spool up more than one print job at a time.
Definition at line 377 of file pgm_base.h.
Referenced by PGM_BASE::PGM_BASE().
|
protectedinherited |
Definition at line 401 of file pgm_base.h.
Referenced by PGM_BASE::InitPgm().
|
inherited |
Definition at line 381 of file pgm_base.h.
Referenced by PGM_BASE::PGM_BASE().
|
protectedinherited |
Definition at line 397 of file pgm_base.h.
Referenced by PGM_BASE::GetCommonSettings(), PGM_BASE::GetSettingsManager(), PGM_BASE::InitPgm(), PGM_SINGLE_TOP::OnPgmExit(), and PGM_KICAD::OnPgmExit().
|
protectedinherited |
Definition at line 428 of file pgm_base.h.
Referenced by PGM_BASE::HideSplash(), PGM_BASE::PGM_BASE(), and PGM_BASE::ShowSplash().
|
protectedinherited |
Filename of the app selected for browsing PDFs.
Definition at line 415 of file pgm_base.h.
Referenced by PGM_BASE::GetTextEditor(), PGM_BASE::loadCommonSettings(), and PGM_BASE::SetTextEditor().
|
protectedinherited |
Definition at line 412 of file pgm_base.h.
Referenced by PGM_BASE::ForceSystemPdfBrowser(), PGM_BASE::ReadPdfBrowserInfos(), PGM_BASE::UseSystemPdfBrowser(), and PGM_BASE::WritePdfBrowserInfos().
|
staticinherited |
Definition at line 278 of file pgm_base.h.