KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pgm_base.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2004-2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright (C) 2008 Wayne Stambaugh <[email protected]>
6 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
33#include <wx/html/htmlwin.h>
34#include <wx/fs_zip.h>
35#include <wx/dir.h>
36#include <wx/filename.h>
37#include <wx/msgdlg.h>
38#include <wx/propgrid/propgrid.h>
39#include <wx/snglinst.h>
40#include <wx/stdpaths.h>
41#include <wx/sysopt.h>
42#include <wx/filedlg.h>
43#include <wx/ffile.h>
44#include <wx/tooltip.h>
45
46#include <advanced_config.h>
48#include <bitmaps.h>
49#include <build_version.h>
50#include <common.h>
51#include <confirm.h>
52#include <core/arraydim.h>
53#include <id.h>
55#include <kiplatform/policy.h>
56#include <macros.h>
58#include <paths.h>
59#include <pgm_base.h>
60#include <policy_keys.h>
61#include <python_scripting.h>
64#include <string_utils.h>
65#include <systemdirsappend.h>
66#include <thread_pool.h>
67#include <trace_helpers.h>
68
69#include <widgets/wx_splash.h>
70
71#ifdef KICAD_USE_SENTRY
72#include <boost/uuid/uuid_io.hpp>
73#include <boost/uuid/uuid_generators.hpp>
74#include <sentry.h>
75#include <build_version.h>
76#endif
77
78#ifdef KICAD_IPC_API
80#include <api/api_server.h>
81#include <python_manager.h>
82#endif
83
93#undef _
94#define _(s) s
96{
97 { wxLANGUAGE_DEFAULT, ID_LANGUAGE_DEFAULT, _( "Default" ), false },
98 { wxLANGUAGE_INDONESIAN, ID_LANGUAGE_INDONESIAN, wxT( "Bahasa Indonesia" ), true },
99 { wxLANGUAGE_CZECH, ID_LANGUAGE_CZECH, wxT( "Čeština" ), true },
100 { wxLANGUAGE_DANISH, ID_LANGUAGE_DANISH, wxT( "Dansk" ), true },
101 { wxLANGUAGE_GERMAN, ID_LANGUAGE_GERMAN, wxT( "Deutsch" ), true },
102 { wxLANGUAGE_GREEK, ID_LANGUAGE_GREEK, wxT( "Ελληνικά" ), true },
103 { wxLANGUAGE_ENGLISH, ID_LANGUAGE_ENGLISH, wxT( "English" ), true },
104 { wxLANGUAGE_SPANISH, ID_LANGUAGE_SPANISH, wxT( "Español" ), true },
105 { wxLANGUAGE_SPANISH_MEXICAN, ID_LANGUAGE_SPANISH_MEXICAN,
106 wxT( "Español (Latinoamericano)" ), true },
107 { wxLANGUAGE_FRENCH, ID_LANGUAGE_FRENCH, wxT( "Français" ), true },
108 { wxLANGUAGE_HEBREW, ID_LANGUAGE_HEBREW, wxT( "עברית" ), true },
109 { wxLANGUAGE_KOREAN, ID_LANGUAGE_KOREAN, wxT( "한국어"), true },
110 { wxLANGUAGE_ITALIAN, ID_LANGUAGE_ITALIAN, wxT( "Italiano" ), true },
111 { wxLANGUAGE_LITHUANIAN, ID_LANGUAGE_LITHUANIAN, wxT( "Lietuvių" ), true },
112 { wxLANGUAGE_HUNGARIAN, ID_LANGUAGE_HUNGARIAN, wxT( "Magyar" ), true },
113 { wxLANGUAGE_DUTCH, ID_LANGUAGE_DUTCH, wxT( "Nederlands" ), true },
114 { wxLANGUAGE_JAPANESE, ID_LANGUAGE_JAPANESE, wxT( "日本語" ), true },
115 { wxLANGUAGE_THAI, ID_LANGUAGE_THAI, wxT( "ภาษาไทย" ), true },
116 { wxLANGUAGE_POLISH, ID_LANGUAGE_POLISH, wxT( "Polski" ), true },
117 { wxLANGUAGE_PORTUGUESE, ID_LANGUAGE_PORTUGUESE, wxT( "Português" ),true },
118 { wxLANGUAGE_PORTUGUESE_BRAZILIAN, ID_LANGUAGE_PORTUGUESE_BRAZILIAN,
119 wxT( "Português (Brasil)" ), true },
120 { wxLANGUAGE_RUSSIAN, ID_LANGUAGE_RUSSIAN, wxT( "Русский" ), true },
121 { wxLANGUAGE_SERBIAN, ID_LANGUAGE_SERBIAN, wxT( "Српски" ), true },
122 { wxLANGUAGE_FINNISH, ID_LANGUAGE_FINNISH, wxT( "Suomi" ), true },
123 { wxLANGUAGE_SWEDISH, ID_LANGUAGE_SWEDISH, wxT( "Svenska" ), true },
124 { wxLANGUAGE_VIETNAMESE, ID_LANGUAGE_VIETNAMESE, wxT( "Tiếng Việt" ), true },
125 { wxLANGUAGE_TURKISH, ID_LANGUAGE_TURKISH, wxT( "Türkçe" ), true },
126 { wxLANGUAGE_UKRAINIAN, ID_LANGUAGE_UKRANIAN, wxT( "Українська" ), true },
127 { wxLANGUAGE_CHINESE_SIMPLIFIED, ID_LANGUAGE_CHINESE_SIMPLIFIED,
128 wxT( "简体中文" ), true },
129 { wxLANGUAGE_CHINESE_TRADITIONAL, ID_LANGUAGE_CHINESE_TRADITIONAL,
130 wxT( "繁體中文" ), true },
131 { 0, 0, "", false } // Sentinel
132};
133#undef _
134#define _(s) wxGetTranslation((s))
135
136
138{
139 m_locale = nullptr;
140 m_Printing = false;
141 m_Quitting = false;
142 m_argcUtf8 = 0;
143 m_argvUtf8 = nullptr;
144 m_splash = nullptr;
146
147 setLanguageId( wxLANGUAGE_DEFAULT );
148
149 ForceSystemPdfBrowser( false );
150}
151
152
154{
155 HideSplash();
156 Destroy();
157
158 for( int n = 0; n < m_argcUtf8; n++ )
159 {
160 free( m_argvUtf8[n] );
161 }
162
163 delete[] m_argvUtf8;
164
165 delete m_locale;
166 m_locale = nullptr;
167}
168
169
171{
173
174#ifdef KICAD_USE_SENTRY
175 sentry_close();
176#endif
177
178 m_pgm_checker.reset();
179}
180
181
183{
184 wxASSERT( wxTheApp );
185 return *wxTheApp;
186}
187
188
189void PGM_BASE::SetTextEditor( const wxString& aFileName )
190{
191 m_text_editor = aFileName;
193}
194
195
196const wxString& PGM_BASE::GetTextEditor( bool aCanShowFileChooser )
197{
198 wxString editorname = m_text_editor;
199
200 if( !editorname )
201 {
202 if( !wxGetEnv( wxT( "EDITOR" ), &editorname ) )
203 {
204 // If there is no EDITOR variable set, try the desktop default
205#ifdef __WXMAC__
206 editorname = wxT( "/usr/bin/open -e" );
207#elif __WXX11__
208 editorname = wxT( "/usr/bin/xdg-open" );
209#endif
210 }
211 }
212
213 // If we still don't have an editor name show a dialog asking the user to select one
214 if( !editorname && aCanShowFileChooser )
215 {
216 DisplayInfoMessage( nullptr, _( "No default editor found, you must choose one." ) );
217
218 editorname = AskUserForPreferredEditor();
219 }
220
221 // If we finally have a new editor name request it to be copied to m_text_editor and
222 // saved to the preferences file.
223 if( !editorname.IsEmpty() )
224 SetTextEditor( editorname );
225
226 // m_text_editor already has the same value that editorname, or empty if no editor was
227 // found/chosen.
228 return m_text_editor;
229}
230
231
232const wxString PGM_BASE::AskUserForPreferredEditor( const wxString& aDefaultEditor )
233{
234 // Create a mask representing the executable files in the current platform
235#ifdef __WINDOWS__
236 wxString mask( _( "Executable file" ) + wxT( " (*.exe)|*.exe" ) );
237#else
238 wxString mask( _( "Executable file" ) + wxT( " (*)|*" ) );
239#endif
240
241 // Extract the path, name and extension from the default editor (even if the editor's
242 // name was empty, this method will succeed and return empty strings).
243 wxString path, name, ext;
244 wxFileName::SplitPath( aDefaultEditor, &path, &name, &ext );
245
246 // Show the modal editor and return the file chosen (may be empty if the user cancels
247 // the dialog).
248 return wxFileSelector( _( "Select Preferred Editor" ), path, name, wxT( "." ) + ext,
249 mask, wxFD_OPEN | wxFD_FILE_MUST_EXIST, nullptr );
250}
251
252
253#ifdef KICAD_USE_SENTRY
254bool PGM_BASE::IsSentryOptedIn()
255{
256 KIPLATFORM::POLICY::PBOOL policyState =
259 {
260 return policyState == KIPLATFORM::POLICY::PBOOL::ENABLED;
261 }
262
263 return m_sentry_optin_fn.Exists();
264}
265
266
267void PGM_BASE::SetSentryOptIn( bool aOptIn )
268{
269 if( aOptIn )
270 {
271 if( !m_sentry_uid_fn.Exists() )
272 {
273 sentryCreateUid();
274 }
275
276 if( !m_sentry_optin_fn.Exists() )
277 {
278 wxFFile sentryInitFile( m_sentry_optin_fn.GetFullPath(), "w" );
279 sentryInitFile.Write( "" );
280 sentryInitFile.Close();
281 }
282 }
283 else
284 {
285 if( m_sentry_optin_fn.Exists() )
286 {
287 wxRemoveFile( m_sentry_optin_fn.GetFullPath() );
288 sentry_close();
289 }
290 }
291}
292
293
294wxString PGM_BASE::sentryCreateUid()
295{
296 boost::uuids::uuid uuid = boost::uuids::random_generator()();
297 wxString userGuid = boost::uuids::to_string( uuid );
298
299 wxFFile sentryInitFile( m_sentry_uid_fn.GetFullPath(), "w" );
300 sentryInitFile.Write( userGuid );
301 sentryInitFile.Close();
302
303 return userGuid;
304}
305
306
307void PGM_BASE::ResetSentryId()
308{
309 m_sentryUid = sentryCreateUid();
310}
311
312
313const wxString& PGM_BASE::GetSentryId()
314{
315 return m_sentryUid;
316}
317
318
319void PGM_BASE::sentryInit()
320{
321 m_sentry_optin_fn = wxFileName( PATHS::GetUserCachePath(), "sentry-opt-in" );
322 m_sentry_uid_fn = wxFileName( PATHS::GetUserCachePath(), "sentry-uid" );
323
324 if( IsSentryOptedIn() )
325 {
326 wxFFile sentryInitFile( m_sentry_uid_fn.GetFullPath() );
327 sentryInitFile.ReadAll( &m_sentryUid );
328 sentryInitFile.Close();
329
330 if( m_sentryUid.IsEmpty() || m_sentryUid.length() != 36 )
331 {
332 m_sentryUid = sentryCreateUid();
333 }
334
335 sentry_options_t* options = sentry_options_new();
336
337#ifndef KICAD_SENTRY_DSN
338# error "Project configuration error, missing KICAD_SENTRY_DSN"
339#endif
340
341 sentry_options_set_dsn( options, KICAD_SENTRY_DSN );
342
343 wxFileName tmp;
344 tmp.AssignDir( PATHS::GetUserCachePath() );
345 tmp.AppendDir( "sentry" );
346
347#ifdef __WINDOWS__
348 sentry_options_set_database_pathw( options, tmp.GetPathWithSep().wc_str() );
349#else
350 sentry_options_set_database_path( options, tmp.GetPathWithSep().c_str() );
351#endif
352 sentry_options_set_symbolize_stacktraces( options, true );
353 sentry_options_set_auto_session_tracking( options, false );
354
355 sentry_options_set_release( options, GetCommitHash().ToStdString().c_str() );
356
357 // This just gives us more filtering within sentry, issues still get grouped across
358 // environments.
359 sentry_options_set_environment( options, GetMajorMinorVersion().c_str() );
360
361 sentry_init( options );
362
363 sentry_value_t user = sentry_value_new_object();
364 sentry_value_set_by_key( user, "id", sentry_value_new_string( m_sentryUid.c_str() ) );
365 sentry_set_user( user );
366
367 sentry_set_tag( "kicad.version", GetBuildVersion().ToStdString().c_str() );
368 }
369}
370
371
372void PGM_BASE::sentryPrompt()
373{
374 if( !IsGUI() )
375 return;
376
377 KIPLATFORM::POLICY::PBOOL policyState =
379
381 && !m_settings_manager->GetCommonSettings()->m_DoNotShowAgain.data_collection_prompt )
382 {
383 wxMessageDialog optIn = wxMessageDialog(
384 nullptr,
385 _( "KiCad can anonymously report crashes and special event "
386 "data to developers in order to aid identifying critical bugs "
387 "across the user base more effectively and help profile "
388 "functionality to guide improvements. \n"
389 "If you choose to voluntarily participate, KiCad will automatically "
390 "handle sending said reports when crashes or events occur. \n"
391 "Your design files such as schematic or PCB are not shared in this process." ),
392 _( "Data collection opt in request" ), wxYES_NO | wxCENTRE );
393
394 int result = optIn.ShowModal();
395
396 if( result == wxID_YES )
397 {
398 SetSentryOptIn( true );
399 sentryInit();
400 }
401 else
402 {
403 SetSentryOptIn( false );
404 }
405
406 m_settings_manager->GetCommonSettings()->m_DoNotShowAgain.data_collection_prompt = true;
407 }
408}
409#endif
410
411
413{
414 const wxArrayString& argArray = App().argv.GetArguments();
415 m_argcUtf8 = argArray.size();
416
417 m_argvUtf8 = new char*[m_argcUtf8 + 1];
418 for( int n = 0; n < m_argcUtf8; n++ )
419 {
420 m_argvUtf8[n] = wxStrdup( argArray[n].ToUTF8() );
421 }
422
423 m_argvUtf8[m_argcUtf8] = NULL; // null terminator at end of argv
424}
425
426
428{
429 // Disabling until we change to load each DSO at startup rather than lazy-load when needed.
430 // Note that once the splash screen is re-enabled, there are some remaining bugs to fix:
431 // Any wxWidgets error dialogs that appear during startup are hidden by the splash screen,
432 // so we either need to prevent these from happening (probably not feasible) or else change
433 // the error-handling path to make sure errors go on top of the splash.
434#if 0
435 if( m_splash )
436 return;
437
438 m_splash = new WX_SPLASH( KiBitmap( BITMAPS::splash ), wxSPLASH_CENTRE_ON_SCREEN, 0,
439 NULL, -1, wxDefaultPosition, wxDefaultSize,
440 wxBORDER_NONE | wxSTAY_ON_TOP );
441 wxYield();
442#endif
443}
444
445
447{
448 if( !m_splash )
449 return;
450
451 m_splash->Close( true );
452 m_splash->Destroy();
453 m_splash = nullptr;
454}
455
456
457bool PGM_BASE::InitPgm( bool aHeadless, bool aSkipPyInit, bool aIsUnitTest )
458{
459#if defined( __WXMAC__ )
460 // Set the application locale to the system default
461 wxLogNull noLog;
462 wxLocale loc;
463 loc.Init();
464#endif
465
466 // Just make sure we init precreate any folders early for later code
467 // In particular, the user cache path is the most likely to be hit by startup code
469
471
472#ifdef KICAD_USE_SENTRY
473 sentryInit();
474#endif
475
476 // Initialize the singleton instance
478
479 wxString pgm_name;
480
482 if( App().argc == 0 )
483 pgm_name = wxT( "kicad" );
484 else
485 pgm_name = wxFileName( App().argv[0] ).GetName().Lower();
486
487#ifdef KICAD_USE_SENTRY
488 sentry_set_tag( "kicad.app", pgm_name.c_str() );
489#endif
490
491 wxInitAllImageHandlers();
492
493 // Without this the wxPropertyGridManager segfaults on Windows.
494 if( !wxPGGlobalVars )
495 wxPGInitResourceModule();
496
497#ifndef __WINDOWS__
498 if( wxString( wxGetenv( "HOME" ) ).IsEmpty() )
499 {
500 DisplayErrorMessage( nullptr, _( "Environment variable HOME is empty. "
501 "Unable to continue." ) );
502 return false;
503 }
504#endif
505
506 // Ensure the instance checker directory exists
507 // It should be globally writable because it is shared between all users on Linux, and so on a
508 // multi-user machine, other need to be able to access it to check for the lock files or make
509 // their own lock files.
510 wxString instanceCheckerDir = PATHS::GetInstanceCheckerPath();
511 PATHS::EnsurePathExists( instanceCheckerDir );
512 wxChmod( instanceCheckerDir,
513 wxPOSIX_USER_READ | wxPOSIX_USER_WRITE | wxPOSIX_USER_EXECUTE |
514 wxPOSIX_GROUP_READ | wxPOSIX_GROUP_WRITE | wxPOSIX_GROUP_EXECUTE |
515 wxPOSIX_OTHERS_READ | wxPOSIX_OTHERS_WRITE | wxPOSIX_OTHERS_EXECUTE );
516
517 wxString instanceCheckerName = wxString::Format( wxS( "%s-%s" ), pgm_name,
519
520 m_pgm_checker = std::make_unique<wxSingleInstanceChecker>();
521 m_pgm_checker->Create( instanceCheckerName, instanceCheckerDir );
522
523 // Init KiCad environment
524 // the environment variable KICAD (if exists) gives the kicad path:
525 // something like set KICAD=d:\kicad
526 bool isDefined = wxGetEnv( wxT( "KICAD" ), &m_kicad_env );
527
528 if( isDefined ) // ensure m_kicad_env ends by "/"
529 {
531
532 if( !m_kicad_env.IsEmpty() && m_kicad_env.Last() != '/' )
534 }
535
536 // Init parameters for configuration
537 App().SetVendorName( wxT( "KiCad" ) );
538 App().SetAppName( pgm_name );
539
540 // Install some image handlers, mainly for help
541 if( wxImage::FindHandler( wxBITMAP_TYPE_PNG ) == nullptr )
542 wxImage::AddHandler( new wxPNGHandler );
543
544 if( wxImage::FindHandler( wxBITMAP_TYPE_GIF ) == nullptr )
545 wxImage::AddHandler( new wxGIFHandler );
546
547 if( wxImage::FindHandler( wxBITMAP_TYPE_JPEG ) == nullptr )
548 wxImage::AddHandler( new wxJPEGHandler );
549
550 wxFileSystem::AddHandler( new wxZipFSHandler );
551
552 // Analyze the command line & initialize the binary path
553 wxString tmp;
555 SetDefaultLanguage( tmp );
556
557#ifdef _MSC_VER
558 if( !wxGetEnv( "FONTCONFIG_PATH", NULL ) )
559 {
560 // We need to set this because the internal fontconfig logic
561 // seems to search relative to the dll rather the other logic it
562 // has to look for the /etc folder above the dll
563 // Also don't set it because we need it in QA cli tests to be set by ctest
564 wxSetEnv( "FONTCONFIG_PATH", PATHS::GetWindowsFontConfigDir() );
565 }
566#endif
567
568 m_settings_manager = std::make_unique<SETTINGS_MANAGER>( aHeadless );
569 m_background_jobs_monitor = std::make_unique<BACKGROUND_JOBS_MONITOR>();
570 m_notifications_manager = std::make_unique<NOTIFICATIONS_MANAGER>();
571
572#ifdef KICAD_IPC_API
573 m_plugin_manager = std::make_unique<API_PLUGIN_MANAGER>( &App() );
574#endif
575
576 // Our unit test mocks break if we continue
577 // A bug caused InitPgm to terminate early in unit tests and the mocks are...simplistic
578 // TODO fix the unit tests so this can be removed
579 if( aIsUnitTest )
580 return false;
581
582 // Something got in the way of settings load: can't continue
583 if( !m_settings_manager->IsOK() )
584 return false;
585
586 // Set up built-in environment variables (and override them from the system environment if set)
587 COMMON_SETTINGS* commonSettings = GetCommonSettings();
588 commonSettings->InitializeEnvironment();
589
590 // Load color settings after env is initialized
591 m_settings_manager->ReloadColorSettings();
592
593 // Load common settings from disk after setting up env vars
594 GetSettingsManager().Load( commonSettings );
595
596#ifdef KICAD_IPC_API
597 // If user doesn't have a saved Python interpreter, try (potentially again) to find one
598 if( commonSettings->m_Api.python_interpreter.IsEmpty() )
599 commonSettings->m_Api.python_interpreter = PYTHON_MANAGER::FindPythonInterpreter();
600#endif
601
602 // Init user language *before* calling loadSettings, because
603 // env vars could be incorrectly initialized on Linux
604 // (if the value contains some non ASCII7 chars, the env var is not initialized)
605 SetLanguage( tmp, true );
606
607 // Now that translations are available, inform the user if the OS is unsupported
609
611
612#ifdef KICAD_USE_SENTRY
613 sentryPrompt();
614#endif
615
616 ReadPdfBrowserInfos(); // needs GetCommonSettings()
617
619
620 // Create the python scripting stuff
621 // Skip it for applications that do not use it
622 if( !aSkipPyInit )
623 m_python_scripting = std::make_unique<SCRIPTING>();
624
625 // TODO(JE): Remove this if apps are refactored to not assume Prj() always works
626 // Need to create a project early for now (it can have an empty path for the moment)
628
629#ifdef KICAD_IPC_API
630 if( commonSettings->m_Api.enable_server )
631 m_plugin_manager->ReloadPlugins();
632#endif
633
634 // This sets the maximum tooltip display duration to 10s (up from 5) but only affects
635 // Windows as other platforms display tooltips while the mouse is not moving
636 if( !aHeadless )
637 {
638 wxToolTip::Enable( true );
639 wxToolTip::SetAutoPop( 10000 );
640 }
641
642 if( ADVANCED_CFG::GetCfg().m_UpdateUIEventInterval != 0 )
643 wxUpdateUIEvent::SetUpdateInterval( ADVANCED_CFG::GetCfg().m_UpdateUIEventInterval );
644
645 // Now the application can safely start, show the splash screen
646 if( !aHeadless )
647 ShowSplash();
648
649 return true;
650}
651
652
654{
656
657 for( const std::pair<wxString, ENV_VAR_ITEM> it : GetCommonSettings()->m_Env.vars )
658 {
659 wxLogTrace( traceEnvVars, wxT( "PGM_BASE::loadSettings: Found entry %s = %s" ),
660 it.first, it.second.GetValue() );
661
662 // Do not store the env var PROJECT_VAR_NAME ("KIPRJMOD") definition if for some reason
663 // it is found in config. (It is reserved and defined as project path)
664 if( it.first == PROJECT_VAR_NAME )
665 continue;
666
667 // Don't set bogus empty entries in the environment
668 if( it.first.IsEmpty() )
669 continue;
670
671 // Do not overwrite vars set by the system environment with values from the settings file
672 if( it.second.GetDefinedExternally() )
673 continue;
674
675 SetLocalEnvVariable( it.first, it.second.GetValue() );
676 }
677}
678
679
681{
682 // GetCommonSettings() is not initialized until fairly late in the
683 // process startup: InitPgm(), so test before using:
684 if( GetCommonSettings() )
685 GetCommonSettings()->m_System.working_dir = wxGetCwd();
686}
687
688
690{
691 return m_settings_manager ? m_settings_manager->GetCommonSettings() : nullptr;
692}
693
694
695bool PGM_BASE::SetLanguage( wxString& aErrMsg, bool first_time )
696{
697 // Suppress wxWidgets error popups if locale is not found
698 wxLogNull doNotLog;
699
700 if( first_time )
701 {
702 setLanguageId( wxLANGUAGE_DEFAULT );
703
704 // First time SetLanguage is called, the user selected language id is set
705 // from common user config settings
706 wxString languageSel = GetCommonSettings()->m_System.language;
707
708 // Search for the current selection
709 for( unsigned ii = 0; LanguagesList[ii].m_KI_Lang_Identifier != 0; ii++ )
710 {
711 if( LanguagesList[ii].m_Lang_Label == languageSel )
712 {
713 setLanguageId( LanguagesList[ii].m_WX_Lang_Identifier );
714 break;
715 }
716 }
717 }
718
719 // dictionary file name without extend (full name is kicad.mo)
720 wxString dictionaryName( wxT( "kicad" ) );
721
722 delete m_locale;
723 m_locale = new wxLocale;
724
725 // don't use wxLOCALE_LOAD_DEFAULT flag so that Init() doesn't return
726 // false just because it failed to load wxstd catalog
727 if( !m_locale->Init( m_language_id ) )
728 {
729 wxLogTrace( traceLocale, wxT( "This language is not supported by the system." ) );
730
731 setLanguageId( wxLANGUAGE_DEFAULT );
732 delete m_locale;
733
734 m_locale = new wxLocale;
735 m_locale->Init( wxLANGUAGE_DEFAULT );
736
737 aErrMsg = _( "This language is not supported by the operating system." );
738 return false;
739 }
740 else if( !first_time )
741 {
742 wxLogTrace( traceLocale, wxT( "Search for dictionary %s.mo in %s" ) ,
743 dictionaryName, m_locale->GetName() );
744 }
745
746 if( !first_time )
747 {
748 // If we are here, the user has selected another language.
749 // Therefore the new preferred language name is stored in common config.
750 // Do NOT store the wxWidgets language Id, it can change between wxWidgets
751 // versions, for a given language
752 wxString languageSel;
753
754 // Search for the current selection language name
755 for( unsigned ii = 0; LanguagesList[ii].m_KI_Lang_Identifier != 0; ii++ )
756 {
757 if( LanguagesList[ii].m_WX_Lang_Identifier == m_language_id )
758 {
759 languageSel = LanguagesList[ii].m_Lang_Label;
760 break;
761 }
762 }
763
765 cfg->m_System.language = languageSel;
766 cfg->SaveToFile( GetSettingsManager().GetPathForSettingsFile( cfg ) );
767 }
768
769 // Try adding the dictionary if it is not currently loaded
770 if( !m_locale->IsLoaded( dictionaryName ) )
771 m_locale->AddCatalog( dictionaryName );
772
773 // Verify the Kicad dictionary was loaded properly
774 // However, for the English language, the dictionary is not mandatory, as
775 // all messages are already in English, just restricted to ASCII7 chars,
776 // the verification is skipped.
777 if( !m_locale->IsLoaded( dictionaryName ) && m_language_id != wxLANGUAGE_ENGLISH )
778 {
779 wxLogTrace( traceLocale, wxT( "Unable to load dictionary %s.mo in %s" ),
780 dictionaryName, m_locale->GetName() );
781
782 setLanguageId( wxLANGUAGE_DEFAULT );
783 delete m_locale;
784
785 m_locale = new wxLocale;
786 m_locale->Init( wxLANGUAGE_DEFAULT );
787
788 aErrMsg = _( "The KiCad language file for this language is not installed." );
789 return false;
790 }
791
792 return true;
793}
794
795
796bool PGM_BASE::SetDefaultLanguage( wxString& aErrMsg )
797{
798 // Suppress error popups from wxLocale
799 wxLogNull doNotLog;
800
801 setLanguageId( wxLANGUAGE_DEFAULT );
802
803 // dictionary file name without extend (full name is kicad.mo)
804 wxString dictionaryName( wxT( "kicad" ) );
805
806 delete m_locale;
807 m_locale = new wxLocale;
808 m_locale->Init();
809
810 // Try adding the dictionary if it is not currently loaded
811 if( !m_locale->IsLoaded( dictionaryName ) )
812 m_locale->AddCatalog( dictionaryName );
813
814 // Verify the Kicad dictionary was loaded properly
815 // However, for the English language, the dictionary is not mandatory, as
816 // all messages are already in English, just restricted to ASCII7 chars,
817 // the verification is skipped.
818 if( !m_locale->IsLoaded( dictionaryName ) && m_language_id != wxLANGUAGE_ENGLISH )
819 {
820 wxLogTrace( traceLocale, wxT( "Unable to load dictionary %s.mo in %s" ),
821 dictionaryName, m_locale->GetName() );
822
823 setLanguageId( wxLANGUAGE_DEFAULT );
824 delete m_locale;
825
826 m_locale = new wxLocale;
827 m_locale->Init();
828
829 aErrMsg = _( "The KiCad language file for this language is not installed." );
830 return false;
831 }
832
833 return true;
834}
835
836
838{
839 wxLogTrace( traceLocale, wxT( "Select language ID %d from %d possible languages." ),
840 menu_id, (int)arrayDim( LanguagesList )-1 );
841
842 for( unsigned ii = 0; LanguagesList[ii].m_KI_Lang_Identifier != 0; ii++ )
843 {
844 if( menu_id == LanguagesList[ii].m_KI_Lang_Identifier )
845 {
846 setLanguageId( LanguagesList[ii].m_WX_Lang_Identifier );
847 break;
848 }
849 }
850}
851
852
854{
855 const wxLanguageInfo* langInfo = wxLocale::GetLanguageInfo( m_language_id );
856
857 if( !langInfo )
858 {
859 return "";
860 }
861 else
862 {
863 wxString str = langInfo->GetCanonicalWithRegion();
864 str.Replace( "_", "-" );
865
866 return str;
867 }
868}
869
870
872{
873#ifdef _MSC_VER
874 wxLocale::AddCatalogLookupPathPrefix( PATHS::GetWindowsBaseSharePath() + wxT( "locale" ) );
875#endif
876 wxLocale::AddCatalogLookupPathPrefix( PATHS::GetLocaleDataPath() );
877
878 if( wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) )
879 {
880 wxFileName fn( Pgm().GetExecutablePath() );
881 fn.RemoveLastDir();
882 fn.AppendDir( wxT( "translation" ) );
883 wxLocale::AddCatalogLookupPathPrefix( fn.GetPath() );
884 }
885}
886
887
888bool PGM_BASE::SetLocalEnvVariable( const wxString& aName, const wxString& aValue )
889{
890 wxString env;
891
892 if( aName.IsEmpty() )
893 {
894 wxLogTrace( traceEnvVars,
895 wxT( "PGM_BASE::SetLocalEnvVariable: Attempt to set empty variable to "
896 "value %s" ),
897 aValue );
898 return false;
899 }
900
901 // Check to see if the environment variable is already set.
902 if( wxGetEnv( aName, &env ) )
903 {
904 wxLogTrace( traceEnvVars,
905 wxT( "PGM_BASE::SetLocalEnvVariable: Environment variable %s already set "
906 "to %s" ),
907 aName, env );
908 return env == aValue;
909 }
910
911 wxLogTrace( traceEnvVars,
912 wxT( "PGM_BASE::SetLocalEnvVariable: Setting local environment variable %s to %s" ),
913 aName, aValue );
914
915 return wxSetEnv( aName, aValue );
916}
917
918
920{
921 // Overwrites externally defined environment variable until the next time the application
922 // is run.
923 for( const std::pair<wxString, ENV_VAR_ITEM> m_local_env_var : GetCommonSettings()->m_Env.vars )
924 {
925 wxLogTrace( traceEnvVars,
926 wxT( "PGM_BASE::SetLocalEnvVariables: Setting local environment variable %s "
927 "to %s" ),
928 m_local_env_var.first,
929 m_local_env_var.second.GetValue() );
930 wxSetEnv( m_local_env_var.first, m_local_env_var.second.GetValue() );
931 }
932}
933
934
936{
937 return GetCommonSettings()->m_Env.vars;
938}
939
940
942{
943 if( !wxTheApp )
944 return false;
945
946 return wxTheApp->IsGUI();
947}
948
949
950void PGM_BASE::HandleException( std::exception_ptr aPtr )
951{
952 try
953 {
954 if( aPtr )
955 std::rethrow_exception( aPtr );
956 }
957 catch( const IO_ERROR& ioe )
958 {
959 wxLogError( ioe.What() );
960 }
961 catch( const std::exception& e )
962 {
963#ifdef KICAD_USE_SENTRY
964 if( IsSentryOptedIn() )
965 {
966 sentry_value_t exc = sentry_value_new_exception( "exception", e.what() );
967 sentry_value_set_stacktrace( exc, NULL, 0 );
968
969 sentry_value_t sentryEvent = sentry_value_new_event();
970 sentry_event_add_exception( sentryEvent, exc );
971 sentry_capture_event( sentryEvent );
972 }
973#endif
974
975 wxLogError( wxT( "Unhandled exception class: %s what: %s" ),
976 From_UTF8( typeid( e ).name() ), From_UTF8( e.what() ) );
977 }
978 catch( ... )
979 {
980 wxLogError( wxT( "Unhandled exception of unknown type" ) );
981 }
982}
983
984
985#ifdef KICAD_USE_SENTRY
986struct SENTRY_ASSERT_CACHE_KEY
987{
988 wxString file;
989 int line;
990 wxString func;
991 wxString cond;
992 wxString msg;
993};
994
995
996bool operator<( const SENTRY_ASSERT_CACHE_KEY& aKey1, const SENTRY_ASSERT_CACHE_KEY& aKey2 )
997{
998 return aKey1.file < aKey2.file ||
999 aKey1.line < aKey2.line ||
1000 aKey1.func < aKey2.func ||
1001 aKey1.cond < aKey2.cond ||
1002 aKey1.msg < aKey2.msg;
1003}
1004#endif
1005
1006
1007void PGM_BASE::HandleAssert( const wxString& aFile, int aLine, const wxString& aFunc,
1008 const wxString& aCond, const wxString& aMsg )
1009{
1010 wxString assertStr;
1011
1012 // Log the assertion details to standard log
1013 if( !aMsg.empty() )
1014 {
1015 assertStr = wxString::Format( "Assertion failed at %s:%d in %s: %s - %s", aFile, aLine,
1016 aFunc, aCond, aMsg );
1017 }
1018 else
1019 {
1020 assertStr = wxString::Format( "Assertion failed at %s:%d in %s: %s", aFile, aLine, aFunc,
1021 aCond );
1022 }
1023
1024#ifndef NDEBUG
1025 wxLogError( assertStr );
1026#endif
1027
1028#ifdef KICAD_USE_SENTRY
1029 if( IsSentryOptedIn() )
1030 {
1031 static std::set<SENTRY_ASSERT_CACHE_KEY> assertCache;
1032
1033 SENTRY_ASSERT_CACHE_KEY key = { aFile, aLine, aFunc, aCond };
1034
1035 if( assertCache.find( key ) == assertCache.end() )
1036 {
1037 sentry_value_t exc = sentry_value_new_exception( "assert", assertStr );
1038 sentry_value_set_stacktrace( exc, NULL, 0 );
1039
1040 sentry_value_t sentryEvent = sentry_value_new_event();
1041 sentry_event_add_exception( sentryEvent, exc );
1042 sentry_capture_event( sentryEvent );
1043 assertCache.insert( key );
1044 }
1045 }
1046#endif
1047}
1048
1049
1050const wxString& PGM_BASE::GetExecutablePath() const
1051{
1052 return PATHS::GetExecutablePath();
1053}
1054
1055
1057{
1058 SetPdfBrowserName( GetCommonSettings()->m_System.pdf_viewer_name );
1060}
1061
1062
1064{
1067}
1068
1069
1071
1072
1074{
1075 wxASSERT( process ); // KIFACE_GETTER has already been called.
1076 return *process;
1077}
1078
1079
1080// Similar to PGM_BASE& Pgm(), but return nullptr when a *.ki_face is run from a python script.
1082{
1083 return process;
1084}
1085
1086
1087void SetPgm( PGM_BASE* pgm )
1088{
1089 process = pgm;
1090}
const char * name
Definition: DXF_plotter.cpp:59
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Returns # of elements in an array.
Definition: arraydim.h:31
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:104
wxString GetMajorMinorVersion()
Get only the major and minor version in a string major.minor.
wxString GetCommitHash()
Get the commit hash as a string.
wxString GetBuildVersion()
Get the full KiCad version string.
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
void InitializeEnvironment()
Creates the built-in environment variables and sets their default values.
ENVIRONMENT m_Env
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Definition: ki_exception.h:77
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:30
virtual bool SaveToFile(const wxString &aDirectory="", bool aForce=false)
Calls Store() and then writes the contents of the JSON document to a file.
static void Cleanup()
Call curl_global_cleanup for the application.
Definition: kicad_curl.cpp:49
static void Init()
Call curl_global_init for the application.
Definition: kicad_curl.cpp:38
void Load()
Load notifications stored from disk.
static wxString GetInstanceCheckerPath()
Gets the path used for wxSingleInstanceChecker lock files.
Definition: paths.cpp:446
static void EnsureUserPathsExist()
Ensures/creates user default paths.
Definition: paths.cpp:494
static bool EnsurePathExists(const wxString &aPath, bool aPathToFile=false)
Attempts to create a given path if it does not exist.
Definition: paths.cpp:467
static wxString GetUserCachePath()
Gets the stock (install) 3d viewer plugins path.
Definition: paths.cpp:409
static wxString GetLocaleDataPath()
Gets the locales translation data path.
Definition: paths.cpp:322
static const wxString & GetExecutablePath()
Definition: paths.cpp:619
Container for data for KiCad programs.
Definition: pgm_base.h:103
virtual COMMON_SETTINGS * GetCommonSettings() const
Definition: pgm_base.cpp:689
virtual wxApp & App()
Return a bare naked wxApp which may come from wxPython, SINGLE_TOP, or kicad.exe.
Definition: pgm_base.cpp:182
std::unique_ptr< NOTIFICATIONS_MANAGER > m_notifications_manager
Definition: pgm_base.h:402
int m_argcUtf8
Definition: pgm_base.h:439
virtual ENV_VAR_MAP & GetLocalEnvVariables() const
Definition: pgm_base.cpp:935
bool m_Printing
wxWidgets on MSW tends to crash if you spool up more than one print job at a time.
Definition: pgm_base.h:378
void setLanguageId(int aId)
Trap all changes in here, simplifies debugging.
Definition: pgm_base.h:391
std::unique_ptr< SETTINGS_MANAGER > m_settings_manager
Definition: pgm_base.h:400
void loadCommonSettings()
Load internal settings from COMMON_SETTINGS.
Definition: pgm_base.cpp:653
virtual void SetPdfBrowserName(const wxString &aFileName)
Definition: pgm_base.h:178
wxLocale * m_locale
Definition: pgm_base.h:416
void Destroy()
Definition: pgm_base.cpp:170
wxSplashScreen * m_splash
Definition: pgm_base.h:441
bool InitPgm(bool aHeadless=false, bool aSkipPyInit=false, bool aIsUnitTest=false)
Initialize this program.
Definition: pgm_base.cpp:457
char ** m_argvUtf8
argv parameters converted to utf8 form because wxWidgets has opinions.
Definition: pgm_base.h:437
virtual void ReadPdfBrowserInfos()
Read the PDF browser choice from the common configuration.
Definition: pgm_base.cpp:1056
bool IsGUI()
Determine if the application is running with a GUI.
Definition: pgm_base.cpp:941
bool m_use_system_pdf_browser
Definition: pgm_base.h:419
bool m_Quitting
Definition: pgm_base.h:382
virtual NOTIFICATIONS_MANAGER & GetNotificationsManager() const
Definition: pgm_base.h:134
void BuildArgvUtf8()
Builds the UTF8 based argv variable.
Definition: pgm_base.cpp:412
virtual const wxString & GetPdfBrowserName() const
Definition: pgm_base.h:176
virtual void SetTextEditor(const wxString &aFileName)
Definition: pgm_base.cpp:189
std::unique_ptr< wxSingleInstanceChecker > m_pgm_checker
Check if there is another copy of Kicad running at the same time.
Definition: pgm_base.h:407
virtual bool SetLocalEnvVariable(const wxString &aName, const wxString &aValue)
Set the environment variable aName to aValue.
Definition: pgm_base.cpp:888
wxString m_kicad_env
The KICAD system environment variable.
Definition: pgm_base.h:414
virtual void ForceSystemPdfBrowser(bool aFlg)
Force the use of system PDF browser, even if a preferred PDF browser is set.
Definition: pgm_base.h:193
virtual void SetLocalEnvVariables()
Update the local environment with the contents of the current ENV_VAR_MAP stored in the COMMON_SETTIN...
Definition: pgm_base.cpp:919
virtual void SetLanguagePath()
Definition: pgm_base.cpp:871
bool SetDefaultLanguage(wxString &aErrMsg)
Set the default language without reference to any preferences.
Definition: pgm_base.cpp:796
void ShowSplash()
Definition: pgm_base.cpp:427
wxString m_text_editor
Definition: pgm_base.h:422
virtual ~PGM_BASE()
Definition: pgm_base.cpp:153
std::unique_ptr< SCRIPTING > m_python_scripting
Definition: pgm_base.h:404
virtual void SetLanguageIdentifier(int menu_id)
Set in .m_language_id member the wxWidgets language identifier ID from the KiCad menu id (internal me...
Definition: pgm_base.cpp:837
int m_language_id
Definition: pgm_base.h:417
std::unique_ptr< BACKGROUND_JOBS_MONITOR > m_background_jobs_monitor
Definition: pgm_base.h:401
void HandleException(std::exception_ptr aPtr)
A exception handler to be used at the top level if exceptions bubble up that for.
Definition: pgm_base.cpp:950
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.
Definition: pgm_base.cpp:1007
virtual wxString GetLanguageTag()
Definition: pgm_base.cpp:853
virtual const wxString & GetTextEditor(bool aCanShowFileChooser=true)
Return the path to the preferred text editor application.
Definition: pgm_base.cpp:196
virtual const wxString & GetExecutablePath() const
Definition: pgm_base.cpp:1050
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition: pgm_base.h:125
void HideSplash()
Definition: pgm_base.cpp:446
virtual void WritePdfBrowserInfos()
Save the PDF browser choice to the common configuration.
Definition: pgm_base.cpp:1063
void SaveCommonSettings()
Save the program (process) settings subset which are stored .kicad_common.
Definition: pgm_base.cpp:680
bool m_PropertyGridInitialized
Definition: pgm_base.h:384
KICAD_SINGLETON m_singleton
Definition: pgm_base.h:424
virtual const wxString AskUserForPreferredEditor(const wxString &aDefaultEditor=wxEmptyString)
Show a dialog that instructs the user to select a new preferred editor.
Definition: pgm_base.cpp:232
virtual bool SetLanguage(wxString &aErrMsg, bool first_time=false)
Set the dictionary file name for internationalization.
Definition: pgm_base.cpp:695
bool LoadProject(const wxString &aFullPath, bool aSetActive=true)
Load a project or sets up a new project with a specified path.
bool WarnUserIfOperatingSystemUnsupported()
Checks if the operating system is explicitly unsupported and displays a disclaimer message box.
Definition: common.cpp:699
The common library.
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Display an informational message box with aMessage.
Definition: confirm.cpp:222
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition: confirm.cpp:195
This file is part of the common library.
bool operator<(const DESIGN_BLOCK_INFO &lhs, const DESIGN_BLOCK_INFO &rhs)
#define _(s)
#define WIN_STRING_DIR_SEP
Definition: gestfich.h:38
#define UNIX_STRING_DIR_SEP
Definition: gestfich.h:37
const wxChar *const traceLocale
Flag to enable locale debug output.
const wxChar *const traceEnvVars
Flag to enable debug output of environment variable operations.
Common command IDs shared by more than one of the KiCad applications.
@ ID_LANGUAGE_SWEDISH
Definition: id.h:137
@ ID_LANGUAGE_CHINESE_SIMPLIFIED
Definition: id.h:127
@ ID_LANGUAGE_GERMAN
Definition: id.h:111
@ ID_LANGUAGE_DUTCH
Definition: id.h:129
@ ID_LANGUAGE_GREEK
Definition: id.h:112
@ ID_LANGUAGE_HUNGARIAN
Definition: id.h:122
@ ID_LANGUAGE_LITHUANIAN
Definition: id.h:133
@ ID_LANGUAGE_PORTUGUESE_BRAZILIAN
Definition: id.h:116
@ ID_LANGUAGE_DEFAULT
Definition: id.h:104
@ ID_LANGUAGE_POLISH
Definition: id.h:123
@ ID_LANGUAGE_THAI
Definition: id.h:136
@ ID_LANGUAGE_JAPANESE
Definition: id.h:130
@ ID_LANGUAGE_VIETNAMESE
Definition: id.h:134
@ ID_LANGUAGE_ITALIAN
Definition: id.h:119
@ ID_LANGUAGE_KOREAN
Definition: id.h:125
@ ID_LANGUAGE_SERBIAN
Definition: id.h:135
@ ID_LANGUAGE_RUSSIAN
Definition: id.h:114
@ ID_LANGUAGE_CZECH
Definition: id.h:124
@ ID_LANGUAGE_UKRANIAN
Definition: id.h:138
@ ID_LANGUAGE_SPANISH
Definition: id.h:109
@ ID_LANGUAGE_PORTUGUESE
Definition: id.h:115
@ ID_LANGUAGE_ENGLISH
Definition: id.h:105
@ ID_LANGUAGE_SPANISH_MEXICAN
Definition: id.h:110
@ ID_LANGUAGE_CHINESE_TRADITIONAL
Definition: id.h:128
@ ID_LANGUAGE_FINNISH
Definition: id.h:107
@ ID_LANGUAGE_TURKISH
Definition: id.h:117
@ ID_LANGUAGE_DANISH
Definition: id.h:103
@ ID_LANGUAGE_FRENCH
Definition: id.h:106
@ ID_LANGUAGE_HEBREW
Definition: id.h:108
@ ID_LANGUAGE_INDONESIAN
Definition: id.h:118
std::map< wxString, ENV_VAR_ITEM > ENV_VAR_MAP
This file contains miscellaneous commonly used macros and functions.
PBOOL GetPolicyBool(const wxString &aKey)
Definition: unix/policy.cpp:26
void SetPgm(PGM_BASE *pgm)
Definition: pgm_base.cpp:1087
static PGM_BASE * process
Definition: pgm_base.cpp:1070
PGM_BASE & Pgm()
The global program "get" accessor.
Definition: pgm_base.cpp:1073
PGM_BASE * PgmOrNull()
Return a reference that can be nullptr when running a shared lib from a script, not from a kicad app.
Definition: pgm_base.cpp:1081
LANGUAGE_DESCR LanguagesList[]
An array containing all the languages that KiCad supports.
Definition: pgm_base.cpp:95
#define _(s)
Current list of languages supported by KiCad.
Definition: pgm_base.cpp:134
see class PGM_BASE
KICOMMON_API LANGUAGE_DESCR LanguagesList[]
An array containing all the languages that KiCad supports.
Definition: pgm_base.cpp:95
KICOMMON_API PGM_BASE & Pgm()
The global program "get" accessor.
Definition: pgm_base.cpp:1073
#define POLICY_KEY_DATACOLLECTION
Definition: policy_keys.h:30
#define PROJECT_VAR_NAME
A variable name whose value holds the current project directory.
Definition: project.h:40
APIIMPORT wxPGGlobalVarsClass * wxPGGlobalVars
wxString From_UTF8(const char *cstring)
A small class to handle the list of existing translations.
Definition: pgm_base.h:69
int m_KI_Lang_Identifier
KiCad identifier used in menu selection (See id.h)
Definition: pgm_base.h:74
wxString m_Lang_Label
Labels used in menus.
Definition: pgm_base.h:77
System directories search utilities.
wxLogTrace helper definitions.