[users] Prep-work for configurable actions
- tidy include style - add setting to UsersViewStep for hostname action
This commit is contained in:
parent
33b3321698
commit
61d096c9ec
@ -25,6 +25,7 @@
|
||||
#include "UsersPage.h"
|
||||
|
||||
#include "utils/Logger.h"
|
||||
#include "utils/NamedEnum.h"
|
||||
#include "utils/Variant.h"
|
||||
|
||||
#include "GlobalStorage.h"
|
||||
@ -32,9 +33,28 @@
|
||||
|
||||
CALAMARES_PLUGIN_FACTORY_DEFINITION( UsersViewStepFactory, registerPlugin< UsersViewStep >(); )
|
||||
|
||||
static const NamedEnumTable< SetHostNameJob::Action >&
|
||||
hostnameActions()
|
||||
{
|
||||
using Action = SetHostNameJob::Action;
|
||||
|
||||
// *INDENT-OFF*
|
||||
// clang-format off
|
||||
static const NamedEnumTable< Action > names {
|
||||
{ QStringLiteral( "none" ), Action::None },
|
||||
{ QStringLiteral( "etcfile" ), Action::EtcHostname },
|
||||
{ QStringLiteral( "hostnamed" ), Action::SystemdHostname }
|
||||
};
|
||||
// clang-format on
|
||||
// *INDENT-ON*
|
||||
|
||||
return names;
|
||||
}
|
||||
|
||||
UsersViewStep::UsersViewStep( QObject* parent )
|
||||
: Calamares::ViewStep( parent )
|
||||
, m_widget( new UsersPage() )
|
||||
, m_actions( SetHostNameJob::Action::None )
|
||||
{
|
||||
emit nextStatusChanged( true );
|
||||
connect( m_widget, &UsersPage::checkReady, this, &UsersViewStep::nextStatusChanged );
|
||||
|
@ -20,13 +20,13 @@
|
||||
#ifndef USERSPAGEPLUGIN_H
|
||||
#define USERSPAGEPLUGIN_H
|
||||
|
||||
#include "SetHostNameJob.h"
|
||||
|
||||
#include "PluginDllMacro.h"
|
||||
#include "utils/PluginFactory.h"
|
||||
#include "viewpages/ViewStep.h"
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <utils/PluginFactory.h>
|
||||
#include <viewpages/ViewStep.h>
|
||||
|
||||
#include <PluginDllMacro.h>
|
||||
|
||||
#include <QVariant>
|
||||
|
||||
class UsersPage;
|
||||
@ -61,6 +61,7 @@ private:
|
||||
QList< Calamares::job_ptr > m_jobs;
|
||||
|
||||
QStringList m_defaultGroups;
|
||||
SetHostNameJob::Actions m_actions;
|
||||
};
|
||||
|
||||
CALAMARES_PLUGIN_FACTORY_DECLARATION( UsersViewStepFactory )
|
||||
|
Loading…
Reference in New Issue
Block a user