mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
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:
@@ -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 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user