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. | |
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) |
Shows 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) |
Sets the environment variable aName to aValue. | |
virtual void | SetLocalEnvVariables () |
Updates 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 () |
Returns 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 () |
Allows 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 () |
Loads 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 |
Checks if there is another copy of Kicad running at the same time. | |
wxString | m_kicad_env |
wxLocale * | m_locale |
The KICAD system environment variable. | |
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. | |
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 | |
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 101 of file pgm_base.h.
PGM_BASE::PGM_BASE | ( | ) |
Definition at line 137 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 153 of file pgm_base.cpp.
References Destroy(), HideSplash(), m_argcUtf8, m_argvUtf8, and m_locale.
|
virtual |
Returns a bare naked wxApp which may come from wxPython, SINGLE_TOP, or kicad.exe.
This should return what wxGetApp() returns.
Definition at line 182 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 |
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 232 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 412 of file pgm_base.cpp.
References App(), m_argcUtf8, and m_argvUtf8.
void PGM_BASE::Destroy | ( | ) |
Definition at line 170 of file pgm_base.cpp.
References KICAD_CURL::Cleanup(), 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 204 of file pgm_base.h.
Referenced by PGM_BASE(), and PANEL_COMMON_SETTINGS::TransferDataFromWindow().
|
inlinevirtual |
Definition at line 146 of file pgm_base.h.
Referenced by UPDATE_MANAGER::CheckForUpdate(), EVT_MENU_RANGE(), KISTATUSBAR::onBackgroundProgressClick(), PLUGIN_CONTENT_MANAGER::RunBackgroundUpdate(), and KICAD_MANAGER_FRAME::~KICAD_MANAGER_FRAME().
|
virtual |
Definition at line 679 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(), DIALOG_FOOTPRINT_CHOOSER::build3DCanvas(), CVPCB_MAINFRAME::BuildLibrariesList(), PROJECT_PCB::Cleanup3DCache(), TOOLS_HOLDER::CommonSettingsChanged(), EDA_BASE_FRAME::CommonSettingsChanged(), EDA_DRAW_FRAME::CommonSettingsChanged(), KICAD_MANAGER_FRAME::CommonSettingsChanged(), DESIGN_BLOCK_PREVIEW_WIDGET::DESIGN_BLOCK_PREVIEW_WIDGET(), DIALOG_EXPORT_STEP::DIALOG_EXPORT_STEP(), GERBVIEW_FRAME::GERBVIEW_FRAME(), EDA_BASE_FRAME::GetAutoSaveInterval(), GetLocalEnvVariables(), WX_AUI_TOOLBAR_ART::GetToolSize(), EDA_DRAW_PANEL_GAL::GetVcSettings(), SCH_DRAWING_TOOLS::ImportSheet(), InitPgm(), 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(), APP_SETTINGS_BASE::MigrateFromLegacy(), EESCHEMA_SETTINGS::MigrateFromLegacy(), GERBVIEW_SETTINGS::MigrateFromLegacy(), PROJECT_TREE_PANE::onGitCommit(), DIALOG_CONFIGURE_PATHS::OnGridCellChanging(), KICAD_MANAGER_FRAME::OnIdle(), BITMAP_BUTTON::OnPaint(), 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(), PROJECT::PinLibrary(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceReferenceImage(), SCH_DRAWING_TOOLS::PlaceSymbol(), DRAWING_TOOL::PlaceText(), ReadPdfBrowserInfos(), SCH_EDIT_FRAME::ReCreateHToolbar(), PCB_EDIT_FRAME::ReCreateHToolbar(), SYMBOL_VIEWER_FRAME::ReCreateLibList(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), SAVE_AS_DIALOG::SAVE_AS_DIALOG(), SaveCommonSettings(), PCB_BASE_FRAME::SelectLibrary(), SCH_BASE_FRAME::SelectLibraryFromList(), 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 1039 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(), SetLanguagePath(), and SystemDirsAppend().
|
inlinevirtual |
Definition at line 181 of file pgm_base.h.
Referenced by FindKicadFile().
|
virtual |
Definition at line 843 of file pgm_base.cpp.
References m_language_id.
Referenced by UPDATE_MANAGER::CheckForUpdate().
|
inlinevirtual |
Definition at line 185 of file pgm_base.h.
Referenced by LIB_TREE_NODE_UNIT::LIB_TREE_NODE_UNIT(), SearchHelpFileFullPath(), and COMMON_CONTROL::ShowHelp().
|
virtual |
Definition at line 924 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 148 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 187 of file pgm_base.h.
Referenced by PANEL_COMMON_SETTINGS::OnPDFViewerClick(), OpenPDF(), and WritePdfBrowserInfos().
|
inlinevirtual |
Definition at line 238 of file pgm_base.h.
Referenced by InitTables(), and EDA_BASE_FRAME::setupUIConditions().
|
inlinevirtual |
Definition at line 142 of file pgm_base.h.
Referenced by PANEL_DESIGN_BLOCK_LIB_TABLE::browseLibrariesHandler(), PANEL_FP_LIB_TABLE::browseLibrariesHandler(), PANEL_SYM_LIB_TABLE::browseLibrariesHandler(), DIALOG_FOOTPRINT_CHOOSER::build3DCanvas(), FOOTPRINT_CHOOSER_FRAME::build3DCanvas(), PCB_NET_INSPECTOR_PANEL::buildColumns(), PCB_NET_INSPECTOR_PANEL::buildNetsList(), UPDATE_MANAGER::CheckForUpdate(), KICAD_MANAGER_FRAME::CloseProject(), EDA_BASE_FRAME::commonInit(), SCH_EDIT_FRAME::CommonSettingsChanged(), SYMBOL_VIEWER_FRAME::CommonSettingsChanged(), GERBVIEW_FRAME::CommonSettingsChanged(), PL_EDITOR_FRAME::CommonSettingsChanged(), FOOTPRINT_EDIT_FRAME::CommonSettingsChanged(), FOOTPRINT_EDIT_FRAME::config(), PANEL_SYMBOL_CHOOSER::constructRightPanel(), BMP2CMP::IFACE::CreateKiWindow(), PCB::IFACE::CreateKiWindow(), DESIGN_BLOCK_PREVIEW_WIDGET::DESIGN_BLOCK_PREVIEW_WIDGET(), DIALOG_FOOTPRINT_WIZARD_LIST::DIALOG_FOOTPRINT_WIZARD_LIST(), SYMBOL_EDITOR_DRAWING_TOOLS::doDrawShape(), SCH_MOVE_TOOL::doMoveSelection(), GRID_CELL_LAYER_RENDERER::Draw(), BIN_MOD::End(), EVT_TOOL_RANGE(), GERBVIEW_DRAW_PANEL_GAL::GERBVIEW_DRAW_PANEL_GAL(), PCB_EDITOR_CONDITIONS::get45degModeFunc(), PCB_EDIT_FRAME::GetActionPluginButtonVisible(), PCBNEW_JOBS_HANDLER::getBoard(), BOARD_ADAPTER::GetBoardEditorCopperLayerColors(), SCH_MARKER::getColor(), PCB_MARKER::getColor(), FOOTPRINT_CHOOSER_FRAME::GetColorSettings(), EDA_DRAW_FRAME::GetColorSettings(), DISPLAY_FOOTPRINTS_FRAME::GetColorSettings(), SCH_BASE_FRAME::GetColorSettings(), SYMBOL_EDIT_FRAME::GetColorSettings(), GERBVIEW_FRAME::GetColorSettings(), FOOTPRINT_EDIT_FRAME::GetColorSettings(), FOOTPRINT_VIEWER_FRAME::GetColorSettings(), FOOTPRINT_WIZARD_FRAME::GetColorSettings(), PCB_BASE_EDIT_FRAME::GetColorSettings(), SCH_ITEM::GetDefaultFont(), PCB_BASE_FRAME::GetFootprintEditorSettings(), GetLastPinLength(), GetLastPinNameSize(), GetLastPinNumSize(), PCB_LAYER_PRESENTATION::getLayerColor(), GetLayerColor(), BOARD_ADAPTER::GetLayerColors(), DISPLAY_FOOTPRINTS_FRAME::GetMagneticItemsSettings(), PCB_EDIT_FRAME::GetOrderedActionPlugins(), PCB_BASE_FRAME::GetPcbNewSettings(), KICAD_MANAGER_FRAME::GetProjectFileName(), EESCHEMA_JOBS_HANDLER::getSchematic(), FOOTPRINT_EDIT_FRAME::GetSettings(), SCH_BASE_FRAME::GetViewerSettingsBase(), PCB_BASE_FRAME::GetViewerSettingsBase(), DISPLAY_FOOTPRINTS_FRAME::GetViewerSettingsBase(), DISPLAY_FOOTPRINTS_FRAME::GetWindowSettings(), gvconfig(), API_HANDLER_COMMON::handleExpandTextVariables(), API_HANDLER_COMMON::handleGetNetClasses(), HandleJobConfig(), IfaceOrAddress(), DIALOG_EXPORT_2581::Init(), DIALOG_EXPORT_ODBPP::Init(), init_unit_test(), DIALOG_PLOT_SCHEMATIC::initDlg(), InitPgm(), EESCHEMA_JOBS_HANDLER::InitRenderSettings(), PCB_TOOL_BASE::Is45Limited(), PCBNEW_JOBS_HANDLER::JobExportPdf(), PCBNEW_JOBS_HANDLER::JobExportRender(), EESCHEMA_JOBS_HANDLER::JobSymExportSvg(), PCBNEW_PRINTOUT_SETTINGS::Load(), PANEL_EESCHEMA_EDITING_OPTIONS::loadEEschemaSettings(), DESIGN_BLOCK_LIB_TABLE::LoadGlobalTable(), FP_LIB_TABLE::LoadGlobalTable(), SYMBOL_LIB_TABLE::LoadGlobalTable(), loadKicadProject(), KICAD_MANAGER_FRAME::LoadProject(), PANEL_PREVIEW_3D_MODEL::loadSettings(), PCB_TEST_FRAME_BASE::LoadSettings(), SYMBOL_VIEWER_FRAME::LoadSettings(), FOOTPRINT_VIEWER_FRAME::LoadSettings(), PCB_VIEWER_TOOLS::MeasureTool(), EESCHEMA_SETTINGS::MigrateFromLegacy(), GERBVIEW_SETTINGS::MigrateFromLegacy(), FOOTPRINT_EDITOR_SETTINGS::MigrateFromLegacy(), PCBNEW_SETTINGS::MigrateFromLegacy(), PCB_NET_INSPECTOR_PANEL::netFilterMatches(), FOOTPRINT_PREVIEW_PANEL::New(), KICAD_MANAGER_CONTROL::NewFromTemplate(), PCB_NET_INSPECTOR_PANEL::OnBoardChanged(), PCB_NET_INSPECTOR_PANEL::OnConfigButton(), LIB_TREE::onDetailsLink(), PANEL_PACKAGES_VIEW::OnDownloadVersionClicked(), CV::IFACE::OnKifaceStart(), SCH::IFACE::OnKifaceStart(), GERBV::IFACE::OnKifaceStart(), PGE::IFACE::OnKifaceStart(), PCBCALC::IFACE::OnKifaceStart(), PCB::IFACE::OnKifaceStart(), DIALOG_PCM::OnManageRepositoriesClicked(), DIALOG_CONFIG_EQUFILES::OnOkClick(), PGM_KICAD::OnPgmInit(), PANEL_COLOR_SETTINGS::OnThemeChanged(), PANEL_DESIGN_BLOCK_CHOOSER::PANEL_DESIGN_BLOCK_CHOOSER(), PANEL_DESIGN_BLOCK_LIB_TABLE::PANEL_DESIGN_BLOCK_LIB_TABLE(), PANEL_EESCHEMA_COLOR_SETTINGS::PANEL_EESCHEMA_COLOR_SETTINGS(), PANEL_FP_EDITOR_COLOR_SETTINGS::PANEL_FP_EDITOR_COLOR_SETTINGS(), PANEL_FP_LIB_TABLE::PANEL_FP_LIB_TABLE(), PANEL_FP_PROPERTIES_3D_MODEL::PANEL_FP_PROPERTIES_3D_MODEL(), PANEL_GERBVIEW_COLOR_SETTINGS::PANEL_GERBVIEW_COLOR_SETTINGS(), PANEL_GERBVIEW_DISPLAY_OPTIONS::PANEL_GERBVIEW_DISPLAY_OPTIONS(), PANEL_PCBNEW_COLOR_SETTINGS::PANEL_PCBNEW_COLOR_SETTINGS(), PANEL_SYM_LIB_TABLE::PANEL_SYM_LIB_TABLE(), PANEL_SYMBOL_CHOOSER::PANEL_SYMBOL_CHOOSER(), PANEL_TEMPLATE_FIELDNAMES::PANEL_TEMPLATE_FIELDNAMES(), PROJECT::PinLibrary(), PL_DRAW_PANEL_GAL::PL_DRAW_PANEL_GAL(), EXPORT_SVG::Plot(), SCH_PLOTTER::Plot(), SCH_SHEET::Plot(), DIALOG_PLOT::Plot(), POSITION_RELATIVE_TOOL::PositionRelativeInteractively(), SCH_PRINTOUT::PrintPage(), KIWAY::Prj(), EDA_3D_VIEWER_FRAME::Process_Special_Functions(), SCH::readSchematicFromFile(), PIN_LAYOUT_CACHE::recomputeCaches(), BOARD_ADAPTER::ReloadColorSettings(), EDA_3D_CANVAS::RenderEngineChanged(), SCH_EDIT_TOOL::RepeatDrawItem(), SYMBOL_EDITOR_PIN_TOOL::RepeatPin(), PCBNEW_PRINTOUT_SETTINGS::Save(), PANEL_COLOR_SETTINGS::saveCurrentTheme(), SaveFileAs(), PCB_NET_INSPECTOR_PANEL::SaveSettings(), EDA_3D_VIEWER_FRAME::SaveSettings(), SYMBOL_VIEWER_FRAME::SaveSettings(), GERBVIEW_FRAME::SaveSettings(), SCH_DRAW_PANEL::SCH_DRAW_PANEL(), SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS(), PCB_TEST_FRAME_BASE::SetBoard(), SetLanguage(), BOARD_ADAPTER::SetLayerColors(), PANEL_SYM_LIB_TABLE::setupGrid(), PANEL_FP_LIB_TABLE::setupGrid(), PIN_TABLE_DATA_MODEL::SetValue(), KICAD_MANAGER_CONTROL::ShowPluginManager(), EDA_BASE_FRAME::ShowPreferences(), SCH_EDIT_FRAME::ShowSchematicSetupDialog(), SYMBOL_EDIT_FRAME::SYMBOL_EDIT_FRAME(), SYMBOL_PREVIEW_WIDGET::SYMBOL_PREVIEW_WIDGET(), EDA_3D_VIEWER_FRAME::ToggleAppearanceManager(), DRAWING_TOOL::ToggleHV45Mode(), PANEL_3D_DISPLAY_OPTIONS::TransferDataFromWindow(), PANEL_3D_OPENGL_OPTIONS::TransferDataFromWindow(), PANEL_3D_RAYTRACING_OPTIONS::TransferDataFromWindow(), PANEL_PACKAGES_AND_UPDATES::TransferDataFromWindow(), PANEL_EESCHEMA_ANNOTATION_OPTIONS::TransferDataFromWindow(), PANEL_EESCHEMA_COLOR_SETTINGS::TransferDataFromWindow(), PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataFromWindow(), PANEL_EESCHEMA_EDITING_OPTIONS::TransferDataFromWindow(), PANEL_SIMULATOR_PREFERENCES::TransferDataFromWindow(), PANEL_SYM_COLOR_SETTINGS::TransferDataFromWindow(), PANEL_SYM_DISPLAY_OPTIONS::TransferDataFromWindow(), PANEL_SYM_EDITING_OPTIONS::TransferDataFromWindow(), PANEL_TEMPLATE_FIELDNAMES::TransferDataFromWindow(), PANEL_GERBVIEW_COLOR_SETTINGS::TransferDataFromWindow(), PANEL_GERBVIEW_DISPLAY_OPTIONS::TransferDataFromWindow(), PANEL_GERBVIEW_EXCELLON_SETTINGS::TransferDataFromWindow(), PANEL_COMMON_SETTINGS::TransferDataFromWindow(), PANEL_PLUGIN_SETTINGS::TransferDataFromWindow(), DIALOG_UPDATE_CHECK_PROMPT::TransferDataFromWindow(), PANEL_PL_EDITOR_COLOR_SETTINGS::TransferDataFromWindow(), DIALOG_EXPORT_2581::TransferDataFromWindow(), DIALOG_EXPORT_ODBPP::TransferDataFromWindow(), PANEL_EDIT_OPTIONS::TransferDataFromWindow(), PANEL_FP_EDITOR_COLOR_SETTINGS::TransferDataFromWindow(), PANEL_FP_EDITOR_DEFAULTS::TransferDataFromWindow(), PANEL_PCB_DISPLAY_OPTIONS::TransferDataFromWindow(), PANEL_PCBNEW_COLOR_SETTINGS::TransferDataFromWindow(), PANEL_3D_DISPLAY_OPTIONS::TransferDataToWindow(), PANEL_3D_OPENGL_OPTIONS::TransferDataToWindow(), PANEL_3D_RAYTRACING_OPTIONS::TransferDataToWindow(), PANEL_PACKAGES_AND_UPDATES::TransferDataToWindow(), DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataToWindow(), PANEL_EESCHEMA_ANNOTATION_OPTIONS::TransferDataToWindow(), PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataToWindow(), PANEL_EESCHEMA_EDITING_OPTIONS::TransferDataToWindow(), PANEL_SIMULATOR_PREFERENCES::TransferDataToWindow(), PANEL_SYM_COLOR_SETTINGS::TransferDataToWindow(), PANEL_SYM_DISPLAY_OPTIONS::TransferDataToWindow(), PANEL_SYM_EDITING_OPTIONS::TransferDataToWindow(), PANEL_GERBVIEW_DISPLAY_OPTIONS::TransferDataToWindow(), PANEL_GERBVIEW_EXCELLON_SETTINGS::TransferDataToWindow(), PANEL_PLUGIN_SETTINGS::TransferDataToWindow(), PANEL_PL_EDITOR_COLOR_SETTINGS::TransferDataToWindow(), PANEL_EDIT_OPTIONS::TransferDataToWindow(), PANEL_FP_EDITOR_DEFAULTS::TransferDataToWindow(), PANEL_PCB_DISPLAY_OPTIONS::TransferDataToWindow(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), PROJECT::UnpinLibrary(), PCB_DRAW_PANEL_GAL::UpdateColors(), DRAWING_TOOL::UpdateStatusBar(), KIGFX::PCB_PAINTER::viewer_settings(), DIALOG_FOOTPRINT_WIZARD_LIST::~DIALOG_FOOTPRINT_WIZARD_LIST(), PANEL_FOOTPRINT_CHOOSER::~PANEL_FOOTPRINT_CHOOSER(), 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 196 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().
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 996 of file pgm_base.cpp.
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 939 of file pgm_base.cpp.
References From_UTF8(), 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 446 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 457 of file pgm_base.cpp.
References _, App(), DisplayErrorMessage(), PATHS::EnsurePathExists(), PATHS::EnsureUserPathsExist(), ADVANCED_CFG::GetCfg(), GetCommonSettings(), PATHS::GetInstanceCheckerPath(), GetMajorMinorVersion(), GetNotificationsManager(), GetSettingsManager(), KICAD_CURL::Init(), COMMON_SETTINGS::InitializeEnvironment(), 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, 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 930 of file pgm_base.cpp.
|
inlinevirtual |
Definition at line 179 of file pgm_base.h.
|
protected |
Loads internal settings from COMMON_SETTINGS.
Definition at line 643 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 1045 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 670 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 786 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 685 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 399 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 827 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 859 of file pgm_base.cpp.
References GetExecutablePath(), PATHS::GetLocaleDataPath(), and Pgm().
Referenced by InitPgm().
|
virtual |
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 877 of file pgm_base.cpp.
References traceEnvVars.
Referenced by loadCommonSettings().
|
virtual |
Updates the local environment with the contents of the current ENV_VAR_MAP stored in the COMMON_SETTINGS.
Definition at line 908 of file pgm_base.cpp.
References GetCommonSettings(), and traceEnvVars.
Referenced by DIALOG_CONFIGURE_PATHS::TransferDataFromWindow().
|
inlinevirtual |
Definition at line 189 of file pgm_base.h.
Referenced by ReadPdfBrowserInfos(), and PANEL_COMMON_SETTINGS::TransferDataFromWindow().
|
virtual |
Definition at line 189 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 427 of file pgm_base.cpp.
References KiBitmap(), and m_splash.
Referenced by InitPgm().
|
inline |
Allows access to the wxSingleInstanceChecker to test for other running KiCads.
Definition at line 378 of file pgm_base.h.
|
inlinevirtual |
Definition at line 196 of file pgm_base.h.
|
virtual |
Save the PDF browser choice to the common configuration.
Definition at line 1052 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 |
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 441 of file pgm_base.h.
Referenced by BuildArgvUtf8(), PGM_BASE(), and ~PGM_BASE().
|
protected |
Definition at line 438 of file pgm_base.h.
Referenced by BuildArgvUtf8(), PGM_BASE(), and ~PGM_BASE().
|
protected |
Definition at line 409 of file pgm_base.h.
Referenced by InitPgm().
|
protected |
Definition at line 422 of file pgm_base.h.
Referenced by InitPgm().
|
protected |
Definition at line 425 of file pgm_base.h.
Referenced by GetLanguageTag(), SetDefaultLanguage(), and SetLanguage().
|
protected |
The KICAD system environment variable.
Definition at line 424 of file pgm_base.h.
Referenced by PGM_BASE(), SetDefaultLanguage(), SetLanguage(), and ~PGM_BASE().
std::vector<void*> PGM_BASE::m_ModalDialogs |
Definition at line 388 of file pgm_base.h.
Referenced by APP_SINGLE_TOP::FilterEvent(), APP_KICAD::FilterEvent(), and KIUI::IsModalDialogFocused().
|
protected |
Definition at line 410 of file pgm_base.h.
Referenced by InitPgm().
|
protected |
Definition at line 428 of file pgm_base.h.
|
protected |
Checks if there is another copy of Kicad running at the same time.
Definition at line 415 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 386 of file pgm_base.h.
Referenced by DIALOG_PRINT_GENERIC::onPrintButtonClick(), PGM_BASE(), and DIALOG_PRINT_USING_PRINTER::TransferDataFromWindow().
bool PGM_BASE::m_PropertyGridInitialized |
Definition at line 392 of file pgm_base.h.
Referenced by PGM_BASE(), and PROPERTIES_PANEL::PROPERTIES_PANEL().
|
protected |
Definition at line 412 of file pgm_base.h.
Referenced by InitPgm().
bool PGM_BASE::m_Quitting |
Definition at line 390 of file pgm_base.h.
Referenced by KICAD_MANAGER_FRAME::doCloseWindow(), and PGM_BASE().
|
protected |
Definition at line 408 of file pgm_base.h.
Referenced by GetCommonSettings(), InitPgm(), PGM_SINGLE_TOP::OnPgmExit(), and PGM_KICAD::OnPgmExit().
|
protected |
Definition at line 443 of file pgm_base.h.
Referenced by HideSplash(), PGM_BASE(), and ShowSplash().
|
protected |
Filename of the app selected for browsing PDFs.
Definition at line 430 of file pgm_base.h.
Referenced by GetTextEditor(), loadCommonSettings(), and SetTextEditor().
|
protected |
Definition at line 427 of file pgm_base.h.
Referenced by ReadPdfBrowserInfos(), and WritePdfBrowserInfos().
|
static |
Definition at line 287 of file pgm_base.h.