Add optional import of SUMO/OSDU settings from JSON (#11630)

Add optionally import of SUMO/OSDU settings from JSON. Check for sumo_config.json and osdu_config.json. If present, import settings to preferences and set fields read only.
This commit is contained in:
Magne Sjaastad
2024-08-22 07:18:06 +02:00
committed by GitHub
parent 7651952c89
commit 1a3a005c1c
8 changed files with 141 additions and 3 deletions

View File

@@ -43,6 +43,48 @@ RiaPreferencesOsdu* RiaPreferencesOsdu::current()
return RiaApplication::instance()->preferences()->osduPreferences();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaPreferencesOsdu::setData( const std::map<QString, QString>& keyValuePairs )
{
for ( const auto& [key, value] : keyValuePairs )
{
if ( key == "server" )
{
m_server = value;
}
else if ( key == "dataPartitionId" )
{
m_dataPartitionId = value;
}
else if ( key == "authority" )
{
m_authority = value;
}
else if ( key == "scopes" )
{
m_scopes = value;
}
else if ( key == "clientId" )
{
m_clientId = value;
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaPreferencesOsdu::setFieldsReadOnly()
{
m_server.uiCapability()->setUiReadOnly( true );
m_dataPartitionId.uiCapability()->setUiReadOnly( true );
m_authority.uiCapability()->setUiReadOnly( true );
m_scopes.uiCapability()->setUiReadOnly( true );
m_clientId.uiCapability()->setUiReadOnly( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------