diff --git a/src/core/PasswordGenerator.cpp b/src/core/PasswordGenerator.cpp index 8517d85c5..8b0f99f8b 100644 --- a/src/core/PasswordGenerator.cpp +++ b/src/core/PasswordGenerator.cpp @@ -231,6 +231,9 @@ int PasswordGenerator::numCharClasses() const if (m_classes & SpecialCharacters) { numClasses++; } + if (m_classes & EASCII) { + numClasses++; + } return numClasses; } diff --git a/src/core/PasswordGenerator.h b/src/core/PasswordGenerator.h index 7c909411c..8ec82c0a0 100644 --- a/src/core/PasswordGenerator.h +++ b/src/core/PasswordGenerator.h @@ -33,7 +33,7 @@ public: UpperLetters = 0x2, Numbers = 0x4, SpecialCharacters = 0x8, - EASCII = 0x16 + EASCII = 0x10 }; Q_DECLARE_FLAGS(CharClasses, CharClass) diff --git a/src/gui/PasswordGeneratorWidget.cpp b/src/gui/PasswordGeneratorWidget.cpp index 1f5606cf6..e585b6f58 100644 --- a/src/gui/PasswordGeneratorWidget.cpp +++ b/src/gui/PasswordGeneratorWidget.cpp @@ -92,6 +92,7 @@ void PasswordGeneratorWidget::loadSettings() m_ui->checkBoxUpper->setChecked(config()->get("generator/UpperCase", true).toBool()); m_ui->checkBoxNumbers->setChecked(config()->get("generator/Numbers", true).toBool()); m_ui->checkBoxSpecialChars->setChecked(config()->get("generator/SpecialChars", false).toBool()); + m_ui->checkBoxExtASCII->setChecked(config()->get("generator/EASCII", false).toBool()); m_ui->checkBoxExcludeAlike->setChecked(config()->get("generator/ExcludeAlike", true).toBool()); m_ui->checkBoxEnsureEvery->setChecked(config()->get("generator/EnsureEvery", true).toBool()); m_ui->spinBoxLength->setValue(config()->get("generator/Length", 16).toInt()); @@ -112,6 +113,7 @@ void PasswordGeneratorWidget::saveSettings() config()->set("generator/UpperCase", m_ui->checkBoxUpper->isChecked()); config()->set("generator/Numbers", m_ui->checkBoxNumbers->isChecked()); config()->set("generator/SpecialChars", m_ui->checkBoxSpecialChars->isChecked()); + config()->set("generator/EASCII", m_ui->checkBoxExtASCII->isChecked()); config()->set("generator/ExcludeAlike", m_ui->checkBoxExcludeAlike->isChecked()); config()->set("generator/EnsureEvery", m_ui->checkBoxEnsureEvery->isChecked()); config()->set("generator/Length", m_ui->spinBoxLength->value()); @@ -287,6 +289,10 @@ PasswordGenerator::CharClasses PasswordGeneratorWidget::charClasses() classes |= PasswordGenerator::SpecialCharacters; } + if (m_ui->checkBoxExtASCII->isChecked()) { + classes |= PasswordGenerator::EASCII; + } + return classes; } @@ -325,6 +331,9 @@ void PasswordGeneratorWidget::updateGenerator() if (classes.testFlag(PasswordGenerator::SpecialCharacters)) { minLength++; } + if (classes.testFlag(PasswordGenerator::EASCII)) { + minLength++; + } } minLength = qMax(minLength, 1); diff --git a/src/gui/PasswordGeneratorWidget.ui b/src/gui/PasswordGeneratorWidget.ui index bb8bc0e76..a7af3d7f0 100644 --- a/src/gui/PasswordGeneratorWidget.ui +++ b/src/gui/PasswordGeneratorWidget.ui @@ -222,11 +222,11 @@ QProgressBar::chunk { - + - + 0 0 @@ -257,7 +257,7 @@ QProgressBar::chunk { - + 0 0 @@ -288,7 +288,7 @@ QProgressBar::chunk { - + 0 0 @@ -319,7 +319,7 @@ QProgressBar::chunk { - + 0 0 @@ -347,6 +347,43 @@ QProgressBar::chunk { + + + + + 0 + 0 + + + + + 0 + 25 + + + + + 16777215 + 16777215 + + + + Qt::StrongFocus + + + Extended ASCII + + + Extended ASCII + + + true + + + optionButtons + + +