mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
fix password generator button's enable behavior
This commit is contained in:
parent
3c51455fa3
commit
3015baf6e6
@ -37,7 +37,7 @@ PasswordGeneratorWidget::PasswordGeneratorWidget(QWidget* parent)
|
|||||||
|
|
||||||
m_ui->togglePasswordButton->setIcon(filePath()->onOffIcon("actions", "password-show"));
|
m_ui->togglePasswordButton->setIcon(filePath()->onOffIcon("actions", "password-show"));
|
||||||
|
|
||||||
connect(m_ui->editNewPassword, SIGNAL(textChanged(QString)), SLOT(updateApplyEnabled(QString)));
|
connect(m_ui->editNewPassword, SIGNAL(textChanged(QString)), SLOT(updateButtonsEnabled(QString)));
|
||||||
connect(m_ui->editNewPassword, SIGNAL(textChanged(QString)), SLOT(updatePasswordStrength(QString)));
|
connect(m_ui->editNewPassword, SIGNAL(textChanged(QString)), SLOT(updatePasswordStrength(QString)));
|
||||||
connect(m_ui->togglePasswordButton, SIGNAL(toggled(bool)), SLOT(togglePasswordShown(bool)));
|
connect(m_ui->togglePasswordButton, SIGNAL(toggled(bool)), SLOT(togglePasswordShown(bool)));
|
||||||
connect(m_ui->buttonApply, SIGNAL(clicked()), SLOT(applyPassword()));
|
connect(m_ui->buttonApply, SIGNAL(clicked()), SLOT(applyPassword()));
|
||||||
@ -139,6 +139,7 @@ void PasswordGeneratorWidget::reset()
|
|||||||
|
|
||||||
void PasswordGeneratorWidget::setStandaloneMode(bool standalone)
|
void PasswordGeneratorWidget::setStandaloneMode(bool standalone)
|
||||||
{
|
{
|
||||||
|
m_standalone = standalone;
|
||||||
if (standalone) {
|
if (standalone) {
|
||||||
m_ui->buttonApply->setText(tr("Close"));
|
m_ui->buttonApply->setText(tr("Close"));
|
||||||
togglePasswordShown(true);
|
togglePasswordShown(true);
|
||||||
@ -164,9 +165,12 @@ void PasswordGeneratorWidget::regeneratePassword()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PasswordGeneratorWidget::updateApplyEnabled(const QString& password)
|
void PasswordGeneratorWidget::updateButtonsEnabled(const QString& password)
|
||||||
{
|
{
|
||||||
m_ui->buttonApply->setEnabled(!password.isEmpty());
|
if (!m_standalone) {
|
||||||
|
m_ui->buttonApply->setEnabled(!password.isEmpty());
|
||||||
|
}
|
||||||
|
m_ui->buttonCopy->setEnabled(!password.isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
void PasswordGeneratorWidget::updatePasswordStrength(const QString& password)
|
void PasswordGeneratorWidget::updatePasswordStrength(const QString& password)
|
||||||
|
@ -58,7 +58,7 @@ signals:
|
|||||||
private slots:
|
private slots:
|
||||||
void applyPassword();
|
void applyPassword();
|
||||||
void copyPassword();
|
void copyPassword();
|
||||||
void updateApplyEnabled(const QString& password);
|
void updateButtonsEnabled(const QString& password);
|
||||||
void updatePasswordStrength(const QString& password);
|
void updatePasswordStrength(const QString& password);
|
||||||
void togglePasswordShown(bool hidden);
|
void togglePasswordShown(bool hidden);
|
||||||
|
|
||||||
@ -72,6 +72,7 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_updatingSpinBox;
|
bool m_updatingSpinBox;
|
||||||
|
bool m_standalone = false;
|
||||||
|
|
||||||
PasswordGenerator::CharClasses charClasses();
|
PasswordGenerator::CharClasses charClasses();
|
||||||
PasswordGenerator::GeneratorFlags generatorFlags();
|
PasswordGenerator::GeneratorFlags generatorFlags();
|
||||||
|
Loading…
Reference in New Issue
Block a user