[users] Add preset to users module Config

This commit is contained in:
Adriaan de Groot 2021-03-12 13:25:16 +01:00
parent d9f2f5e988
commit 381a4f9b53
3 changed files with 26 additions and 1 deletions

View File

@ -16,6 +16,7 @@
#include "GlobalStorage.h" #include "GlobalStorage.h"
#include "JobQueue.h" #include "JobQueue.h"
#include "modulesystem/Preset.h"
#include "utils/Logger.h" #include "utils/Logger.h"
#include "utils/String.h" #include "utils/String.h"
#include "utils/Variant.h" #include "utils/Variant.h"
@ -105,7 +106,7 @@ Config::Config( QObject* parent )
connect( this, &Config::requireStrongPasswordsChanged, this, &Config::checkReady ); connect( this, &Config::requireStrongPasswordsChanged, this, &Config::checkReady );
} }
Config::~Config() { } Config::~Config() {}
void void
Config::setUserShell( const QString& shell ) Config::setUserShell( const QString& shell )
@ -836,6 +837,10 @@ Config::setConfigurationMap( const QVariantMap& configurationMap )
updateGSAutoLogin( doAutoLogin(), loginName() ); updateGSAutoLogin( doAutoLogin(), loginName() );
checkReady(); checkReady();
bool bogus = true;
Calamares::ModuleSystem::Presets p( CalamaresUtils::getSubMap( configurationMap, "presets", bogus ),
{ "fullname", "loginname", } );
} }
void void

View File

@ -159,3 +159,11 @@ setHostname: EtcFile
# (also adds localhost and some ipv6 standard entries). # (also adds localhost and some ipv6 standard entries).
# Defaults to *true*. # Defaults to *true*.
writeHostsFile: true writeHostsFile: true
presets:
fullname:
value: "OEM User"
editable: false
loginname:
value: "oem"
editable: false

View File

@ -43,6 +43,18 @@ properties:
setHostname: { type: string, enum: [ None, EtcFile, Hostnamed ] } setHostname: { type: string, enum: [ None, EtcFile, Hostnamed ] }
writeHostsFile: { type: boolean, default: true } writeHostsFile: { type: boolean, default: true }
# Presets
#
# TODO: lift up somewhere, since this will return in many modules;
# the type for each field (fullname, loginname) is a
# preset-description (value, editable).
presets:
type: object
additionalProperties: false
properties:
fullname: { type: object }
loginname: { type: object }
required: required:
- defaultGroups - defaultGroups
- autologinGroup - autologinGroup