mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-29 01:28:47 -04:00
Generate new password whenever the generator widget is opened.
Closes #414
This commit is contained in:
parent
8d16522d39
commit
7d4ef0b8d0
3 changed files with 11 additions and 4 deletions
|
@ -88,6 +88,14 @@ void PasswordGeneratorWidget::reset()
|
||||||
updateGenerator();
|
updateGenerator();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PasswordGeneratorWidget::regeneratePassword()
|
||||||
|
{
|
||||||
|
if (m_generator->isValid()) {
|
||||||
|
QString password = m_generator->generatePassword();
|
||||||
|
m_ui->editNewPassword->setEditText(password);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void PasswordGeneratorWidget::updateApplyEnabled(const QString& password)
|
void PasswordGeneratorWidget::updateApplyEnabled(const QString& password)
|
||||||
{
|
{
|
||||||
m_ui->buttonApply->setEnabled(!password.isEmpty());
|
m_ui->buttonApply->setEnabled(!password.isEmpty());
|
||||||
|
@ -199,8 +207,5 @@ void PasswordGeneratorWidget::updateGenerator()
|
||||||
m_generator->setCharClasses(classes);
|
m_generator->setCharClasses(classes);
|
||||||
m_generator->setFlags(flags);
|
m_generator->setFlags(flags);
|
||||||
|
|
||||||
if (m_generator->isValid()) {
|
regeneratePassword();
|
||||||
QString password = m_generator->generatePassword();
|
|
||||||
m_ui->editNewPassword->setEditText(password);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,7 @@ public:
|
||||||
~PasswordGeneratorWidget();
|
~PasswordGeneratorWidget();
|
||||||
void loadSettings();
|
void loadSettings();
|
||||||
void reset();
|
void reset();
|
||||||
|
void regeneratePassword();
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void newPassword(const QString& password);
|
void newPassword(const QString& password);
|
||||||
|
|
|
@ -487,6 +487,7 @@ void EditEntryWidget::clear()
|
||||||
|
|
||||||
void EditEntryWidget::togglePasswordGeneratorButton(bool checked)
|
void EditEntryWidget::togglePasswordGeneratorButton(bool checked)
|
||||||
{
|
{
|
||||||
|
m_mainUi->passwordGenerator->regeneratePassword();
|
||||||
m_mainUi->passwordGenerator->setVisible(checked);
|
m_mainUi->passwordGenerator->setVisible(checked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue