KiCad PCB EDA Suite
|
Container for data for KiCad programs. More...
#include <pgm_base.h>
Public Member Functions | |
PGM_BASE () | |
virtual | ~PGM_BASE () |
void | BuildArgvUtf8 () |
Builds the UTF8 based argv variable. | |
BS::thread_pool & | GetThreadPool () |
GL_CONTEXT_MANAGER * | GetGLContextManager () |
virtual void | MacOpenFile (const wxString &aFileName)=0 |
Specific to MacOSX (not used under Linux or Windows). | |
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. | |
virtual const wxString | AskUserForPreferredEditor (const wxString &aDefaultEditor=wxEmptyString) |
Show 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) |
Set the environment variable aName to aValue. | |
virtual void | SetLocalEnvVariables () |
Update the local environment with the contents of the current ENV_VAR_MAP stored in the COMMON_SETTINGS. | |
virtual ENV_VAR_MAP & | GetLocalEnvVariables () const |
virtual wxApp & | App () |
Return 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 | Destroy () |
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 () |
Allow 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 () |
Load internal settings from COMMON_SETTINGS. | |
void | setLanguageId (int aId) |
Trap all changes in here, simplifies debugging. | |
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 |
Check if there is another copy of Kicad running at the same time. | |
wxString | m_kicad_env |
The KICAD system environment variable. | |
wxLocale * | m_locale |
int | m_language_id |
bool | m_use_system_pdf_browser |
wxString | m_pdf_browser |
Filename of the app selected for browsing PDFs. | |
wxString | m_text_editor |
KICAD_SINGLETON | m_singleton |
char ** | m_argvUtf8 |
argv parameters converted to utf8 form because wxWidgets has opinions. | |
int | m_argcUtf8 |
wxSplashScreen * | m_splash |
Container for data for KiCad programs.
The functions are virtual so we can do cross module calls without linking to them. This used to be a wxApp derivative, but that is difficult under wxPython which shapes the wxApp. So now this is a "side-car" (like a motorcycle side-car) object with a back pointer into the wxApp which initializes it.
Definition at line 102 of file pgm_base.h.
PGM_BASE::PGM_BASE | ( | ) |
Definition at line 140 of file pgm_base.cpp.
References ForceSystemPdfBrowser(), m_argcUtf8, m_argvUtf8, m_locale, m_Printing, m_PropertyGridInitialized, m_Quitting, m_splash, and setLanguageId().
|
virtual |
Definition at line 156 of file pgm_base.cpp.
References Destroy(), HideSplash(), m_argcUtf8, m_argvUtf8, and m_locale.
|
virtual |
Return a bare naked wxApp which may come from wxPython, SINGLE_TOP, or kicad.exe.
This should return what wxGetApp() returns.
Definition at line 183 of file pgm_base.cpp.
Referenced by BuildArgvUtf8(), DIALOG_SHIM::DIALOG_SHIM(), drawShapes(), InitPgm(), PGM_SINGLE_TOP::MacOpenFile(), PGM_KICAD::MacOpenFile(), PGM_TEST_FRAME::MacOpenFile(), PGM_KICAD::OnPgmInit(), playground_main_func(), PROJECT_SCH::SchLibs(), SetTopFrame(), and DIALOG_DRC::updateUI().
|
virtual |
Show 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 233 of file pgm_base.cpp.
Referenced by GetTextEditor(), and PANEL_COMMON_SETTINGS::OnTextEditorClick().
void PGM_BASE::BuildArgvUtf8 | ( | ) |
Builds the UTF8 based argv variable.
Definition at line 292 of file pgm_base.cpp.
References App(), m_argcUtf8, and m_argvUtf8.
void PGM_BASE::Destroy | ( | ) |
Definition at line 173 of file pgm_base.cpp.
References APP_MONITOR::SENTRY::Cleanup(), KICAD_CURL::Cleanup(), APP_MONITOR::SENTRY::Instance(), and m_pgm_checker.
Referenced by PGM_KICAD::Destroy(), main(), PGM_SINGLE_TOP::OnPgmExit(), PGM_TEST_FRAME::OnPgmExit(), and ~PGM_BASE().
|
inlinevirtual |
Force the use of system PDF browser, even if a preferred PDF browser is set.
Definition at line 193 of file pgm_base.h.
Referenced by PGM_BASE(), and PANEL_COMMON_SETTINGS::TransferDataFromWindow().
|
inlinevirtual |
Definition at line 129 of file pgm_base.h.
Referenced by UPDATE_MANAGER::CheckForUpdate(), EVT_MENU_RANGE(), KISTATUSBAR::onBackgroundProgressClick(), PLUGIN_CONTENT_MANAGER::RunBackgroundUpdate(), KICAD_MANAGER_FRAME::~KICAD_MANAGER_FRAME(), and UPDATE_CANCELLER::~UPDATE_CANCELLER().
|
virtual |
Definition at line 565 of file pgm_base.cpp.
References 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(), CVPCB_MAINFRAME::BuildLibrariesList(), PROJECT_PCB::Cleanup3DCache(), EDA_BASE_FRAME::CommonSettingsChanged(), EDA_DRAW_FRAME::CommonSettingsChanged(), KICAD_MANAGER_FRAME::CommonSettingsChanged(), TOOLS_HOLDER::CommonSettingsChanged(), SCH_EDIT_FRAME::configureToolbars(), PCB_EDIT_FRAME::configureToolbars(), DIALOG_EXPORT_STEP::DIALOG_EXPORT_STEP(), GERBVIEW_FRAME::GERBVIEW_FRAME(), EDA_BASE_FRAME::GetAutoSaveInterval(), SCH_BASE_FRAME::GetLibraryItemsForListDialog(), PCB_BASE_FRAME::GetLibraryItemsForListDialog(), GetLocalEnvVariables(), WX_AUI_TOOLBAR_ART::GetToolSize(), GIT_CONFIG_HANDLER::GetUserConfig(), EDA_DRAW_PANEL_GAL::GetVcSettings(), SCH_DRAWING_TOOLS::ImportSheet(), InitPgm(), EDA_DRAW_FRAME::loadCanvasTypeSetting(), KIGFX::PCB_RENDER_SETTINGS::LoadColors(), EDA_3D_VIEWER_FRAME::loadCommonSettings(), loadCommonSettings(), PANEL_PREVIEW_3D_MODEL::loadSettings(), KIGFX::WX_VIEW_CONTROLS::LoadSettings(), EDA_BASE_FRAME::LoadSettings(), EDA_DRAW_FRAME::LoadSettings(), PLUGIN_CONTENT_MANAGER::MarkInstalled(), APP_SETTINGS_BASE::MigrateFromLegacy(), EESCHEMA_SETTINGS::MigrateFromLegacy(), GERBVIEW_SETTINGS::MigrateFromLegacy(), FOOTPRINT_PREVIEW_PANEL::New(), PROJECT_TREE_PANE::onGitSyncTimer(), DIALOG_CONFIGURE_PATHS::OnGridCellChanging(), KICAD_MANAGER_FRAME::OnIdle(), PROJECT_TREE_PANE::onRight(), 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(), PCB_DESIGN_BLOCK_PREVIEW_WIDGET::PCB_DESIGN_BLOCK_PREVIEW_WIDGET(), PROJECT::PinLibrary(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceReferenceImage(), SCH_DRAWING_TOOLS::PlaceSymbol(), DRAWING_TOOL::PlaceText(), ReadPdfBrowserInfos(), SYMBOL_VIEWER_FRAME::ReCreateLibList(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), SaveCommonSettings(), SCH_DESIGN_BLOCK_PREVIEW_WIDGET::SCH_DESIGN_BLOCK_PREVIEW_WIDGET(), SetLanguage(), SetLocalEnvVariables(), PANEL_PACKAGES_VIEW::SetSashOnIdle(), 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(), PANEL_PCBNEW_ACTION_PLUGINS::TransferDataToWindow(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), PCB_CONTROL::unfilledZoneCheck(), PROJECT::UnpinLibrary(), WritePdfBrowserInfos(), PANEL_PACKAGES_VIEW::~PANEL_PACKAGES_VIEW(), PANEL_SETUP_NETCLASSES::~PANEL_SETUP_NETCLASSES(), and PANEL_SETUP_RULES::~PANEL_SETUP_RULES().
|
virtual |
Definition at line 879 of file pgm_base.cpp.
References PATHS::GetExecutablePath().
Referenced by KIWAY::dso_search_path(), EVT_UPDATE_UI_RANGE(), FindKicadFile(), NETLIST_DIALOG_ADD_GENERATOR::OnBrowseGenerators(), PGM_SINGLE_TOP::OnPgmInit(), PGM_KICAD::OnPgmInit(), SetLanguagePath(), and SystemDirsAppend().
|
inline |
Definition at line 115 of file pgm_base.h.
Referenced by EDA_3D_CANVAS::DoRePaint(), KIGFX::OPENGL_GAL::LockContext(), EDA_3D_MODEL_VIEWER::OnPaint(), KIGFX::OPENGL_GAL::OPENGL_GAL(), RENDER_3D_OPENGL::Redraw(), EDA_3D_CANVAS::releaseOpenGL(), EDA_3D_CANVAS::RenderToFrameBuffer(), KIGFX::OPENGL_GAL::UnlockContext(), EDA_3D_MODEL_VIEWER::~EDA_3D_MODEL_VIEWER(), and KIGFX::OPENGL_GAL::~OPENGL_GAL().
|
inlinevirtual |
Definition at line 170 of file pgm_base.h.
Referenced by FindKicadFile().
|
virtual |
Definition at line 729 of file pgm_base.cpp.
References m_language_id.
Referenced by UPDATE_MANAGER::CheckForUpdate().
|
inlinevirtual |
Definition at line 174 of file pgm_base.h.
Referenced by SearchHelpFileFullPath(), and COMMON_CONTROL::ShowHelp().
|
virtual |
Definition at line 811 of file pgm_base.cpp.
References GetCommonSettings(), COMMON_SETTINGS::m_Env, and COMMON_SETTINGS::ENVIRONMENT::vars.
Referenced by SYMBOL_EDIT_FRAME::addLibTableEntry(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), PANEL_DESIGN_BLOCK_LIB_TABLE::browseLibrariesHandler(), PANEL_FP_LIB_TABLE::browseLibrariesHandler(), PANEL_SYM_LIB_TABLE::browseLibrariesHandler(), FILENAME_RESOLVER::GetKicadPaths(), SETTINGS_MANAGER::loadAllColorSettings(), DESIGN_BLOCK_LIB_TABLE::LoadGlobalTable(), FP_LIB_TABLE::LoadGlobalTable(), SYMBOL_LIB_TABLE::LoadGlobalTable(), KICAD_MANAGER_CONTROL::NewFromTemplate(), PGM_KICAD::OnPgmInit(), PCB_EDIT_FRAME::PythonSyncEnvironmentVariables(), PLUGIN_CONTENT_MANAGER::ReadEnvVar(), API_PLUGIN_MANAGER::ReloadPlugins(), SYMBOL_EDIT_FRAME::replaceLibTableEntry(), DIALOG_CONFIGURE_PATHS::TransferDataFromWindow(), DIALOG_CONFIGURE_PATHS::TransferDataToWindow(), and DIALOG_GLOBAL_LIB_TABLE_CONFIG::TransferDataToWindow().
|
inlinevirtual |
Definition at line 134 of file pgm_base.h.
Referenced by KICAD_MANAGER_FRAME::CreatePCM(), EVT_MENU_RANGE(), InitPgm(), KISTATUSBAR::onNotificationsIconClick(), and KICAD_MANAGER_FRAME::~KICAD_MANAGER_FRAME().
|
inlinevirtual |
Definition at line 176 of file pgm_base.h.
Referenced by PANEL_COMMON_SETTINGS::OnPDFViewerClick(), OpenPDF(), and WritePdfBrowserInfos().
|
inlinevirtual |
Definition at line 229 of file pgm_base.h.
Referenced by InitTables(), and EDA_BASE_FRAME::setupUIConditions().
|
inlinevirtual |
Definition at line 125 of file pgm_base.h.
Referenced by PCB_NET_INSPECTOR_PANEL::buildColumns(), PCB_NET_INSPECTOR_PANEL::buildNetsList(), KICAD_MANAGER_FRAME::CloseProject(), EDA_BASE_FRAME::commonInit(), FOOTPRINT_EDIT_FRAME::config(), BMP2CMP::IFACE::CreateKiWindow(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), CLI::JOBSET_RUN_COMMAND::doPerform(), BIN_MOD::End(), EVT_TOOL_RANGE(), PCBNEW_JOBS_HANDLER::getBoard(), GetColorSettings(), PCB_BASE_FRAME::GetFootprintEditorSettings(), PCB_BASE_FRAME::GetPcbNewSettings(), KICAD_MANAGER_FRAME::GetProjectFileName(), EESCHEMA_JOBS_HANDLER::getSchematic(), PCB_BASE_FRAME::GetViewerSettingsBase(), gvconfig(), API_HANDLER_COMMON::handleExpandTextVariables(), API_HANDLER_COMMON::handleGetNetClasses(), API_HANDLER_COMMON::handleGetTextVariables(), API_HANDLER_COMMON::handleSetNetClasses(), API_HANDLER_COMMON::handleSetTextVariables(), init_unit_test(), InitPgm(), DIALOG_SHIM::LoadControlState(), loadKicadProject(), KICAD_MANAGER_FRAME::LoadProject(), PCB_TEST_FRAME_BASE::LoadSettings(), EESCHEMA_SETTINGS::MigrateFromLegacy(), GERBVIEW_SETTINGS::MigrateFromLegacy(), FOOTPRINT_EDITOR_SETTINGS::MigrateFromLegacy(), PCBNEW_SETTINGS::MigrateFromLegacy(), PCB_NET_INSPECTOR_PANEL::netFilterMatches(), FOOTPRINT_PREVIEW_PANEL::New(), PCB_NET_INSPECTOR_PANEL::OnBoardChanged(), PCB_NET_INSPECTOR_PANEL::OnConfigButton(), LIB_TREE::onDetailsLink(), CV::IFACE::OnKifaceStart(), SCH::IFACE::OnKifaceStart(), GERBV::IFACE::OnKifaceStart(), PGE::IFACE::OnKifaceStart(), PCBCALC::IFACE::OnKifaceStart(), PCB::IFACE::OnKifaceStart(), DIALOG_CONFIG_EQUFILES::OnOkClick(), PGM_KICAD::OnPgmInit(), PANEL_COLOR_SETTINGS::OnThemeChanged(), PANEL_FP_EDITOR_COLOR_SETTINGS::PANEL_FP_EDITOR_COLOR_SETTINGS(), PROJECT::PinLibrary(), KIWAY::Prj(), SCH::readSchematicFromFile(), DIALOG_SHIM::resetSize(), DIALOG_SHIM::SaveControlState(), PANEL_COLOR_SETTINGS::saveCurrentTheme(), PCB_NET_INSPECTOR_PANEL::SaveSettings(), GERBVIEW_FRAME::SaveSettings(), PCB_TEST_FRAME_BASE::SetBoard(), SetLanguage(), BOARD_ADAPTER::SetLayerColors(), DIALOG_SHIM::Show(), KICAD_MANAGER_CONTROL::ShowPluginManager(), EDA_BASE_FRAME::ShowPreferences(), SCH_EDIT_FRAME::ShowSchematicSetupDialog(), PANEL_COMMON_SETTINGS::TransferDataFromWindow(), PANEL_PLUGIN_SETTINGS::TransferDataFromWindow(), PANEL_PLUGIN_SETTINGS::TransferDataToWindow(), PROJECT::UnpinLibrary(), KIGFX::PCB_PAINTER::viewer_settings(), and SYMBOL_EDIT_FRAME::~SYMBOL_EDIT_FRAME().
|
virtual |
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 197 of file pgm_base.cpp.
References _, AskUserForPreferredEditor(), DisplayInfoMessage(), m_text_editor, and 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().
|
inline |
Definition at line 113 of file pgm_base.h.
void PGM_BASE::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.
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 851 of file pgm_base.cpp.
References APP_MONITOR::SENTRY::Instance(), and APP_MONITOR::SENTRY::LogAssert().
void PGM_BASE::HandleException | ( | std::exception_ptr | aPtr | ) |
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 826 of file pgm_base.cpp.
References From_UTF8(), APP_MONITOR::SENTRY::Instance(), APP_MONITOR::SENTRY::LogException(), 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().
void PGM_BASE::HideSplash | ( | ) |
Definition at line 326 of file pgm_base.cpp.
References m_splash.
Referenced by SCH::IFACE::loadGlobalLibTable(), PCB::IFACE::loadGlobalLibTable(), PGM_KICAD::OnPgmInit(), SCH_EDIT_FRAME::OpenProjectFiles(), and ~PGM_BASE().
bool PGM_BASE::InitPgm | ( | bool | aHeadless = false , |
bool | aSkipPyInit = false , |
||
bool | aIsUnitTest = false |
||
) |
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 337 of file pgm_base.cpp.
References _, APP_MONITOR::SENTRY::AddTag(), App(), DisplayErrorMessage(), COMMON_SETTINGS::API::enable_server, PATHS::EnsurePathExists(), PATHS::EnsureUserPathsExist(), ADVANCED_CFG::GetCfg(), GetCommonSettings(), PATHS::GetInstanceCheckerPath(), GetMajorMinorVersion(), GetNotificationsManager(), GetSettingsManager(), APP_MONITOR::SENTRY::Init(), KICAD_CURL::Init(), KICAD_SINGLETON::Init(), COMMON_SETTINGS::InitializeEnvironment(), APP_MONITOR::SENTRY::Instance(), NOTIFICATIONS_MANAGER::Load(), SETTINGS_MANAGER::Load(), loadCommonSettings(), SETTINGS_MANAGER::LoadProject(), COMMON_SETTINGS::m_Api, m_background_jobs_monitor, m_kicad_env, m_notifications_manager, m_pgm_checker, m_python_scripting, m_settings_manager, m_singleton, COMMON_SETTINGS::API::python_interpreter, ReadPdfBrowserInfos(), SetDefaultLanguage(), SetLanguage(), SetLanguagePath(), ShowSplash(), UNIX_STRING_DIR_SEP, WarnUserIfOperatingSystemUnsupported(), WIN_STRING_DIR_SEP, and wxPGGlobalVars.
Referenced by init_unit_test(), main(), and PGM_KICAD::OnPgmInit().
bool PGM_BASE::IsGUI | ( | ) |
Determine if the application is running with a GUI.
Definition at line 817 of file pgm_base.cpp.
|
inlinevirtual |
Definition at line 168 of file pgm_base.h.
|
protected |
Load internal settings from COMMON_SETTINGS.
Definition at line 529 of file pgm_base.cpp.
References GetCommonSettings(), COMMON_SETTINGS::m_System, m_text_editor, PROJECT_VAR_NAME, SetLocalEnvVariable(), COMMON_SETTINGS::SYSTEM::text_editor, and traceEnvVars.
Referenced by InitPgm().
|
pure virtual |
Specific to MacOSX (not used under Linux or Windows).
MacOSX requires it for file association.
Implemented in PGM_SINGLE_TOP, PGM_KICAD, and PGM_TEST_FRAME.
|
virtual |
Read the PDF browser choice from the common configuration.
Definition at line 885 of file pgm_base.cpp.
References GetCommonSettings(), COMMON_SETTINGS::m_System, m_use_system_pdf_browser, SetPdfBrowserName(), and COMMON_SETTINGS::SYSTEM::use_system_pdf_viewer.
Referenced by InitPgm(), PANEL_COMMON_SETTINGS::OnPDFViewerClick(), and OpenPDF().
void PGM_BASE::SaveCommonSettings | ( | ) |
Save the program (process) settings subset which are stored .kicad_common.
Definition at line 556 of file pgm_base.cpp.
References GetCommonSettings(), COMMON_SETTINGS::m_System, and COMMON_SETTINGS::SYSTEM::working_dir.
Referenced by PGM_SINGLE_TOP::OnPgmExit(), and PGM_KICAD::OnPgmExit().
bool PGM_BASE::SetDefaultLanguage | ( | wxString & | aErrMsg | ) |
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 672 of file pgm_base.cpp.
References _, m_language_id, m_locale, setLanguageId(), and traceLocale.
Referenced by InitPgm().
|
virtual |
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 571 of file pgm_base.cpp.
References _, GetCommonSettings(), GetSettingsManager(), COMMON_SETTINGS::SYSTEM::language, LanguagesList, LANGUAGE_DESCR::m_KI_Lang_Identifier, LANGUAGE_DESCR::m_Lang_Label, m_language_id, m_locale, COMMON_SETTINGS::m_System, JSON_SETTINGS::SaveToFile(), setLanguageId(), and traceLocale.
Referenced by InitPgm(), and KIWAY::SetLanguage().
|
inlineprotected |
Trap all changes in here, simplifies debugging.
Definition at line 366 of file pgm_base.h.
Referenced by PGM_BASE(), SetDefaultLanguage(), SetLanguage(), and SetLanguageIdentifier().
|
virtual |
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 713 of file pgm_base.cpp.
References arrayDim(), LanguagesList, LANGUAGE_DESCR::m_KI_Lang_Identifier, setLanguageId(), and traceLocale.
Referenced by KIWAY::SetLanguage().
|
virtual |
Definition at line 747 of file pgm_base.cpp.
References GetExecutablePath(), PATHS::GetLocaleDataPath(), and Pgm().
Referenced by InitPgm().
|
virtual |
Set 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 764 of file pgm_base.cpp.
References traceEnvVars.
Referenced by loadCommonSettings().
|
virtual |
Update the local environment with the contents of the current ENV_VAR_MAP stored in the COMMON_SETTINGS.
Definition at line 795 of file pgm_base.cpp.
References GetCommonSettings(), and traceEnvVars.
Referenced by DIALOG_CONFIGURE_PATHS::TransferDataFromWindow().
|
inlinevirtual |
Definition at line 178 of file pgm_base.h.
Referenced by ReadPdfBrowserInfos(), and PANEL_COMMON_SETTINGS::TransferDataFromWindow().
|
virtual |
Definition at line 190 of file pgm_base.cpp.
References GetCommonSettings(), COMMON_SETTINGS::m_System, m_text_editor, and COMMON_SETTINGS::SYSTEM::text_editor.
Referenced by GetTextEditor(), and PANEL_COMMON_SETTINGS::TransferDataFromWindow().
void PGM_BASE::ShowSplash | ( | ) |
Definition at line 307 of file pgm_base.cpp.
References KiBitmap(), and m_splash.
Referenced by InitPgm().
|
inline |
Allow access to the wxSingleInstanceChecker to test for other running KiCads.
Definition at line 345 of file pgm_base.h.
|
inlinevirtual |
Definition at line 185 of file pgm_base.h.
|
virtual |
Save the PDF browser choice to the common configuration.
Definition at line 892 of file pgm_base.cpp.
References GetCommonSettings(), GetPdfBrowserName(), COMMON_SETTINGS::m_System, m_use_system_pdf_browser, COMMON_SETTINGS::SYSTEM::pdf_viewer_name, and COMMON_SETTINGS::SYSTEM::use_system_pdf_viewer.
Referenced by PANEL_COMMON_SETTINGS::TransferDataFromWindow().
|
protected |
Definition at line 414 of file pgm_base.h.
Referenced by BuildArgvUtf8(), PGM_BASE(), and ~PGM_BASE().
|
protected |
argv parameters converted to utf8 form because wxWidgets has opinions.
This will return argv as either force converted to ASCII in char* or wchar_t only.
Definition at line 412 of file pgm_base.h.
Referenced by BuildArgvUtf8(), PGM_BASE(), and ~PGM_BASE().
|
protected |
Definition at line 376 of file pgm_base.h.
Referenced by InitPgm().
|
protected |
The KICAD system environment variable.
Definition at line 389 of file pgm_base.h.
Referenced by InitPgm().
|
protected |
Definition at line 392 of file pgm_base.h.
Referenced by GetLanguageTag(), SetDefaultLanguage(), and SetLanguage().
|
protected |
Definition at line 391 of file pgm_base.h.
Referenced by PGM_BASE(), SetDefaultLanguage(), SetLanguage(), and ~PGM_BASE().
std::vector<void*> PGM_BASE::m_ModalDialogs |
Definition at line 355 of file pgm_base.h.
Referenced by APP_SINGLE_TOP::FilterEvent(), APP_KICAD::FilterEvent(), and KIUI::IsModalDialogFocused().
|
protected |
Definition at line 377 of file pgm_base.h.
Referenced by InitPgm().
|
protected |
Filename of the app selected for browsing PDFs.
Definition at line 395 of file pgm_base.h.
|
protected |
Check if there is another copy of Kicad running at the same time.
Definition at line 382 of file pgm_base.h.
bool PGM_BASE::m_Printing |
wxWidgets on MSW tends to crash if you spool up more than one print job at a time.
Definition at line 353 of file pgm_base.h.
Referenced by DIALOG_PRINT_GENERIC::onPrintButtonClick(), PGM_BASE(), and DIALOG_PRINT::TransferDataFromWindow().
bool PGM_BASE::m_PropertyGridInitialized |
Definition at line 359 of file pgm_base.h.
Referenced by PGM_BASE(), and PROPERTIES_PANEL::PROPERTIES_PANEL().
|
protected |
Definition at line 379 of file pgm_base.h.
Referenced by InitPgm().
bool PGM_BASE::m_Quitting |
Definition at line 357 of file pgm_base.h.
Referenced by KICAD_MANAGER_FRAME::doCloseWindow(), and PGM_BASE().
|
protected |
Definition at line 375 of file pgm_base.h.
Referenced by GetCommonSettings(), InitPgm(), PGM_SINGLE_TOP::OnPgmExit(), and PGM_KICAD::OnPgmExit().
|
protected |
Definition at line 399 of file pgm_base.h.
Referenced by InitPgm().
|
protected |
Definition at line 416 of file pgm_base.h.
Referenced by HideSplash(), PGM_BASE(), and ShowSplash().
|
protected |
Definition at line 397 of file pgm_base.h.
Referenced by GetTextEditor(), loadCommonSettings(), and SetTextEditor().
|
protected |
Definition at line 394 of file pgm_base.h.
Referenced by ReadPdfBrowserInfos(), and WritePdfBrowserInfos().
|
static |
Definition at line 279 of file pgm_base.h.