mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-24 10:55:46 -05:00
[users] Take setRootPassword into account when hiding fields
This commit is contained in:
parent
7752cf31b3
commit
c20ac0836e
1 changed files with 11 additions and 1 deletions
|
@ -105,6 +105,16 @@ UsersPage::UsersPage( QWidget* parent )
|
|||
checkReady( isReady() );
|
||||
} );
|
||||
connect( ui->checkBoxReusePassword, &QCheckBox::stateChanged, this, [this]( int checked ) {
|
||||
/* 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
|
||||
* the checkbox -- so when writeRoot is false, checked needs
|
||||
* to be true, to hide them all.
|
||||
*/
|
||||
if ( !m_writeRootPassword )
|
||||
{
|
||||
checked = true;
|
||||
}
|
||||
ui->labelChooseRootPassword->setVisible( !checked );
|
||||
ui->labelRootPassword->setVisible( !checked );
|
||||
ui->labelRootPasswordError->setVisible( !checked );
|
||||
|
@ -246,8 +256,8 @@ UsersPage::onActivate()
|
|||
void
|
||||
UsersPage::setWriteRootPassword( bool write )
|
||||
{
|
||||
ui->checkBoxReusePassword->setVisible( write );
|
||||
m_writeRootPassword = write;
|
||||
ui->checkBoxReusePassword->setVisible( write );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue