Skip to content

New settings architecture

Jon Evans requested to merge craftyjon/kicad:settings-manager into master

This MR brings in a new settings framework for all of KiCad. This sets the groundwork for future improvements such as color themes, allows for more expressive settings files, and pulls all the settings into a few places rather than scattered throughout the codebase. It also introduces versioning for the user settings, with migration from previous versions.

Settings are now stored in a subdirectory of $KICAD_CONFIG_HOME based on the major and minor KiCad release version. For example, ~/.config/kicad/5.99/ today, and ~/.config/kicad/6.0/ upon release. Automatic, user-prompted migration of settings from previous versions is supported, and a dialog will be shown on first run if migration is necessary. This means that you can run a build from this branch in parallel with older KiCad builds, but settings changes made in the new folder will be incompatible with the old version (and backwards migration is not supported).

While I think it should be safe (and in my testing, it is safe) to run this in parallel with other KiCad versions, it's a good idea to back up your config directory before testing this code, since it's all very fresh.

The code is split across several commits for ease of review. They are not independent and will be squashed before merge.

Other notes:

  • ADVANCED_CONFIG is left alone for now
  • Hotkey configuration is left alone for now, because I think Seth is working on changes there
  • I removed some (very) legacy code that searched the common config file for library search paths
  • More cleanup of the wxConfig legacy (and simplification of how apps make use of settings) will be done in an follow-on MR after this is merged
  • This doesn't touch project or design files, but consider this a preview of some of the elements I plan to introduce for project-level settings files (as part of the "remove settings from design files" effort)
Edited by Jon Evans

Merge request reports