@ -84,12 +84,6 @@ UsersPage::UsersPage( Config* config, QWidget* parent )
{
ui - > setupUi ( this ) ;
ui - > checkBoxReusePassword - > setVisible ( m_config - > writeRootPassword ( ) ) ;
ui - > checkBoxReusePassword - > setChecked ( m_config - > reuseUserPasswordForRoot ( ) ) ;
ui - > checkBoxRequireStrongPassword - > setVisible ( m_config - > permitWeakPasswords ( ) ) ;
ui - > checkBoxRequireStrongPassword - > setChecked ( m_config - > requireStrongPasswords ( ) ) ;
// Connect signals and slots
ui - > textBoxUserPassword - > setText ( config - > userPassword ( ) ) ;
connect ( ui - > textBoxUserPassword , & QLineEdit : : textChanged , config , & Config : : setUserPassword ) ;
@ -107,10 +101,6 @@ UsersPage::UsersPage( Config* config, QWidget* parent )
connect ( config , & Config : : rootPasswordSecondaryChanged , ui - > textBoxVerifiedRootPassword , & QLineEdit : : setText ) ;
connect ( config , & Config : : rootPasswordStatusChanged , this , & UsersPage : : reportRootPasswordStatus ) ;
connect ( ui - > checkBoxRequireStrongPassword , & QCheckBox : : stateChanged , this , [ this ] ( int checked ) {
m_config - > setRequireStrongPasswords ( checked ! = Qt : : Unchecked ) ;
} ) ;
connect ( ui - > textBoxFullName , & QLineEdit : : textEdited , config , & Config : : setFullName ) ;
connect ( config , & Config : : fullNameChanged , this , & UsersPage : : onFullNameTextEdited ) ;
@ -127,21 +117,23 @@ UsersPage::UsersPage( Config* config, QWidget* parent )
} ) ;
connect ( config , & Config : : autoLoginChanged , ui - > checkBoxDoAutoLogin , & QCheckBox : : setChecked ) ;
ui - > checkBoxReusePassword - > setVisible ( m_config - > writeRootPassword ( ) ) ;
ui - > checkBoxReusePassword - > setChecked ( m_config - > reuseUserPasswordForRoot ( ) ) ;
if ( m_config - > writeRootPassword ( ) )
{
connect ( ui - > checkBoxReusePassword , & QCheckBox : : stateChanged , this , [ this ] ( int checked ) {
m_config - > setReuseUserPasswordForRoot ( checked ! = Qt : : Unchecked ) ;
} ) ;
connect ( config , & Config : : reuseUserPasswordForRootChanged , ui - > checkBoxReusePassword , & QCheckBox : : setChecked ) ;
connect ( ui - > checkBoxReusePassword , & QCheckBox : : stateChanged , this , & UsersPage : : onReuseUserPasswordChanged ) ;
}
ui - > checkBoxRequireStrongPassword - > setVisible ( m_config - > permitWeakPasswords ( ) ) ;
ui - > checkBoxRequireStrongPassword - > setChecked ( m_config - > requireStrongPasswords ( ) ) ;
if ( m_config - > permitWeakPasswords ( ) )
{
connect ( ui - > checkBoxRequireStrongPassword , & QCheckBox : : stateChanged , this , [ this ] ( int checked ) {
m_config - > setRequireStrongPasswords ( checked ! = Qt : : Unchecked ) ;
} ) ;
connect ( config , & Config : : requireStrongPasswordsChanged , ui - > checkBoxRequireStrongPassword , & QCheckBox : : setChecked ) ;
connect (
config , & Config : : requireStrongPasswordsChanged , ui - > checkBoxRequireStrongPassword , & QCheckBox : : setChecked ) ;
}
CALAMARES_RETRANSLATE_SLOT ( & UsersPage : : retranslate )
@ -241,6 +233,8 @@ UsersPage::reportUserPasswordStatus( int validity, const QString& message )
void
UsersPage : : onReuseUserPasswordChanged ( const int checked )
{
// Pass the change on to config
m_config - > setReuseUserPasswordForRoot ( checked ! = Qt : : Unchecked ) ;
/* When "reuse" is checked, hide the fields for explicitly
* entering the root password . However , if we ' re going to
* disable the root password anyway , hide them all regardless of