From ac5c1af829bd7da63295b60426d3001840a5f158 Mon Sep 17 00:00:00 2001 From: Bernhard Berg <34011017+Colfenor@users.noreply.github.com> Date: Tue, 22 Sep 2020 03:32:49 +0200 Subject: [PATCH] Add display number of characters in passphrases (#5449) Co-authored-by: Jonathan White --- src/gui/PasswordGeneratorWidget.cpp | 2 + src/gui/PasswordGeneratorWidget.ui | 298 ++++++++++++++-------------- 2 files changed, 156 insertions(+), 144 deletions(-) diff --git a/src/gui/PasswordGeneratorWidget.cpp b/src/gui/PasswordGeneratorWidget.cpp index 78b65b40..f76e3e3c 100644 --- a/src/gui/PasswordGeneratorWidget.cpp +++ b/src/gui/PasswordGeneratorWidget.cpp @@ -264,6 +264,8 @@ void PasswordGeneratorWidget::updatePasswordStrength(const QString& password) if (m_ui->tabWidget->currentIndex() == Diceware) { // Diceware estimates entropy differently health = PasswordHealth(m_dicewareGenerator->estimateEntropy()); + + m_ui->charactersInPassphraseLabel->setText(QString::number(password.length())); } m_ui->entropyLabel->setText(tr("Entropy: %1 bit").arg(QString::number(health.entropy(), 'f', 2))); diff --git a/src/gui/PasswordGeneratorWidget.ui b/src/gui/PasswordGeneratorWidget.ui index 65018cbd..00d7fde0 100644 --- a/src/gui/PasswordGeneratorWidget.ui +++ b/src/gui/PasswordGeneratorWidget.ui @@ -708,175 +708,185 @@ QProgressBar::chunk { Passphrase - - - - - - - - - 0 - 0 - + + + + + + Word Separator: + + + + + + + + 0 + 0 + + + + Wordlist: + + + + + + + QLayout::SetMinimumSize + + + + + 1 - - - - - - Word Count: + + 40 - - spinBoxLength + + 6 + + + 6 - - - - - Qt::Vertical + Qt::Horizontal + + + QSlider::TicksBelow + + + 8 + + + + + + + 1 + + + 100 + + + 6 + + + + + + + + + Word Count: + + + spinBoxLength + + + + + + + Character Count: + + + + + + + Word Case: + + + + + + + + + + + + Qt::Horizontal - 20 - 40 + 40 + 20 - - - - Word Separator: - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - QLayout::SetMinimumSize - - - - - 1 - - - 40 - - - 6 - - - 6 - - - Qt::Horizontal - - - QSlider::TicksBelow - - - 8 - - - - - - - 1 - - - 100 - - - 6 - - - - - - - - - Word Case: - - - - - + + + + + + - + 0 0 + + + 20 + 0 + + - Wordlist: + - - - - - - - 0 - 0 - - - - - 20 - 0 - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 0 + 0 + + + + + + + + character + + + + + + + Qt::Vertical + + + + 20 + 40 + + + +