146 [&]() -> nlohmann::json
162 [&](
const nlohmann::json& aVal )
164 if( aVal.empty() || !aVal.is_object() )
178 {
"lockedItems",
false },
184 {
"graphics",
true },
186 {
"otherItems",
true }
205 std::string gridSizePtr =
"window.grid.last_size";
207 if( std::optional<int> currentSize =
Get<int>( gridSizePtr ) )
209 Set( gridSizePtr, *currentSize - 4 );
214 Set( gridSizePtr, 1 );
217 ret &=
fromLegacy<int>( aCfg,
"DefaultWireWidth",
"defaults.line_width" );
218 ret &=
fromLegacy<int>( aCfg,
"DefaultPinLength",
"defaults.pin_length" );
219 ret &=
fromLegacy<int>( aCfg,
"LibeditPinNameSize",
"defaults.pin_name_size" );
220 ret &=
fromLegacy<int>( aCfg,
"LibeditPinNumSize",
"defaults.pin_num_size" );
222 ret &=
fromLegacy<int>( aCfg,
"LibeditRepeatLabelInc",
"repeat.label_delta" );
223 ret &=
fromLegacy<int>( aCfg,
"LibeditPinRepeatStep",
"repeat.pin_step" );
228 ret &=
fromLegacy<bool>( aCfg,
"LibeditShowPinElectricalType",
"show_pin_electrical_type" );
230 ret &=
fromLegacyString( aCfg,
"LibEditFieldsShownColumns",
"edit_symbol_visible_columns" );
232 ret &=
fromLegacyString( aCfg,
"PinTableShownColumns",
"pin_table_visible_columns" );
APP_SETTINGS_BASE(const std::string &aFilename, int aSchemaVersion)
virtual bool MigrateFromLegacy(wxConfigBase *aCfg) override
Migrates from wxConfig to JSON-based configuration.
bool migrateLibTreeWidth()
Migrate the library tree width setting from a single column (Item) to multi-column.
bool fromLegacyString(wxConfigBase *aConfig, const std::string &aKey, const std::string &aDest)
Translates a legacy wxConfig string value to a given JSON pointer value.
bool fromLegacy(wxConfigBase *aConfig, const std::string &aKey, const std::string &aDest)
Translates a legacy wxConfig 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...
static bool SetIfPresent(const nlohmann::json &aObj, const std::string &aPath, wxString &aTarget)
Sets the given string if the given key/path is present.
std::optional< ValueType > Get(const std::string &aPath) const
Fetches a value from within the JSON document.
std::vector< PARAM_BASE * > m_params
The list of parameters (owned by this object)
void registerMigration(int aOldSchemaVersion, int aNewSchemaVersion, std::function< bool(void)> aMigrator)
Registers a migration from one schema version to another.
void SetLegacyFilename(const wxString &aFilename)
Like a normal param, but with custom getter and setter functions.
Represents a map of <std::string, Value>.
virtual bool MigrateFromLegacy(wxConfigBase *aLegacyConfig) override
Migrates from wxConfig to JSON-based configuration.
bool m_UseEeschemaColorSettings
PANEL_LIB_FIELDS_TABLE m_LibFieldEditor
bool m_ShowPinElectricalType
DIALOG_IMPORT_GRAPHICS m_ImportGraphics
wxString m_PinTableVisibleColumns
SCH_SELECTION_FILTER_OPTIONS m_SelectionFilter
wxString m_EditSymbolVisibleColumns
bool m_ShowPinAltIcons
When true, dragging an outline edge will drag pins rooted on it.
bool m_dragPinsAlongWithEdges
#define DEFAULT_PINNUM_SIZE
The default pin name size when creating pins(can be changed in preference menu)
#define DEFAULT_PINNAME_SIZE
The default selection highlight thickness (can be changed in preference menu)
#define DEFAULT_PIN_LENGTH
The default pin number size when creating pins(can be changed in preference menu)
#define DEFAULT_TEXT_SIZE
Ratio of the font height to the baseline of the text above the wire.
const int libeditSchemaVersion
! Update the schema version whenever a migration is required