mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Merge pull request #226 from louib/fix/generatorCrash
Fixes #199 : Disable buttonGenerate when no classes.
This commit is contained in:
commit
7b2a9f7ea8
@ -132,8 +132,10 @@ void PasswordGeneratorWidget::updatePasswordStrength(const QString& password)
|
||||
|
||||
void PasswordGeneratorWidget::generatePassword()
|
||||
{
|
||||
if (m_generator->isValid()) {
|
||||
QString password = m_generator->generatePassword();
|
||||
m_ui->editNewPassword->setText(password);
|
||||
}
|
||||
}
|
||||
|
||||
void PasswordGeneratorWidget::applyPassword()
|
||||
@ -279,5 +281,11 @@ void PasswordGeneratorWidget::updateGenerator()
|
||||
m_generator->setCharClasses(classes);
|
||||
m_generator->setFlags(flags);
|
||||
|
||||
if (m_generator->isValid()) {
|
||||
m_ui->buttonGenerate->setEnabled(true);
|
||||
} else {
|
||||
m_ui->buttonGenerate->setEnabled(false);
|
||||
}
|
||||
|
||||
regeneratePassword();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user