[users] Prep-work for configurable actions

- tidy include style
 - add setting to UsersViewStep for hostname action
main
Adriaan de Groot 5 years ago
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 <QObject>
#include <utils/PluginFactory.h>
#include <viewpages/ViewStep.h>
#include "SetHostNameJob.h"
#include <PluginDllMacro.h>
#include "PluginDllMacro.h"
#include "utils/PluginFactory.h"
#include "viewpages/ViewStep.h"
#include <QObject>
#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…
Cancel
Save