Generate new password whenever the generator widget is opened.

Closes #414
This commit is contained in:
Felix Geyer
2016-08-06 11:29:47 +02:00
parent 8d16522d39
commit 7d4ef0b8d0
3 changed files with 11 additions and 4 deletions

View File

@@ -88,6 +88,14 @@ void PasswordGeneratorWidget::reset()
updateGenerator();
}
void PasswordGeneratorWidget::regeneratePassword()
{
if (m_generator->isValid()) {
QString password = m_generator->generatePassword();
m_ui->editNewPassword->setEditText(password);
}
}
void PasswordGeneratorWidget::updateApplyEnabled(const QString& password)
{
m_ui->buttonApply->setEnabled(!password.isEmpty());
@@ -199,8 +207,5 @@ void PasswordGeneratorWidget::updateGenerator()
m_generator->setCharClasses(classes);
m_generator->setFlags(flags);
if (m_generator->isValid()) {
QString password = m_generator->generatePassword();
m_ui->editNewPassword->setEditText(password);
}
regeneratePassword();
}