22 #include <nlohmann/json.hpp> 45 for(
const auto& pair : m_PcmRepositories )
48 {
"url", pair.second.ToUTF8() } } ) );
55 m_PcmRepositories.clear();
57 if( !aObj.is_array() )
60 for(
const auto& entry : aObj )
62 if( entry.empty() || !entry.is_object() )
65 m_PcmRepositories.emplace_back(
66 std::make_pair( wxString( entry[
"name"].get<std::string>() ),
67 wxString( entry[
"url"].get<std::string>() ) ) );
72 "name": "KiCad official repository", 73 "url": "https://repository.kicad.org/repository.json" 78 new PARAM<wxString>(
"pcm.last_download_dir", &m_PcmLastDownloadDir,
"" ) );
87 ret &= fromLegacy<int>( aCfg,
"LeftWinWidth",
"appearance.left_frame_width" );
91 Set(
"window.size_x", 0 );
92 Set(
"window.size_y", 0 );
virtual bool MigrateFromLegacy(wxConfigBase *aLegacyConfig) override
Migrates from wxConfig to JSON-based configuration.
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)
virtual bool MigrateFromLegacy(wxConfigBase *aCfg) override
Migrates from wxConfig to JSON-based configuration.
std::vector< wxString > m_OpenProjects
const int kicadSchemaVersion
! Update the schema version whenever a migration is required
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.