22#include <nlohmann/json.hpp>
31 {
"name",
"KiCad official repository" },
49 [&]() -> nlohmann::json
51 nlohmann::json js = nlohmann::json::array();
55 js.push_back( nlohmann::json( { {
"name", pair.first.ToUTF8() },
56 {
"url", pair.second.ToUTF8() } } ) );
61 [&](
const nlohmann::json aObj )
65 if( !aObj.is_array() )
68 for(
const auto& entry : aObj )
70 if( entry.empty() || !entry.is_object() )
74 std::make_pair( wxString( entry[
"name"].get<std::string>() ),
75 wxString( entry[
"url"].get<std::string>() ) ) );
97 ret &= fromLegacy<int>( aCfg,
"LeftWinWidth",
"appearance.left_frame_width" );
101 Set(
"window.size_x", 0 );
102 Set(
"window.size_y", 0 );
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.
std::vector< PARAM_BASE * > m_params
The list of parameters (owned by this object)
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...
virtual bool MigrateFromLegacy(wxConfigBase *aLegacyConfig) override
Migrates from wxConfig to JSON-based configuration.
int m_updateCheck
General setting for various update checks.
wxString m_PcmLastDownloadDir
std::vector< wxString > m_OpenProjects
std::vector< std::pair< wxString, wxString > > m_PcmRepositories
Like a normal param, but with custom getter and setter functions.
const nlohmann::json PCM_DEFAULT_REPOSITORIES
const int kicadSchemaVersion
! Update the schema version whenever a migration is required
#define PCM_DEFAULT_REPOSITORY_URL