mirror of
https://github.com/parchlinux/calamares.git
synced 2025-07-01 11:25:36 -04:00
[libcalamares] Add isEditable() check
This adds support for checking whether a field is editable; Config objects should reject changes if the field is not editable. There is an "unlock" setting to override the check, although this is currently always locked.
This commit is contained in:
parent
448e478b6d
commit
8b10a9cfc2
4 changed files with 68 additions and 2 deletions
|
@ -60,5 +60,20 @@ Config::loadPresets( const QVariantMap& configurationMap, const QStringList& rec
|
|||
= std::make_unique< Presets >( CalamaresUtils::getSubMap( configurationMap, key, bogus ), recognizedKeys );
|
||||
}
|
||||
|
||||
bool
|
||||
Config::isEditable( const QString& fieldName ) const
|
||||
{
|
||||
if ( m_unlocked )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if ( d && d->m_presets )
|
||||
{
|
||||
return d->m_presets->isEditable( fieldName );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
} // namespace ModuleSystem
|
||||
} // namespace Calamares
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue