KiCad PCB EDA Suite
|
Struct PGM_SINGLE_TOP implements PGM_BASE with its own OnPgmInit() and OnPgmExit(). More...
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 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... | |
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... | |
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... | |
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... | |
Struct PGM_SINGLE_TOP implements PGM_BASE with its own OnPgmInit() and OnPgmExit().
Definition at line 66 of file single_top.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 163 of file pgm_base.cpp.
Referenced by PGM_BASE::BuildArgvUtf8(), PGM_BASE::InitPgm(), MacOpenFile(), PGM_KICAD::MacOpenFile(), PGM_TEST_FRAME::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 213 of file pgm_base.cpp.
Referenced by PGM_BASE::GetTextEditor().
|
inherited |
Builds the UTF8 based argv variable.
Definition at line 383 of file pgm_base.cpp.
References PGM_BASE::App(), PGM_BASE::m_argcUtf8, and PGM_BASE::m_argvUtf8.
|
inherited |
Definition at line 151 of file pgm_base.cpp.
References PGM_BASE::m_locale.
Referenced by PGM_KICAD::Destroy(), OnPgmExit(), PGM_TEST_FRAME::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 187 of file pgm_base.h.
References PGM_BASE::m_use_system_pdf_browser.
Referenced by PGM_BASE::PGM_BASE().
|
virtualinherited |
Definition at line 615 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 166 of file pgm_base.h.
References PGM_BASE::m_bin_dir.
Referenced by OnPgmInit(), and PGM_BASE::SetLanguagePath().
|
inlinevirtualinherited |
|
virtualinherited |
Definition at line 778 of file pgm_base.cpp.
References PGM_BASE::m_language_id.
|
inlinevirtualinherited |
|
virtualinherited |
Definition at line 856 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 170 of file pgm_base.h.
References PGM_BASE::m_pdf_browser.
Referenced by PGM_BASE::WritePdfBrowserInfos().
|
inlinevirtualinherited |
Definition at line 221 of file pgm_base.h.
References PGM_BASE::m_language_id.
|
inlinevirtualinherited |
Definition at line 135 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(), SCH::readSchematicFromFile(), SaveFileAs(), 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 177 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 398 of file pgm_base.cpp.
References _, PGM_BASE::App(), DisplayErrorMessage(), PATHS::EnsureUserPathsExist(), ADVANCED_CFG::GetCfg(), 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(), WIN_STRING_DIR_SEP, and wxPGGlobalVars.
Referenced by PGM_KICAD::OnPgmInit().
|
inlinevirtualinherited |
|
protectedinherited |
Loads internal settings from COMMON_SETTINGS.
Definition at line 579 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 85 of file single_top.cpp.
References PGM_BASE::App(), KIWAY::GetBlockingDialog(), KIWAY_HOLDER::Kiway(), and KIWAY_PLAYER::OpenProjectFiles().
|
inline |
Definition at line 70 of file single_top.cpp.
References PGM_BASE::Destroy(), Kiway, PGM_BASE::m_settings_manager, KIWAY::OnKiwayEnd(), and PGM_BASE::SaveCommonSettings().
Referenced by APP_SINGLE_TOP::OnExit(), and APP_SINGLE_TOP::OnInit().
bool PGM_SINGLE_TOP::OnPgmInit | ( | ) |
Definition at line 294 of file single_top.cpp.
References EDA_BASE_FRAME::GetAboutTitle(), PGM_BASE::GetExecutablePath(), GetSettingsManager(), kiface, KIFACE_GETTER, KIFACE_VERSION, KIWAY::KifaceType(), Kiway, KIWAY_PLAYER::OpenProjectFiles(), KIWAY::Player(), KIWAY::set_kiface(), SETTINGS_MANAGER::SetKiway(), and KIWAY::SetTop().
Referenced by APP_SINGLE_TOP::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 606 of file pgm_base.cpp.
References PGM_BASE::GetCommonSettings(), COMMON_SETTINGS::m_System, and COMMON_SETTINGS::SYSTEM::working_dir.
Referenced by 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 721 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 537 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 621 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 320 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 762 of file pgm_base.cpp.
References arrayDim(), LanguagesList, LANGUAGE_DESCR::m_KI_Lang_Identifier, PGM_BASE::setLanguageId(), and traceLocale.
|
virtualinherited |
Definition at line 798 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 812 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 841 of file pgm_base.cpp.
References PGM_BASE::GetCommonSettings(), and traceEnvVars.
|
inlinevirtualinherited |
Definition at line 172 of file pgm_base.h.
References PGM_BASE::m_pdf_browser.
Referenced by PGM_BASE::ReadPdfBrowserInfos().
|
virtualinherited |
Definition at line 170 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 179 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 360 of file pgm_base.h.
Referenced by PGM_BASE::BuildArgvUtf8(), PGM_BASE::PGM_BASE(), and PGM_BASE::~PGM_BASE().
|
protectedinherited |
Definition at line 357 of file pgm_base.h.
Referenced by PGM_BASE::BuildArgvUtf8(), PGM_BASE::PGM_BASE(), and PGM_BASE::~PGM_BASE().
|
protectedinherited |
Definition at line 340 of file pgm_base.h.
Referenced by PGM_BASE::GetExecutablePath(), and PGM_BASE::setExecutablePath().
|
protectedinherited |
full path to this program
Definition at line 341 of file pgm_base.h.
Referenced by PGM_BASE::GetKicadEnvVariable(), PGM_BASE::InitPgm(), and PGM_BASE::IsKicadEnvVariableDefined().
|
protectedinherited |
Definition at line 344 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 343 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 311 of file pgm_base.h.
Referenced by APP_KICAD::FilterEvent(), and APP_KICAD_CLI::FilterEvent().
|
protectedinherited |
Definition at line 347 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 309 of file pgm_base.h.
Referenced by BOARD::ComputeBoundingBox(), and PGM_BASE::PGM_BASE().
|
protectedinherited |
Definition at line 338 of file pgm_base.h.
Referenced by PGM_BASE::InitPgm().
|
inherited |
Definition at line 313 of file pgm_base.h.
Referenced by PGM_BASE::PGM_BASE().
|
protectedinherited |
Definition at line 336 of file pgm_base.h.
Referenced by PGM_BASE::GetCommonSettings(), PGM_BASE::GetSettingsManager(), PGM_BASE::InitPgm(), OnPgmExit(), and PGM_KICAD::OnPgmExit().
|
protectedinherited |
Filename of the app selected for browsing PDFs.
Definition at line 349 of file pgm_base.h.
Referenced by PGM_BASE::GetTextEditor(), PGM_BASE::loadCommonSettings(), and PGM_BASE::SetTextEditor().
|
protectedinherited |
Definition at line 346 of file pgm_base.h.
Referenced by PGM_BASE::ForceSystemPdfBrowser(), PGM_BASE::ReadPdfBrowserInfos(), PGM_BASE::UseSystemPdfBrowser(), and PGM_BASE::WritePdfBrowserInfos().
|
staticinherited |
Definition at line 270 of file pgm_base.h.