20#include <wx/aui/framemanager.h>
34 {
"name",
"KiCad official repository" },
63 wxDefaultPosition ) );
70 [&]() -> nlohmann::json
72 nlohmann::json js = nlohmann::json::array();
76 js.push_back( nlohmann::json( { {
"name", pair.first.ToUTF8() },
77 {
"url", pair.second.ToUTF8() } } ) );
82 [&](
const nlohmann::json aObj )
86 if( !aObj.is_array() )
89 for(
const auto& entry : aObj )
91 if( entry.empty() || !entry.is_object() )
95 std::make_pair( wxString( entry[
"name"].get<std::string>() ),
96 wxString( entry[
"url"].get<std::string>() ) ) );
119 ret &=
fromLegacy<int>( aCfg,
"LeftWinWidth",
"appearance.left_frame_width" );
123 Set(
"window.size_x", 0 );
124 Set(
"window.size_y", 0 );
APP_SETTINGS_BASE(const std::string &aFilename, int aSchemaVersion)
virtual bool MigrateFromLegacy(wxConfigBase *aCfg) override
Migrates from wxConfig to JSON-based configuration.
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...
std::vector< PARAM_BASE * > m_params
The list of parameters (owned by this object)
wxString m_lastDesignBlockLibDir
wxSize m_TemplateWindowSize
virtual bool MigrateFromLegacy(wxConfigBase *aLegacyConfig) override
Migrates from wxConfig to JSON-based configuration.
wxPoint m_TemplateWindowPos
wxString m_lastUpdateCheckTime
wxString m_PcmLastDownloadDir
std::vector< wxString > m_OpenProjects
std::vector< std::pair< wxString, wxString > > m_PcmRepositories
wxString m_lastReceivedUpdate
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