37#include <wx/tokenzr.h>
63#if defined( __WXGTK__ ) || defined( __WXMSW__ )
125 [&]() -> nlohmann::json
127 nlohmann::json ret = {};
129 for(
const std::pair<wxString, ENV_VAR_ITEM> entry :
m_Env.
vars )
131 const ENV_VAR_ITEM& var = entry.second;
133 wxASSERT( entry.first == var.GetKey() );
136 if( var.IsDefault() )
138 wxLogTrace( traceEnvVars,
139 wxS(
"COMMON_SETTINGS: Env var %s skipping save (default)" ),
144 wxString value = var.GetValue();
148 if( var.GetDefinedExternally() )
150 if( var.GetDefinedInSettings() )
152 wxLogTrace( traceEnvVars,
153 wxS(
"COMMON_SETTINGS: Env var %s was overridden "
154 "externally, saving previously-loaded value %s" ),
155 var.GetKey(), var.GetSettingsValue() );
156 value = var.GetSettingsValue();
160 wxLogTrace( traceEnvVars,
161 wxS(
"COMMON_SETTINGS: Env var %s skipping save "
169 wxS(
"COMMON_SETTINGS: Saving env var %s = %s" ),
170 var.GetKey(), value);
172 std::string key( var.GetKey().ToUTF8() );
173 ret[ std::move( key ) ] = value;
178 [&](
const nlohmann::json& aJson )
180 if( !aJson.is_object() )
183 for(
const auto& entry : aJson.items() )
185 wxString key = wxString( entry.key().c_str(), wxConvUTF8 );
186 wxString val = entry.value().get<wxString>();
188 if( m_Env.vars.count( key ) )
190 if( m_Env.vars[key].GetDefinedExternally() )
193 wxS(
"COMMON_SETTINGS: %s is defined externally" ),
195 m_Env.vars[key].SetDefinedInSettings();
196 m_Env.vars[key].SetSettingsValue( val );
202 wxS(
"COMMON_SETTINGS: Updating %s: %s -> %s"),
203 key, m_Env.vars[key].GetValue(), val );
204 m_Env.vars[key].SetValue( val );
210 wxS(
"COMMON_SETTINGS: Loaded new var: %s = %s" ),
215 m_Env.vars[key].SetDefinedInSettings();
216 m_Env.vars[key].SetSettingsValue( val );
220 envVarsParam->SetClearUnknownKeys();
222 m_params.emplace_back(
new PARAM<bool>(
"input.focus_follow_sch_pcb",
223 &m_Input.focus_follow_sch_pcb,
false ) );
225 m_params.emplace_back(
new PARAM<bool>(
"input.auto_pan", &m_Input.auto_pan,
false ) );
227 m_params.emplace_back(
new PARAM<int>(
"input.auto_pan_acceleration",
228 &m_Input.auto_pan_acceleration, 5 ) );
230 m_params.emplace_back(
new PARAM<bool>(
"input.center_on_zoom",
231 &m_Input.center_on_zoom,
true ) );
233 m_params.emplace_back(
new PARAM<bool>(
"input.immediate_actions",
234 &m_Input.immediate_actions,
true ) );
236 m_params.emplace_back(
new PARAM<bool>(
"input.warp_mouse_on_move",
237 &m_Input.warp_mouse_on_move,
true ) );
239 m_params.emplace_back(
new PARAM<bool>(
"input.horizontal_pan",
240 &m_Input.horizontal_pan,
false ) );
242 m_params.emplace_back(
new PARAM<bool>(
"input.hotkey_feedback",
243 &m_Input.hotkey_feedback,
true ) );
245 m_params.emplace_back(
new PARAM<bool>(
"input.zoom_acceleration",
246 &m_Input.zoom_acceleration,
false ) );
249 int default_zoom_speed = 5;
251 int default_zoom_speed = 1;
254 m_params.emplace_back(
new PARAM<int>(
"input.zoom_speed",
255 &m_Input.zoom_speed, default_zoom_speed ) );
257 m_params.emplace_back(
new PARAM<bool>(
"input.zoom_speed_auto",
258 &m_Input.zoom_speed_auto,
true ) );
260 m_params.emplace_back(
new PARAM<int>(
"input.scroll_modifier_zoom",
261 &m_Input.scroll_modifier_zoom, 0 ) );
263 m_params.emplace_back(
new PARAM<int>(
"input.scroll_modifier_pan_h",
264 &m_Input.scroll_modifier_pan_h, WXK_CONTROL ) );
266 m_params.emplace_back(
new PARAM<int>(
"input.scroll_modifier_pan_v",
267 &m_Input.scroll_modifier_pan_v, WXK_SHIFT ) );
269 m_params.emplace_back(
new PARAM<bool>(
"input.reverse_scroll_zoom",
270 &m_Input.reverse_scroll_zoom,
false ) );
272 m_params.emplace_back(
new PARAM<bool>(
"input.reverse_scroll_pan_h",
273 &m_Input.reverse_scroll_pan_h,
false ) );
287 m_params.emplace_back(
new PARAM<int>(
"graphics.opengl_antialiasing_mode",
288 &m_Graphics.opengl_aa_mode, 2, 0, 2 ) );
290 m_params.emplace_back(
new PARAM<int>(
"graphics.cairo_antialiasing_mode",
291 &m_Graphics.cairo_aa_mode, 0, 0, 2 ) );
293 m_params.emplace_back(
new PARAM<int>(
"system.autosave_interval",
294 &m_System.autosave_interval, 600 ) );
298 &m_System.text_editor, wxS(
"/usr/bin/open -e" ) ) );
301 &m_System.text_editor, wxS(
"" ) ) );
304#if defined( __WINDOWS__ )
306 &m_System.file_explorer, wxS(
"explorer.exe /n,/select,%F" ) ) );
309 &m_System.file_explorer, wxS(
"" ) ) );
312 m_params.emplace_back(
new PARAM<int>(
"system.file_history_size",
313 &m_System.file_history_size, 9 ) );
316 &m_System.language, wxS(
"Default" ) ) );
319 &m_System.pdf_viewer_name, wxS(
"" ) ) );
321 m_params.emplace_back(
new PARAM<bool>(
"system.use_system_pdf_viewer",
322 &m_System.use_system_pdf_viewer,
true ) );
325 &m_System.working_dir, wxS(
"" ) ) );
327 m_params.emplace_back(
new PARAM<int>(
"system.clear_3d_cache_interval",
328 &m_System.clear_3d_cache_interval, 30 ) );
330 m_params.emplace_back(
new PARAM<bool>(
"do_not_show_again.zone_fill_warning",
331 &m_DoNotShowAgain.zone_fill_warning,
false ) );
333 m_params.emplace_back(
new PARAM<bool>(
"do_not_show_again.env_var_overwrite_warning",
334 &m_DoNotShowAgain.env_var_overwrite_warning,
false ) );
336 m_params.emplace_back(
new PARAM<bool>(
"do_not_show_again.scaled_3d_models_warning",
337 &m_DoNotShowAgain.scaled_3d_models_warning,
false ) );
339 m_params.emplace_back(
new PARAM<bool>(
"do_not_show_again.data_collection_prompt",
340 &m_DoNotShowAgain.data_collection_prompt,
false ) );
342 m_params.emplace_back(
new PARAM<bool>(
"do_not_show_again.update_check_prompt",
343 &m_DoNotShowAgain.update_check_prompt,
false ) );
345 m_params.emplace_back(
new PARAM<bool>(
"session.remember_open_files",
346 &m_Session.remember_open_files,
false ) );
349 &m_Session.pinned_symbol_libs, {} ) );
352 &m_Session.pinned_fp_libs, {} ) );
355 &m_Session.pinned_design_block_libs, {} ) );
357 m_params.emplace_back(
new PARAM<int>(
"netclass_panel.sash_pos",
358 &m_NetclassPanel.sash_pos, 160 ) );
360 m_params.emplace_back(
new PARAM<wxString>(
"netclass_panel.eeschema_shown_columns",
361 &m_NetclassPanel.eeschema_visible_columns,
"0 11 12 13 14" ) );
363 m_params.emplace_back(
new PARAM<wxString>(
"netclass_panel.pcbnew_shown_columns",
364 &m_NetclassPanel.pcbnew_visible_columns,
"0 1 2 3 4 5 6 7 8 9 10" ) );
366 m_params.emplace_back(
new PARAM<int>(
"package_manager.sash_pos",
367 &m_PackageManager.sash_pos, 380 ) );
370 [&]() -> nlohmann::json
372 nlohmann::json ret = {};
374 for(
const GIT_REPOSITORY& repo : m_Git.repositories )
376 nlohmann::json repoJson = {};
378 repoJson[
"name"] = repo.name;
379 repoJson[
"path"] = repo.path;
380 repoJson[
"authType"] = repo.authType;
381 repoJson[
"username"] = repo.username;
382 repoJson[
"ssh_path"] = repo.ssh_path;
383 repoJson[
"active"] = repo.active;
385 ret.push_back( repoJson );
390 [&](
const nlohmann::json& aJson )
392 if( !aJson.is_array() )
395 m_Git.repositories.clear();
397 for(
const auto& repoJson : aJson )
401 repo.name = repoJson[
"name"].get<wxString>();
402 repo.path = repoJson[
"path"].get<wxString>();
403 repo.authType = repoJson[
"authType"].get<wxString>();
404 repo.username = repoJson[
"username"].get<wxString>();
405 repo.ssh_path = repoJson[
"ssh_path"].get<wxString>();
406 repo.active = repoJson[
"active"].get<
bool>();
407 repo.checkValid =
true;
409 m_Git.repositories.push_back( repo );
415 &m_Git.authorName, wxS(
"" ) ) );
418 &m_Git.authorEmail, wxS(
"" ) ) );
420 m_params.emplace_back(
new PARAM<bool>(
"git.useDefaultAuthor",
421 &m_Git.useDefaultAuthor,
true ) );
423 m_params.emplace_back(
new PARAM<bool>(
"git.enableGit",
424 &m_Git.enableGit,
true ) );
426 m_params.emplace_back(
new PARAM<int>(
"git.updatInterval",
427 &m_Git.updatInterval, 5 ) );
430 &m_Api.python_interpreter, wxS(
"" ) ) );
432 m_params.emplace_back(
new PARAM<bool>(
"api.enable_server",
433 &m_Api.enable_server,
false ) );
450 nlohmann::json::json_pointer mwp_pointer(
"/input/mousewheel_pan"_json_pointer );
457 m_internals->At(
"input" ).erase(
"mousewheel_pan" );
462 wxT(
"COMMON_SETTINGS::Migrate 0->1: mousewheel_pan not found" ) );
467 ( *m_internals )[nlohmann::json::json_pointer(
"/input/horizontal_pan" )] =
true;
469 ( *m_internals )[nlohmann::json::json_pointer(
"/input/scroll_modifier_pan_h" )] =
471 ( *m_internals )[nlohmann::json::json_pointer(
"/input/scroll_modifier_pan_v" )] = 0;
472 ( *m_internals )[nlohmann::json::json_pointer(
"/input/scroll_modifier_zoom" )] =
477 ( *m_internals )[nlohmann::json::json_pointer(
"/input/horizontal_pan" )] =
false;
479 ( *m_internals )[nlohmann::json::json_pointer(
"/input/scroll_modifier_pan_h" )] =
481 ( *m_internals )[nlohmann::json::json_pointer(
"/input/scroll_modifier_pan_v" )] =
483 ( *m_internals )[nlohmann::json::json_pointer(
"/input/scroll_modifier_zoom" )] = 0;
492 nlohmann::json::json_pointer v1_pointer(
"/input/prefer_select_to_drag"_json_pointer );
494 bool prefer_selection =
false;
499 m_internals->at( nlohmann::json::json_pointer(
"/input"_json_pointer ) )
500 .erase(
"prefer_select_to_drag" );
505 wxT(
"COMMON_SETTINGS::Migrate 1->2: prefer_select_to_drag not found" ) );
508 if( prefer_selection )
509 ( *m_internals )[nlohmann::json::json_pointer(
"/input/mouse_left" )] =
510 MOUSE_DRAG_ACTION::SELECT;
512 ( *
m_internals )[nlohmann::json::json_pointer(
"/input/mouse_left" )] =
513 MOUSE_DRAG_ACTION::DRAG_ANY;
523 cfgpath.AppendDir( wxT(
"3d" ) );
524 cfgpath.SetFullName( wxS(
"3Dresolver.cfg" ) );
525 cfgpath.MakeAbsolute();
527 std::vector<LEGACY_3D_SEARCH_PATH> legacyPaths;
531 wxRegEx nonValidCharsRegex( wxS(
"[^A-Z0-9_]+" ), wxRE_ADVANCED );
535 wxString key =
path.m_Alias;
536 const wxString& val =
path.m_Pathvar;
545 key.Replace( wxS(
"-" ), wxS(
"_" ) );
548 nonValidCharsRegex.Replace( &key, wxEmptyString );
552 wxLogTrace(
traceEnvVars, wxS(
"COMMON_SETTINGS: Loaded new var: %s = %s" ), key, val );
557 if( cfgpath.FileExists() )
559 wxRemoveFile( cfgpath.GetFullPath() );
572 const nlohmann::json::json_pointer v3_pointer_eeschema(
"/netclass_panel/eeschema_shown_columns"_json_pointer );
573 wxString eeSchemaColumnList_old =
m_internals->at( v3_pointer_eeschema );
575 wxStringTokenizer eeSchemaShownTokens( eeSchemaColumnList_old );
576 wxString eeSchemaColumnList_new;
578 while( eeSchemaShownTokens.HasMoreTokens() )
581 eeSchemaShownTokens.GetNextToken().ToLong( &colNumber );
583 if( colNumber >= 10 )
586 eeSchemaColumnList_new += wxString::Format( wxT(
"%ld " ), colNumber );
589 eeSchemaColumnList_new.Trim(
true );
590 eeSchemaColumnList_new.Trim(
false );
592 m_internals->at( v3_pointer_eeschema ) = eeSchemaColumnList_new.ToUTF8();
595 const nlohmann::json::json_pointer v3_pointer_pcbnew(
"/netclass_panel/pcbnew_shown_columns"_json_pointer );
596 wxString pcbnewColumnList_old =
m_internals->at( v3_pointer_pcbnew );
598 wxStringTokenizer pcbnewShownTokens( pcbnewColumnList_old );
599 wxString pcbnewColumnList_new;
601 while( pcbnewShownTokens.HasMoreTokens() )
604 pcbnewShownTokens.GetNextToken().ToLong( &colNumber );
606 if( colNumber >= 10 )
609 pcbnewColumnList_new += wxString::Format( wxT(
"%ld " ), colNumber );
612 pcbnewColumnList_new.Trim(
true );
613 pcbnewColumnList_new.Trim(
false );
615 m_internals->at( v3_pointer_pcbnew ) = pcbnewColumnList_new.ToUTF8();
619 wxLogTrace(
traceSettings, wxT(
"COMMON_SETTINGS::Migrate 3->4: /netclass_panel/shown_columns not found" ) );
630 ret &= fromLegacy<double>( aCfg,
"CanvasScale",
"appearance.canvas_scale" );
631 ret &= fromLegacy<int>( aCfg,
"IconScale",
"appearance.icon_scale" );
632 ret &= fromLegacy<bool>( aCfg,
"UseIconsInMenus",
"appearance.use_icons_in_menus" );
633 ret &= fromLegacy<bool>( aCfg,
"ShowEnvVarWarningDialog",
"environment.show_warning_dialog" );
640 nlohmann::json::json_pointer ptr =
641 m_internals->PointerFromString(
"environment.vars" );
643 aCfg->SetPath(
"EnvironmentVariables" );
644 ( *m_internals )[ptr] = nlohmann::json( {} );
646 while( aCfg->GetNextEntry( key, index ) )
651 wxT(
"Migrate Env: %s is blacklisted; skipping." ), key );
655 value = aCfg->Read( key, wxEmptyString );
657 if( !value.IsEmpty() )
659 ptr.push_back( key.ToStdString() );
662 ptr.to_string(), value );
663 ( *m_internals )[ptr] = value.ToUTF8();
669 aCfg->SetPath(
".." );
674 bool mousewheel_pan =
false;
676 if( aCfg->Read(
"MousewheelPAN", &mousewheel_pan ) && mousewheel_pan )
678 Set(
"input.horizontal_pan",
true );
679 Set(
"input.scroll_modifier_pan_h",
static_cast<int>( WXK_SHIFT ) );
680 Set(
"input.scroll_modifier_pan_v", 0 );
681 Set(
"input.scroll_modifier_zoom",
static_cast<int>( WXK_CONTROL ) );
684 ret &= fromLegacy<bool>( aCfg,
"AutoPAN",
"input.auto_pan" );
685 ret &= fromLegacy<bool>( aCfg,
"ImmediateActions",
"input.immediate_actions" );
686 ret &= fromLegacy<bool>( aCfg,
"PreferSelectionToDragging",
"input.prefer_select_to_drag" );
687 ret &= fromLegacy<bool>( aCfg,
"MoveWarpsCursor",
"input.warp_mouse_on_move" );
688 ret &= fromLegacy<bool>( aCfg,
"ZoomNoCenter",
"input.center_on_zoom" );
691 if( std::optional<bool> value = Get<bool>(
"input.center_on_zoom" ) )
692 Set(
"input.center_on_zoom", !( *value ) );
694 ret &= fromLegacy<int>( aCfg,
"OpenGLAntialiasingMode",
"graphics.opengl_antialiasing_mode" );
695 ret &= fromLegacy<int>( aCfg,
"CairoAntialiasingMode",
"graphics.cairo_antialiasing_mode" );
697 ret &= fromLegacy<int>( aCfg,
"AutoSaveInterval",
"system.autosave_interval" );
699 ret &= fromLegacy<int>( aCfg,
"FileHistorySize",
"system.file_history_size" );
701 ret &=
fromLegacyString( aCfg,
"PdfBrowserName",
"system.pdf_viewer_name" );
702 ret &= fromLegacy<bool>( aCfg,
"UseSystemBrowser",
"system.use_system_pdf_viewer" );
712 [&](
const wxString& aKey,
const wxString& aDefault )
718 if( wxGetEnv( aKey, &envValue ) ==
true && !envValue.IsEmpty() )
723 wxS(
"InitializeEnvironment: Entry %s defined externally as %s" ), aKey,
728 wxLogTrace(
traceEnvVars, wxS(
"InitializeEnvironment: Setting entry %s to "
736 wxFileName
path( basePath );
737 path.AppendDir( wxT(
"footprints" ) );
741 path.AppendDir( wxT(
"3dmodels" ) );
753 path.AppendDir( wxT(
"symbols" ) );
757 path.AppendDir( wxT(
"blocks" ) );
763 std::vector<LEGACY_3D_SEARCH_PATH>& aSearchPaths )
765 wxFileName cfgpath(
path );
771 wxString cfgname = cfgpath.GetFullPath();
773 std::ifstream cfgFile;
776 if( !wxFileName::Exists( cfgname ) )
778 std::ostringstream ostr;
779 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
780 wxString errmsg =
"no 3D configuration file";
781 ostr <<
" * " << errmsg.ToUTF8() <<
" '";
782 ostr << cfgname.ToUTF8() <<
"'";
787 cfgFile.open( cfgname.ToUTF8() );
789 if( !cfgFile.is_open() )
791 std::ostringstream ostr;
792 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
793 wxString errmsg = wxS(
"Could not open configuration file" );
794 ostr <<
" * " << errmsg.ToUTF8() <<
" '" << cfgname.ToUTF8() <<
"'";
795 wxLogTrace(
traceSettings, wxS(
"%s\n" ), ostr.str().c_str() );
804 while( cfgFile.good() )
807 std::getline( cfgFile, cfgLine );
810 if( cfgLine.empty() )
818 if( 1 == lineno && cfgLine.compare( 0, 2,
"#V" ) == 0 )
821 if( cfgLine.size() > 2 )
823 std::istringstream istr;
824 istr.str( cfgLine.substr( 2 ) );
838 wxString versionedPath = wxString::Format( wxS(
"${%s}" ),
841 if( al.
m_Alias == versionedPath || al.
m_Alias == wxS(
"${KIPRJMOD}" )
842 || al.
m_Alias == wxS(
"$(KIPRJMOD)" ) || al.
m_Alias == wxS(
"${KISYS3DMOD}" )
843 || al.
m_Alias == wxS(
"$(KISYS3DMOD)" ) )
854 aSearchPaths.push_back( al );
868 if( aIndex >= aString.size() )
870 std::ostringstream ostr;
871 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
872 wxString errmsg = wxS(
"bad Hollerith string on line" );
873 ostr <<
" * " << errmsg.ToUTF8() <<
"\n'" << aString <<
"'";
874 wxLogTrace(
traceSettings, wxS(
"%s\n" ), ostr.str().c_str() );
879 size_t i2 = aString.find(
'"', aIndex );
881 if( std::string::npos == i2 )
883 std::ostringstream ostr;
884 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
885 wxString errmsg = wxS(
"missing opening quote mark in config file" );
886 ostr <<
" * " << errmsg.ToUTF8() <<
"\n'" << aString <<
"'";
887 wxLogTrace(
traceSettings, wxS(
"%s\n" ), ostr.str().c_str() );
894 if( i2 >= aString.size() )
896 std::ostringstream ostr;
897 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
898 wxString errmsg = wxS(
"invalid entry (unexpected end of line)" );
899 ostr <<
" * " << errmsg.ToUTF8() <<
"\n'" << aString <<
"'";
900 wxLogTrace(
traceSettings, wxS(
"%s\n" ), ostr.str().c_str() );
907 while( aString[i2] >=
'0' && aString[i2] <=
'9' )
908 tnum.append( 1, aString[i2++] );
910 if( tnum.empty() || aString[i2++] !=
':' )
912 std::ostringstream ostr;
913 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
914 wxString errmsg = wxS(
"bad Hollerith string on line" );
915 ostr <<
" * " << errmsg.ToUTF8() <<
"\n'" << aString <<
"'";
916 wxLogTrace(
traceSettings, wxS(
"%s\n" ), ostr.str().c_str() );
921 std::istringstream istr;
926 if( ( i2 + nchars ) >= aString.size() )
928 std::ostringstream ostr;
929 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
930 wxString errmsg = wxS(
"invalid entry (unexpected end of line)" );
931 ostr <<
" * " << errmsg.ToUTF8() <<
"\n'" << aString <<
"'";
932 wxLogTrace(
traceSettings, wxS(
"%s\n" ), ostr.str().c_str() );
939 aResult = wxString::FromUTF8( aString.substr( i2, nchars ).c_str() );
943 if( i2 >= aString.size() || aString[i2] !=
'"' )
945 std::ostringstream ostr;
946 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
947 wxString errmsg = wxS(
"missing closing quote mark in config file" );
948 ostr <<
" * " << errmsg.ToUTF8() <<
"\n'" << aString <<
"'";
949 wxLogTrace(
traceSettings, wxS(
"%s\n" ), ostr.str().c_str() );
static bool getLegacy3DHollerith(const std::string &aString, size_t &aIndex, wxString &aResult)
bool readLegacy3DResolverCfg(const wxString &aPath, std::vector< LEGACY_3D_SEARCH_PATH > &aSearchPaths)
void InitializeEnvironment()
Creates the built-in environment variables and sets their default values.
virtual bool MigrateFromLegacy(wxConfigBase *aLegacyConfig) override
Migrates from wxConfig to JSON-based configuration.
KiCad uses environment variables internally for determining the base paths for libraries,...
bool fromLegacyString(wxConfigBase *aConfig, const std::string &aKey, const std::string &aDest)
Translates a legacy wxConfig string value to a given JSON pointer value.
void Set(const std::string &aPath, ValueType aVal)
Stores a value into the JSON document Will throw an exception if ValueType isn't something that the l...
std::vector< PARAM_BASE * > m_params
The list of parameters (owned by this object)
std::unique_ptr< JSON_SETTINGS_INTERNALS > m_internals
Stores an enum as an integer.
Like a normal param, but with custom getter and setter functions.
static wxString GetUserTemplatesPath()
Gets the user path for custom templates.
static wxString GetStockEDALibraryPath()
Gets the stock (install) EDA library data path, which is the base path for templates,...
static wxString GetDefault3rdPartyPath()
Gets the default path for PCM packages.
static wxString GetStockTemplatesPath()
Gets the stock (install) templates path.
static wxString GetUserSettingsPath()
Return the user configuration path used to store KiCad's configuration files.
const int commonSchemaVersion
! Update the schema version whenever a migration is required
const wxRegEx versionedEnvVarRegex(wxS("KICAD[0-9]+_[A-Z0-9_]+(_DIR)?"))
! The following environment variables will never be migrated from a previous version
const wxRegEx versionedEnvVarRegex(wxS("KICAD[0-9]+_[A-Z0-9_]+(_DIR)?"))
Functions related to environment variables, including help functions.
const wxChar *const traceEnvVars
Flag to enable debug output of environment variable operations.
@ USER
The main config directory (e.g. ~/.config/kicad/)
KICOMMON_API wxString GetVersionedEnvVarName(const wxString &aBaseName)
Construct a versioned environment variable based on this KiCad major version.
bool apply_icon_scale_to_fonts
double hicontrast_dimming_factor
int min_interval
Minimum time, in seconds, between subsequent backups.
bool backup_on_autosave
Trigger a backup on autosave.
unsigned long long limit_total_size
Maximum total size of backups (bytes), 0 for unlimited.
int limit_total_files
Maximum number of backup archives to retain.
int limit_daily_files
Maximum files to keep per day, 0 for unlimited.
bool enabled
Automatically back up the project when files are saved.
System directories search utilities.
wxLogTrace helper definitions.
#define FN_NORMALIZE_FLAGS
Default flags to pass to wxFileName::Normalize().