![]() |
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... | |
virtual SETTINGS_MANAGER & | GetSettingsManager () const |
virtual COMMON_SETTINGS * | GetCommonSettings () const |
virtual void | SetEditorName (const wxString &aFileName) |
virtual const wxString & | GetEditorName (bool aCanShowFileChooser=true) |
Return the preferred editor name. 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 fromthe 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 (const ENV_VAR_MAP &aEnvVarMap) |
Set the internal local environment variable map to aEnvVarMap, updates the entries in the .kicad_common configuration file and sets the environment variable to the new settings. More... | |
virtual const 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 () |
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 |
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 |
wxSingleInstanceChecker * | m_pgm_checker |
prevents multiple instances of a program from being run at the same time. More... | |
wxString | m_bin_dir |
full path to this program More... | |
wxString | m_kicad_env |
The KICAD system environment variable. More... | |
wxLocale * | m_locale |
The current locale. More... | |
int | m_language_id |
The current language setting. More... | |
bool | m_use_system_pdf_browser |
true to use the selected PDF browser, if exists, or false to use the default More... | |
wxString | m_pdf_browser |
The file name of the the program selected for browsing pdf files. More... | |
wxString | m_editor_name |
wxSize | m_help_size |
ENV_VAR_MAP | m_local_env_vars |
Local environment variable expansion settings such as KICAD6_FOOTPRINT_DIR, and KICAD6_3DMODEL_DIR. More... | |
bool | m_show_env_var_dialog |
Flag to indicate if the environment variable overwrite warning dialog should be shown. 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 140 of file pgm_base.cpp.
Referenced by PGM_BASE::InitPgm(), PGM_KICAD::MacOpenFile(), PGM_TEST_FRAME::MacOpenFile(), MacOpenFile(), PGM_MOCK_EESCHEMA_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 192 of file pgm_base.cpp.
References _, EDA_FILE_SELECTOR(), name, and NULL.
Referenced by PGM_BASE::GetEditorName().
|
inherited |
Definition at line 129 of file pgm_base.cpp.
References PGM_BASE::m_locale, and PGM_BASE::m_pgm_checker.
Referenced by CreateWindow(), PGM_KICAD::Destroy(), 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 219 of file pgm_base.h.
References PGM_BASE::m_use_system_pdf_browser.
Referenced by PGM_BASE::PGM_BASE().
|
virtualinherited |
Definition at line 583 of file pgm_base.cpp.
References SETTINGS_MANAGER::GetCommonSettings(), and PGM_BASE::GetSettingsManager().
Referenced by PGM_BASE::InitPgm(), PGM_BASE::loadCommonSettings(), PGM_BASE::ReadPdfBrowserInfos(), PGM_BASE::SaveCommonSettings(), PGM_BASE::SetEditorName(), PGM_BASE::SetLanguage(), and PGM_BASE::WritePdfBrowserInfos().
|
virtualinherited |
Return the preferred editor name.
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 155 of file pgm_base.cpp.
References _, PGM_BASE::AskUserForPreferredEditor(), DisplayInfoMessage(), PGM_BASE::m_editor_name, NULL, and PGM_BASE::SetEditorName().
|
inlinevirtualinherited |
Definition at line 198 of file pgm_base.h.
References PGM_BASE::m_bin_dir.
Referenced by OnPgmInit(), and PGM_BASE::SetLanguagePath().
|
inlinevirtualinherited |
Definition at line 196 of file pgm_base.h.
References PGM_BASE::m_kicad_env.
|
inlinevirtualinherited |
|
inlinevirtualinherited |
Definition at line 290 of file pgm_base.h.
References PGM_BASE::m_local_env_vars.
Referenced by FILENAME_RESOLVER::GetKicadPaths(), and PGM_KICAD::OnPgmInit().
|
inlinevirtualinherited |
Definition at line 202 of file pgm_base.h.
References PGM_BASE::m_pdf_browser.
Referenced by PGM_BASE::WritePdfBrowserInfos().
|
inlinevirtualinherited |
Definition at line 253 of file pgm_base.h.
References PGM_BASE::m_language_id.
|
inlinevirtualinherited |
Definition at line 167 of file pgm_base.h.
References PGM_BASE::m_settings_manager.
Referenced by PGM_BASE::GetCommonSettings(), PGM_BASE::InitPgm(), LIB_PIN::LIB_PIN(), PCBCALC::IFACE::OnKifaceStart(), PGE::IFACE::OnKifaceStart(), CV::IFACE::OnKifaceStart(), GERBV::IFACE::OnKifaceStart(), PCB::IFACE::OnKifaceStart(), SCH::IFACE::OnKifaceStart(), PGM_KICAD::OnPgmInit(), SCH::readSchematicFromFile(), and PGM_BASE::SetLanguage().
|
inherited |
Initialize this program.
Initialize the process in a KiCad standard way using some generalized techniques:
Definition at line 215 of file pgm_base.cpp.
References _, SEARCH_STACK::AddPaths(), PGM_BASE::App(), DisplayErrorMessage(), Format(), PGM_BASE::GetCommonSettings(), GetKicadLockFilePath(), PGM_BASE::GetSettingsManager(), PATHS::GetUserTemplatesPath(), ENV_VAR_ITEM::GetValue(), IsOK(), SETTINGS_MANAGER::Load(), PGM_BASE::loadCommonSettings(), SETTINGS_MANAGER::LoadProject(), PGM_BASE::m_bin_dir, PGM_BASE::m_kicad_env, PGM_BASE::m_local_env_vars, PGM_BASE::m_pgm_checker, PGM_BASE::m_settings_manager, NULL, PGM_BASE::ReadPdfBrowserInfos(), PGM_BASE::SetDefaultLanguage(), ENV_VAR_ITEM::SetDefinedExternally(), PGM_BASE::setExecutablePath(), PGM_BASE::SetLanguage(), PGM_BASE::SetLanguagePath(), ENV_VAR_ITEM::SetValue(), SystemDirsAppend(), traceEnvVars, tracePathsAndFiles, UNIX_STRING_DIR_SEP, and WIN_STRING_DIR_SEP.
Referenced by PGM_KICAD::OnPgmInit(), and PGM_TEST_FRAME::OnPgmInit().
|
inlinevirtualinherited |
Definition at line 194 of file pgm_base.h.
References PGM_BASE::m_kicad_env.
|
protectedinherited |
Loads internal settings from COMMON_SETTINGS.
Definition at line 508 of file pgm_base.cpp.
References COMMON_SETTINGS::SYSTEM::editor_name, PGM_BASE::GetCommonSettings(), PGM_BASE::m_editor_name, COMMON_SETTINGS::m_Env, PGM_BASE::m_help_size, PGM_BASE::m_local_env_vars, PGM_BASE::m_show_env_var_dialog, COMMON_SETTINGS::m_System, PROJECT_VAR_NAME, PGM_BASE::SetLocalEnvVariable(), COMMON_SETTINGS::ENVIRONMENT::show_warning_dialog, 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(), 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(), APP_SINGLE_TOP::OnInit(), and APP_SINGLE_TOP::OnRun().
bool PGM_SINGLE_TOP::OnPgmInit | ( | ) |
Definition at line 313 of file single_top.cpp.
References FRAME_FOOTPRINT_EDITOR, FRAME_PCB_EDITOR, FRAME_T_COUNT, PGM_BASE::GetExecutablePath(), GetSettingsManager(), kiface, KIFACE_GETTER, KIFACE_VERSION, KIWAY::KifaceType(), Kiway, name, KIWAY_PLAYER::OpenProjectFiles(), KIWAY_PLAYER::ParseArgs(), 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 42 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 541 of file pgm_base.cpp.
References PGM_BASE::GetCommonSettings(), COMMON_SETTINGS::m_Env, PGM_BASE::m_local_env_vars, PGM_BASE::m_show_env_var_dialog, COMMON_SETTINGS::m_System, COMMON_SETTINGS::ENVIRONMENT::show_warning_dialog, traceEnvVars, COMMON_SETTINGS::ENVIRONMENT::vars, and COMMON_SETTINGS::SYSTEM::working_dir.
Referenced by PGM_KICAD::OnPgmExit(), OnPgmExit(), and PGM_BASE::SetLocalEnvVariables().
|
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 messsage(s) in |
Definition at line 684 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 |
Definition at line 147 of file pgm_base.cpp.
References COMMON_SETTINGS::SYSTEM::editor_name, PGM_BASE::GetCommonSettings(), PGM_BASE::m_editor_name, and COMMON_SETTINGS::m_System.
Referenced by PGM_BASE::GetEditorName().
|
protectedinherited |
Find the path to the executable and stores it in PGM_BASE::m_bin_dir.
Definition at line 466 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 589 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 340 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 fromthe 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 722 of file pgm_base.cpp.
References arrayDim(), LanguagesList, LANGUAGE_DESCR::m_KI_Lang_Identifier, PGM_BASE::setLanguageId(), and traceLocale.
|
virtualinherited |
Definition at line 738 of file pgm_base.cpp.
References PGM_BASE::GetExecutablePath(), Pgm(), SystemDirsAppend(), and traceLocale.
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 793 of file pgm_base.cpp.
References traceEnvVars.
Referenced by PGM_BASE::loadCommonSettings().
|
virtualinherited |
Set the internal local environment variable map to aEnvVarMap, updates the entries in the .kicad_common configuration file and sets the environment variable to the new settings.
aEnvVarMap | is a ENV_VAR_MAP object containing the new environment variables. |
Definition at line 814 of file pgm_base.cpp.
References PGM_BASE::m_local_env_vars, PGM_BASE::SaveCommonSettings(), and traceEnvVars.
|
inlinevirtualinherited |
Definition at line 204 of file pgm_base.h.
References PGM_BASE::m_pdf_browser.
Referenced by PGM_BASE::ReadPdfBrowserInfos().
|
inlinevirtualinherited |
Definition at line 211 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 49 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 |
full path to this program
Definition at line 355 of file pgm_base.h.
Referenced by PGM_BASE::GetExecutablePath(), PGM_BASE::InitPgm(), and PGM_BASE::setExecutablePath().
|
protectedinherited |
Definition at line 371 of file pgm_base.h.
Referenced by PGM_BASE::GetEditorName(), PGM_BASE::loadCommonSettings(), and PGM_BASE::SetEditorName().
|
protectedinherited |
Definition at line 372 of file pgm_base.h.
Referenced by PGM_BASE::loadCommonSettings().
|
protectedinherited |
The KICAD system environment variable.
Definition at line 358 of file pgm_base.h.
Referenced by PGM_BASE::GetKicadEnvVariable(), PGM_BASE::InitPgm(), and PGM_BASE::IsKicadEnvVariableDefined().
|
protectedinherited |
The current language setting.
Definition at line 364 of file pgm_base.h.
Referenced by PGM_BASE::GetSelectedLanguageIdentifier(), PGM_BASE::SetDefaultLanguage(), PGM_BASE::SetLanguage(), and PGM_BASE::setLanguageId().
|
protectedinherited |
Local environment variable expansion settings such as KICAD6_FOOTPRINT_DIR, and KICAD6_3DMODEL_DIR.
Definition at line 375 of file pgm_base.h.
Referenced by PGM_BASE::GetLocalEnvVariables(), PGM_BASE::InitPgm(), PGM_BASE::loadCommonSettings(), PGM_BASE::SaveCommonSettings(), and PGM_BASE::SetLocalEnvVariables().
|
protectedinherited |
The current locale.
Definition at line 361 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 333 of file pgm_base.h.
Referenced by APP_KICAD::FilterEvent(), and PGM_BASE::PGM_BASE().
|
protectedinherited |
The file name of the the program selected for browsing pdf files.
Definition at line 370 of file pgm_base.h.
Referenced by PGM_BASE::GetPdfBrowserName(), PGM_BASE::SetPdfBrowserName(), and PGM_BASE::UseSystemPdfBrowser().
|
protectedinherited |
prevents multiple instances of a program from being run at the same time.
Definition at line 352 of file pgm_base.h.
Referenced by PGM_BASE::Destroy(), PGM_BASE::InitPgm(), and PGM_BASE::PGM_BASE().
|
inherited |
wxWidgets on MSW tends to crash if you spool up more than one print job at a time.
Definition at line 331 of file pgm_base.h.
Referenced by BOARD::ComputeBoundingBox(), and PGM_BASE::PGM_BASE().
|
protectedinherited |
Definition at line 349 of file pgm_base.h.
Referenced by PGM_BASE::GetSettingsManager(), PGM_BASE::InitPgm(), PGM_KICAD::OnPgmExit(), and OnPgmExit().
|
protectedinherited |
Flag to indicate if the environment variable overwrite warning dialog should be shown.
Definition at line 378 of file pgm_base.h.
Referenced by PGM_BASE::loadCommonSettings(), PGM_BASE::PGM_BASE(), and PGM_BASE::SaveCommonSettings().
|
protectedinherited |
true to use the selected PDF browser, if exists, or false to use the default
Definition at line 367 of file pgm_base.h.
Referenced by PGM_BASE::ForceSystemPdfBrowser(), PGM_BASE::ReadPdfBrowserInfos(), PGM_BASE::UseSystemPdfBrowser(), and PGM_BASE::WritePdfBrowserInfos().
|
staticinherited |
Definition at line 302 of file pgm_base.h.