41 m_BoardLayersCount( 2 )
101 ret &= fromLegacy<bool>( aCfg,
102 "ShowBorderAndTitleBlock",
"appearance.show_border_and_titleblock" );
104 ret &= fromLegacy<bool>( aCfg,
"ShowDCodesOpt",
"appearance.show_dcodes" );
105 ret &= fromLegacy<bool>( aCfg,
"ShowNegativeObjectsOpt",
"appearance.show_negative_objects" );
108 auto migrate_files = [&] (
const std::string& aPath,
const std::string& aDest )
112 nlohmann::json js = nlohmann::json::array();
114 aCfg->SetPath( aPath );
116 for(
int i = 0; i < max_history_size; i++ )
118 key.Printf( wxT(
"file%d" ), i );
119 file = aCfg->Read( key, wxEmptyString );
121 if( !file.IsEmpty() )
122 js.emplace_back( file.ToStdString() );
125 aCfg->SetPath( wxT(
".." ) );
130 migrate_files(
"drl_files",
"system.drill_file_history" );
131 migrate_files(
"zip_files",
"system.zip_file_history" );
132 migrate_files(
"job_files",
"system.job_file_history" );
138 Set(
"gerber_to_pcb_layers", nlohmann::json::array() );
142 key.Printf( wxT(
"GbrLyr%dToPcb" ), i );
144 At(
"gerber_to_pcb_layers" ).emplace_back( value );
150 auto migrateLegacyColor = [&] (
const std::string& aKey,
int aLayerId ) {
153 if( aCfg->Read( aKey, &str ) )
169 key.Printf( wxT(
"ColorLayer%dEx" ), i );
170 migrateLegacyColor( key.ToStdString(),
id );
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
virtual bool MigrateFromLegacy(wxConfigBase *aCfg) override
Migrates from wxConfig to JSON-based configuration.
Color settings are a bit different than most of the settings objects in that there can be more than o...
void SetColor(int aLayer, const COLOR4D &aColor)
double m_OpacityModeAlphaValue
the alpha channel (opacity) value in opacity forced mode
std::vector< wxString > m_JobFileHistory
std::vector< wxString > m_DrillFileHistory
GBR_DISPLAY_OPTIONS m_Display
EXCELLON_DEFAULTS m_ExcellonDefaults
std::vector< int > m_GerberToPcbLayerMapping
A list of GERBER_DRAWLAYERS_COUNT length containing a mapping of gerber layers to PCB layers,...
std::vector< wxString > m_ZipFileHistory
virtual bool MigrateFromLegacy(wxConfigBase *aLegacyConfig) override
Migrates from wxConfig to JSON-based configuration.
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)
nlohmann::json & At(const std::string &aPath)
Wrappers for the underlying JSON API so that most consumers don't need json.hpp All of these function...
wxString GetFilename() const
A color representation with 4 components: red, green, blue, alpha.
virtual COMMON_SETTINGS * GetCommonSettings() const
virtual SETTINGS_MANAGER & GetSettingsManager() const
void SaveColorSettings(COLOR_SETTINGS *aSettings, const std::string &aNamespace="")
Safely saves a COLOR_SETTINGS to disk, preserving any changes outside the given namespace.
COLOR_SETTINGS * GetMigratedColorSettings()
Returns a color theme for storing colors migrated from legacy (5.x and earlier) settings,...
#define FMT_MANTISSA_INCH
const int gerbviewSchemaVersion
! Update the schema version whenever a migration is required
@ LAYER_GERBVIEW_DRAWINGSHEET
@ GERBVIEW_LAYER_ID_START
@ LAYER_GERBVIEW_BACKGROUND
@ LAYER_GERBVIEW_PAGE_LIMITS
#define GERBER_DRAWLAYERS_COUNT
PGM_BASE & Pgm()
The global Program "get" accessor.
bool show_negative_objects
bool show_border_and_titleblock