mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Generate new password whenever the generator widget is opened.
Closes #414
This commit is contained in:
parent
8d16522d39
commit
7d4ef0b8d0
@ -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();
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ public:
|
||||
~PasswordGeneratorWidget();
|
||||
void loadSettings();
|
||||
void reset();
|
||||
void regeneratePassword();
|
||||
|
||||
Q_SIGNALS:
|
||||
void newPassword(const QString& password);
|
||||
|
@ -487,6 +487,7 @@ void EditEntryWidget::clear()
|
||||
|
||||
void EditEntryWidget::togglePasswordGeneratorButton(bool checked)
|
||||
{
|
||||
m_mainUi->passwordGenerator->regeneratePassword();
|
||||
m_mainUi->passwordGenerator->setVisible(checked);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user