mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-25 03:15:44 -05:00
Merge branch 'fix-usersq' into calamares
This commit is contained in:
commit
44ac33845d
9 changed files with 68 additions and 92 deletions
|
@ -59,11 +59,11 @@ updateGSAutoLogin( bool doAutoLogin, const QString& login )
|
||||||
|
|
||||||
if ( doAutoLogin && !login.isEmpty() )
|
if ( doAutoLogin && !login.isEmpty() )
|
||||||
{
|
{
|
||||||
gs->insert( "autologinUser", login );
|
gs->insert( "autoLoginUser", login );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gs->remove( "autologinUser" );
|
gs->remove( "autoLoginUser" );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( login.isEmpty() )
|
if ( login.isEmpty() )
|
||||||
|
@ -142,13 +142,13 @@ insertInGlobalStorage( const QString& key, const QString& group )
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Config::setAutologinGroup( const QString& group )
|
Config::setAutoLoginGroup( const QString& group )
|
||||||
{
|
{
|
||||||
if ( group != m_autologinGroup )
|
if ( group != m_autoLoginGroup )
|
||||||
{
|
{
|
||||||
m_autologinGroup = group;
|
m_autoLoginGroup = group;
|
||||||
insertInGlobalStorage( QStringLiteral( "autologinGroup" ), group );
|
insertInGlobalStorage( QStringLiteral( "autoLoginGroup" ), group );
|
||||||
emit autologinGroupChanged( group );
|
emit autoLoginGroupChanged( group );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,9 +162,9 @@ Config::groupsForThisUser() const
|
||||||
{
|
{
|
||||||
l << g.name();
|
l << g.name();
|
||||||
}
|
}
|
||||||
if ( doAutoLogin() && !autologinGroup().isEmpty() )
|
if ( doAutoLogin() && !autoLoginGroup().isEmpty() )
|
||||||
{
|
{
|
||||||
l << autologinGroup();
|
l << autoLoginGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
return l;
|
return l;
|
||||||
|
@ -814,13 +814,13 @@ Config::setConfigurationMap( const QVariantMap& configurationMap )
|
||||||
// Now it might be explicitly set to empty, which is ok
|
// Now it might be explicitly set to empty, which is ok
|
||||||
setUserShell( shell );
|
setUserShell( shell );
|
||||||
|
|
||||||
setAutologinGroup( CalamaresUtils::getString( configurationMap, "autologinGroup" ) );
|
setAutoLoginGroup( CalamaresUtils::getString( configurationMap, "autoLoginGroup" ) );
|
||||||
setSudoersGroup( CalamaresUtils::getString( configurationMap, "sudoersGroup" ) );
|
setSudoersGroup( CalamaresUtils::getString( configurationMap, "sudoersGroup" ) );
|
||||||
|
|
||||||
m_hostNameActions = getHostNameActions( configurationMap );
|
m_hostNameActions = getHostNameActions( configurationMap );
|
||||||
|
|
||||||
setConfigurationDefaultGroups( configurationMap, m_defaultGroups );
|
setConfigurationDefaultGroups( configurationMap, m_defaultGroups );
|
||||||
m_doAutoLogin = CalamaresUtils::getBool( configurationMap, "doAutologin", false );
|
m_doAutoLogin = CalamaresUtils::getBool( configurationMap, "doAutoLogin", false );
|
||||||
|
|
||||||
m_writeRootPassword = CalamaresUtils::getBool( configurationMap, "setRootPassword", true );
|
m_writeRootPassword = CalamaresUtils::getBool( configurationMap, "setRootPassword", true );
|
||||||
Calamares::JobQueue::instance()->globalStorage()->insert( "setRootPassword", m_writeRootPassword );
|
Calamares::JobQueue::instance()->globalStorage()->insert( "setRootPassword", m_writeRootPassword );
|
||||||
|
|
|
@ -92,7 +92,7 @@ class PLUGINDLLEXPORT Config : public Calamares::ModuleSystem::Config
|
||||||
|
|
||||||
Q_PROPERTY( QString userShell READ userShell WRITE setUserShell NOTIFY userShellChanged )
|
Q_PROPERTY( QString userShell READ userShell WRITE setUserShell NOTIFY userShellChanged )
|
||||||
|
|
||||||
Q_PROPERTY( QString autologinGroup READ autologinGroup WRITE setAutologinGroup NOTIFY autologinGroupChanged )
|
Q_PROPERTY( QString autoLoginGroup READ autoLoginGroup WRITE setAutoLoginGroup NOTIFY autoLoginGroupChanged )
|
||||||
Q_PROPERTY( QString sudoersGroup READ sudoersGroup WRITE setSudoersGroup NOTIFY sudoersGroupChanged )
|
Q_PROPERTY( QString sudoersGroup READ sudoersGroup WRITE setSudoersGroup NOTIFY sudoersGroupChanged )
|
||||||
|
|
||||||
Q_PROPERTY( bool doAutoLogin READ doAutoLogin WRITE setAutoLogin NOTIFY autoLoginChanged )
|
Q_PROPERTY( bool doAutoLogin READ doAutoLogin WRITE setAutoLogin NOTIFY autoLoginChanged )
|
||||||
|
@ -185,7 +185,7 @@ public:
|
||||||
QString userShell() const { return m_userShell; }
|
QString userShell() const { return m_userShell; }
|
||||||
|
|
||||||
/// The group of which auto-login users must be a member
|
/// The group of which auto-login users must be a member
|
||||||
QString autologinGroup() const { return m_autologinGroup; }
|
QString autoLoginGroup() const { return m_autoLoginGroup; }
|
||||||
/// The group of which users who can "sudo" must be a member
|
/// The group of which users who can "sudo" must be a member
|
||||||
QString sudoersGroup() const { return m_sudoersGroup; }
|
QString sudoersGroup() const { return m_sudoersGroup; }
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ public:
|
||||||
const QList< GroupDescription >& defaultGroups() const { return m_defaultGroups; }
|
const QList< GroupDescription >& defaultGroups() const { return m_defaultGroups; }
|
||||||
/** @brief the names of all the groups for the current user
|
/** @brief the names of all the groups for the current user
|
||||||
*
|
*
|
||||||
* Takes into account defaultGroups and autologin behavior.
|
* Takes into account defaultGroups and autoLogin behavior.
|
||||||
*/
|
*/
|
||||||
QStringList groupsForThisUser() const;
|
QStringList groupsForThisUser() const;
|
||||||
|
|
||||||
|
@ -253,8 +253,8 @@ public Q_SLOTS:
|
||||||
*/
|
*/
|
||||||
void setUserShell( const QString& path );
|
void setUserShell( const QString& path );
|
||||||
|
|
||||||
/// Sets the autologin group; empty is ignored
|
/// Sets the autoLogin group; empty is ignored
|
||||||
void setAutologinGroup( const QString& group );
|
void setAutoLoginGroup( const QString& group );
|
||||||
/// Sets the sudoer group; empty is ignored
|
/// Sets the sudoer group; empty is ignored
|
||||||
void setSudoersGroup( const QString& group );
|
void setSudoersGroup( const QString& group );
|
||||||
|
|
||||||
|
@ -266,7 +266,7 @@ public Q_SLOTS:
|
||||||
/// Sets the host name (flags it as "custom")
|
/// Sets the host name (flags it as "custom")
|
||||||
void setHostName( const QString& host );
|
void setHostName( const QString& host );
|
||||||
|
|
||||||
/// Sets the autologin flag
|
/// Sets the autoLogin flag
|
||||||
void setAutoLogin( bool b );
|
void setAutoLogin( bool b );
|
||||||
|
|
||||||
/// Set to true to use the user password, unchanged, for root too
|
/// Set to true to use the user password, unchanged, for root too
|
||||||
|
@ -281,7 +281,7 @@ public Q_SLOTS:
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void userShellChanged( const QString& );
|
void userShellChanged( const QString& );
|
||||||
void autologinGroupChanged( const QString& );
|
void autoLoginGroupChanged( const QString& );
|
||||||
void sudoersGroupChanged( const QString& );
|
void sudoersGroupChanged( const QString& );
|
||||||
void fullNameChanged( const QString& );
|
void fullNameChanged( const QString& );
|
||||||
void loginNameChanged( const QString& );
|
void loginNameChanged( const QString& );
|
||||||
|
@ -305,7 +305,7 @@ private:
|
||||||
|
|
||||||
QList< GroupDescription > m_defaultGroups;
|
QList< GroupDescription > m_defaultGroups;
|
||||||
QString m_userShell;
|
QString m_userShell;
|
||||||
QString m_autologinGroup;
|
QString m_autoLoginGroup;
|
||||||
QString m_sudoersGroup;
|
QString m_sudoersGroup;
|
||||||
QString m_fullName;
|
QString m_fullName;
|
||||||
QString m_loginName;
|
QString m_loginName;
|
||||||
|
|
|
@ -184,11 +184,11 @@ SetupGroupsJob::exec()
|
||||||
tr( "These groups are missing in the target system: %1" ).arg( missingGroups.join( ',' ) ) );
|
tr( "These groups are missing in the target system: %1" ).arg( missingGroups.join( ',' ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_config->doAutoLogin() && !m_config->autologinGroup().isEmpty() )
|
if ( m_config->doAutoLogin() && !m_config->autoLoginGroup().isEmpty() )
|
||||||
{
|
{
|
||||||
const QString autologinGroup = m_config->autologinGroup();
|
const QString autoLoginGroup = m_config->autoLoginGroup();
|
||||||
(void)ensureGroupsExistInTarget(
|
(void)ensureGroupsExistInTarget(
|
||||||
QList< GroupDescription >() << GroupDescription( autologinGroup ), availableGroups, missingGroups );
|
QList< GroupDescription >() << GroupDescription( autoLoginGroup ), availableGroups, missingGroups );
|
||||||
}
|
}
|
||||||
|
|
||||||
return Calamares::JobResult::ok();
|
return Calamares::JobResult::ok();
|
||||||
|
|
|
@ -83,13 +83,13 @@ UserTests::testGetSet()
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const QString al( "autolg" );
|
const QString al( "autolg" );
|
||||||
QCOMPARE( c.autologinGroup(), QString() );
|
QCOMPARE( c.autoLoginGroup(), QString() );
|
||||||
c.setAutologinGroup( al );
|
c.setAutoLoginGroup( al );
|
||||||
QCOMPARE( c.autologinGroup(), al );
|
QCOMPARE( c.autoLoginGroup(), al );
|
||||||
QVERIFY( !c.doAutoLogin() );
|
QVERIFY( !c.doAutoLogin() );
|
||||||
c.setAutoLogin( true );
|
c.setAutoLogin( true );
|
||||||
QVERIFY( c.doAutoLogin() );
|
QVERIFY( c.doAutoLogin() );
|
||||||
QCOMPARE( c.autologinGroup(), al );
|
QCOMPARE( c.autoLoginGroup(), al );
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const QString su( "sudogrp" );
|
const QString su( "sudogrp" );
|
||||||
|
|
|
@ -88,10 +88,10 @@ UsersViewStep::isAtEnd() const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QList< Calamares::job_ptr >
|
Calamares::JobList
|
||||||
UsersViewStep::jobs() const
|
UsersViewStep::jobs() const
|
||||||
{
|
{
|
||||||
return m_jobs;
|
return m_config->createJobs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -108,7 +108,6 @@ UsersViewStep::onActivate()
|
||||||
void
|
void
|
||||||
UsersViewStep::onLeave()
|
UsersViewStep::onLeave()
|
||||||
{
|
{
|
||||||
m_jobs = m_config->createJobs();
|
|
||||||
m_config->finalizeGlobalStorage();
|
m_config->finalizeGlobalStorage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ public:
|
||||||
bool isAtBeginning() const override;
|
bool isAtBeginning() const override;
|
||||||
bool isAtEnd() const override;
|
bool isAtEnd() const override;
|
||||||
|
|
||||||
QList< Calamares::job_ptr > jobs() const override;
|
Calamares::JobList jobs() const override;
|
||||||
|
|
||||||
void onActivate() override;
|
void onActivate() override;
|
||||||
void onLeave() override;
|
void onLeave() override;
|
||||||
|
@ -48,8 +48,6 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
UsersPage* m_widget;
|
UsersPage* m_widget;
|
||||||
Calamares::JobList m_jobs;
|
|
||||||
|
|
||||||
Config* m_config;
|
Config* m_config;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -12,16 +12,12 @@
|
||||||
|
|
||||||
#include "UsersQmlViewStep.h"
|
#include "UsersQmlViewStep.h"
|
||||||
|
|
||||||
#include "SetHostNameJob.h"
|
#include "GlobalStorage.h"
|
||||||
#include "SetPasswordJob.h"
|
#include "JobQueue.h"
|
||||||
|
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "utils/NamedEnum.h"
|
#include "utils/NamedEnum.h"
|
||||||
#include "utils/Variant.h"
|
#include "utils/Variant.h"
|
||||||
|
|
||||||
#include "GlobalStorage.h"
|
|
||||||
#include "JobQueue.h"
|
|
||||||
|
|
||||||
CALAMARES_PLUGIN_FACTORY_DEFINITION( UsersQmlViewStepFactory, registerPlugin< UsersQmlViewStep >(); )
|
CALAMARES_PLUGIN_FACTORY_DEFINITION( UsersQmlViewStepFactory, registerPlugin< UsersQmlViewStep >(); )
|
||||||
|
|
||||||
UsersQmlViewStep::UsersQmlViewStep( QObject* parent )
|
UsersQmlViewStep::UsersQmlViewStep( QObject* parent )
|
||||||
|
@ -43,59 +39,41 @@ bool
|
||||||
UsersQmlViewStep::isNextEnabled() const
|
UsersQmlViewStep::isNextEnabled() const
|
||||||
{
|
{
|
||||||
return m_config->isReady();
|
return m_config->isReady();
|
||||||
//return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
UsersQmlViewStep::isBackEnabled() const
|
UsersQmlViewStep::isBackEnabled() const
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
UsersQmlViewStep::isAtBeginning() const
|
UsersQmlViewStep::isAtBeginning() const
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
UsersQmlViewStep::isAtEnd() const
|
UsersQmlViewStep::isAtEnd() const
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Calamares::JobList
|
||||||
QList< Calamares::job_ptr >
|
|
||||||
UsersQmlViewStep::jobs() const
|
UsersQmlViewStep::jobs() const
|
||||||
{
|
{
|
||||||
return m_jobs;
|
return m_config->createJobs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
UsersQmlViewStep::onActivate()
|
|
||||||
{
|
|
||||||
//m_config->onActivate();
|
|
||||||
//QmlViewStep::onActivate();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
UsersQmlViewStep::onLeave()
|
UsersQmlViewStep::onLeave()
|
||||||
{
|
{
|
||||||
m_jobs = m_config->createJobs();
|
|
||||||
m_config->finalizeGlobalStorage();
|
m_config->finalizeGlobalStorage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
UsersQmlViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
UsersQmlViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
||||||
{
|
{
|
||||||
m_config->setConfigurationMap( configurationMap );
|
m_config->setConfigurationMap( configurationMap );
|
||||||
|
|
||||||
Calamares::QmlViewStep::setConfigurationMap( configurationMap ); // call parent implementation last
|
Calamares::QmlViewStep::setConfigurationMap( configurationMap ); // call parent implementation last
|
||||||
setContextProperty( "Users", m_config );
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,14 +12,14 @@
|
||||||
#ifndef USERSQMLVIEWSTEP_H
|
#ifndef USERSQMLVIEWSTEP_H
|
||||||
#define USERSQMLVIEWSTEP_H
|
#define USERSQMLVIEWSTEP_H
|
||||||
|
|
||||||
#include <QObject>
|
// Config from users module
|
||||||
|
|
||||||
#include <utils/PluginFactory.h>
|
|
||||||
#include <viewpages/QmlViewStep.h>
|
|
||||||
|
|
||||||
#include <DllMacro.h>
|
|
||||||
|
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
|
|
||||||
|
#include "DllMacro.h"
|
||||||
|
#include "utils/PluginFactory.h"
|
||||||
|
#include "viewpages/QmlViewStep.h"
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
|
||||||
class PLUGINDLLEXPORT UsersQmlViewStep : public Calamares::QmlViewStep
|
class PLUGINDLLEXPORT UsersQmlViewStep : public Calamares::QmlViewStep
|
||||||
|
@ -37,9 +37,8 @@ public:
|
||||||
bool isAtBeginning() const override;
|
bool isAtBeginning() const override;
|
||||||
bool isAtEnd() const override;
|
bool isAtEnd() const override;
|
||||||
|
|
||||||
QList< Calamares::job_ptr > jobs() const override;
|
Calamares::JobList jobs() const override;
|
||||||
|
|
||||||
void onActivate() override;
|
|
||||||
void onLeave() override;
|
void onLeave() override;
|
||||||
|
|
||||||
void setConfigurationMap( const QVariantMap& configurationMap ) override;
|
void setConfigurationMap( const QVariantMap& configurationMap ) override;
|
||||||
|
@ -48,7 +47,6 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Config* m_config;
|
Config* m_config;
|
||||||
Calamares::JobList m_jobs;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CALAMARES_PLUGIN_FACTORY_DECLARATION( UsersQmlViewStepFactory )
|
CALAMARES_PLUGIN_FACTORY_DECLARATION( UsersQmlViewStepFactory )
|
||||||
|
|
|
@ -57,9 +57,10 @@ Kirigami.ScrollablePage {
|
||||||
id: _userNameField
|
id: _userNameField
|
||||||
width: parent.width
|
width: parent.width
|
||||||
placeholderText: qsTr("Your Full Name")
|
placeholderText: qsTr("Your Full Name")
|
||||||
onTextChanged: config.fullNameChanged(text)
|
text: config.fullName
|
||||||
background: Rectangle {
|
onTextChanged: config.setFullName(text);
|
||||||
|
|
||||||
|
background: Rectangle {
|
||||||
color: "#FBFBFB" // Kirigami.Theme.backgroundColor
|
color: "#FBFBFB" // Kirigami.Theme.backgroundColor
|
||||||
radius: 2
|
radius: 2
|
||||||
opacity: 0.9
|
opacity: 0.9
|
||||||
|
@ -85,8 +86,8 @@ Kirigami.ScrollablePage {
|
||||||
id: _userLoginField
|
id: _userLoginField
|
||||||
width: parent.width
|
width: parent.width
|
||||||
placeholderText: qsTr("Login Name")
|
placeholderText: qsTr("Login Name")
|
||||||
//text: config.userName
|
text: config.loginName
|
||||||
onTextEdited: config.loginNameStatusChanged(text)
|
onTextChanged: config.setLoginName(text)
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
|
|
||||||
|
@ -124,7 +125,8 @@ Kirigami.ScrollablePage {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
placeholderText: qsTr("Computer Name")
|
placeholderText: qsTr("Computer Name")
|
||||||
text: config.hostName
|
text: config.hostName
|
||||||
onTextEdited: config.hostNameStatusChanged(text)
|
onTextChanged: config.setHostName(text)
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
|
|
||||||
color: "#FBFBFB" // Kirigami.Theme.backgroundColor
|
color: "#FBFBFB" // Kirigami.Theme.backgroundColor
|
||||||
|
@ -164,10 +166,12 @@ Kirigami.ScrollablePage {
|
||||||
id: _passwordField
|
id: _passwordField
|
||||||
width: parent.width / 2 - 10
|
width: parent.width / 2 - 10
|
||||||
placeholderText: qsTr("Password")
|
placeholderText: qsTr("Password")
|
||||||
|
text: config.userPassword
|
||||||
|
onTextChanged: config.setUserPassword(text)
|
||||||
|
|
||||||
echoMode: TextInput.Password
|
echoMode: TextInput.Password
|
||||||
passwordMaskDelay: 300
|
passwordMaskDelay: 300
|
||||||
inputMethodHints: Qt.ImhNoAutoUppercase
|
inputMethodHints: Qt.ImhNoAutoUppercase
|
||||||
onTextChanged: config.userPasswordStatusChanged(text, _verificationPasswordField.text)
|
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
|
|
||||||
|
@ -183,10 +187,12 @@ Kirigami.ScrollablePage {
|
||||||
id: _verificationPasswordField
|
id: _verificationPasswordField
|
||||||
width: parent.width / 2 - 10
|
width: parent.width / 2 - 10
|
||||||
placeholderText: qsTr("Repeat Password")
|
placeholderText: qsTr("Repeat Password")
|
||||||
|
text: config.userPasswordSecondary
|
||||||
|
onTextChanged: config.setUserPasswordSecondary(text)
|
||||||
|
|
||||||
echoMode: TextInput.Password
|
echoMode: TextInput.Password
|
||||||
passwordMaskDelay: 300
|
passwordMaskDelay: 300
|
||||||
inputMethodHints: Qt.ImhNoAutoUppercase
|
inputMethodHints: Qt.ImhNoAutoUppercase
|
||||||
onTextChanged: config.userPasswordSecondaryChanged(_passwordField.text, text)
|
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
|
|
||||||
|
@ -211,17 +217,14 @@ Kirigami.ScrollablePage {
|
||||||
|
|
||||||
CheckBox {
|
CheckBox {
|
||||||
|
|
||||||
visible: config.allowWeakPasswords
|
visible: config.permitWeakPasswords
|
||||||
//visible: false
|
|
||||||
text: qsTr("Validate passwords quality")
|
text: qsTr("Validate passwords quality")
|
||||||
checked: config.allowWeakPasswordsDefault
|
checked: config.requireStrongPasswords
|
||||||
onToggled: config.allowWeakPasswordsDefault = !config.allowWeakPasswordsDefault
|
onCheckedChanged: config.setRequireStrongPasswords(checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
|
visible: config.permitWeakPasswords
|
||||||
visible: config.allowWeakPasswords
|
|
||||||
//visible: false
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
text: qsTr("When this box is checked, password-strength checking is done and you will not be able to use a weak password.")
|
text: qsTr("When this box is checked, password-strength checking is done and you will not be able to use a weak password.")
|
||||||
font.weight: Font.Thin
|
font.weight: Font.Thin
|
||||||
|
@ -230,24 +233,20 @@ Kirigami.ScrollablePage {
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckBox {
|
CheckBox {
|
||||||
|
|
||||||
text: qsTr("Log in automatically without asking for the password")
|
text: qsTr("Log in automatically without asking for the password")
|
||||||
checked: config.doAutologin
|
checked: config.doAutoLogin
|
||||||
onToggled: config.doAutologin = !config.doAutologin
|
onCheckedChanged: config.setAutoLogin(checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckBox {
|
CheckBox {
|
||||||
|
|
||||||
id: root
|
id: root
|
||||||
visible: config.doReusePassword
|
visible: config.writeRootPassword
|
||||||
text: qsTr("Reuse user password as root password")
|
text: qsTr("Reuse user password as root password")
|
||||||
checked: config.reuseUserPasswordForRoot
|
checked: config.reuseUserPasswordForRoot
|
||||||
//checked: false
|
onCheckedChanged: config.setReuseUserPasswordForRoot(checked)
|
||||||
onToggled: config.reuseUserPasswordForRoot = !config.reuseUserPasswordForRoot
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
|
|
||||||
visible: root.checked
|
visible: root.checked
|
||||||
width: parent.width
|
width: parent.width
|
||||||
text: qsTr("Use the same password for the administrator account.")
|
text: qsTr("Use the same password for the administrator account.")
|
||||||
|
@ -277,10 +276,12 @@ Kirigami.ScrollablePage {
|
||||||
id: _rootPasswordField
|
id: _rootPasswordField
|
||||||
width: parent.width / 2 -10
|
width: parent.width / 2 -10
|
||||||
placeholderText: qsTr("Root Password")
|
placeholderText: qsTr("Root Password")
|
||||||
|
text: config.rootPassword
|
||||||
|
onTextChanged: config.setRootPassword(text)
|
||||||
|
|
||||||
echoMode: TextInput.Password
|
echoMode: TextInput.Password
|
||||||
passwordMaskDelay: 300
|
passwordMaskDelay: 300
|
||||||
inputMethodHints: Qt.ImhNoAutoUppercase
|
inputMethodHints: Qt.ImhNoAutoUppercase
|
||||||
onTextChanged: config.rootPasswordChanged(text, _verificationRootPasswordField.text)
|
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
|
|
||||||
|
@ -296,10 +297,12 @@ Kirigami.ScrollablePage {
|
||||||
id: _verificationRootPasswordField
|
id: _verificationRootPasswordField
|
||||||
width: parent.width / 2 -10
|
width: parent.width / 2 -10
|
||||||
placeholderText: qsTr("Repeat Root Password")
|
placeholderText: qsTr("Repeat Root Password")
|
||||||
|
text: config.rootPasswordSecondary
|
||||||
|
onTextChanged: config.setRootPasswordSecondary(text)
|
||||||
|
|
||||||
echoMode: TextInput.Password
|
echoMode: TextInput.Password
|
||||||
passwordMaskDelay: 300
|
passwordMaskDelay: 300
|
||||||
inputMethodHints: Qt.ImhNoAutoUppercase
|
inputMethodHints: Qt.ImhNoAutoUppercase
|
||||||
onTextChanged: config.rootPasswordSecondaryChanged(_rootPasswordField.text, text)
|
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue