mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-02-05 01:15:33 -05:00
let every string as separator
This commit is contained in:
parent
7541f57aeb
commit
8937647d5f
@ -75,7 +75,7 @@ void PassphraseGenerator::setWordlist(QString path)
|
||||
}
|
||||
}
|
||||
|
||||
void PassphraseGenerator::setWordseparator(QChar separator) {
|
||||
void PassphraseGenerator::setWordseparator(QString separator) {
|
||||
m_separator = separator;
|
||||
}
|
||||
|
||||
|
@ -30,14 +30,14 @@ public:
|
||||
double calculateEntropy(QString passphrase);
|
||||
void setWordCount(int wordCount);
|
||||
void setWordlist(QString path);
|
||||
void setWordseparator(QChar separator);
|
||||
void setWordseparator(QString separator);
|
||||
bool isValid() const;
|
||||
|
||||
QString generatePassphrase() const;
|
||||
|
||||
private:
|
||||
int m_wordCount;
|
||||
QChar m_separator;
|
||||
QString m_separator;
|
||||
QVector<QString> m_wordlist;
|
||||
|
||||
Q_DISABLE_COPY(PassphraseGenerator)
|
||||
|
@ -48,7 +48,7 @@ PasswordGeneratorWidget::PasswordGeneratorWidget(QWidget* parent)
|
||||
connect(m_ui->sliderWordCount, SIGNAL(valueChanged(int)), SLOT(dicewareSliderMoved()));
|
||||
connect(m_ui->spinBoxWordCount, SIGNAL(valueChanged(int)), SLOT(dicewareSpinBoxChanged()));
|
||||
|
||||
connect(m_ui->comboBoxWordSeparator, SIGNAL(currentIndexChanged(int)), SLOT(updateGenerator()));
|
||||
connect(m_ui->editWordSeparator, SIGNAL(textChanged(QString)), SLOT(updateGenerator()));
|
||||
connect(m_ui->comboBoxWordList, SIGNAL(currentIndexChanged(int)), SLOT(updateGenerator()));
|
||||
connect(m_ui->optionButtons, SIGNAL(buttonClicked(int)), SLOT(updateGenerator()));
|
||||
connect(m_ui->tabWidget, SIGNAL(currentChanged(int)), SLOT(updateGenerator()));
|
||||
@ -63,7 +63,8 @@ PasswordGeneratorWidget::PasswordGeneratorWidget(QWidget* parent)
|
||||
m_ui->strengthLabel->setFont(defaultFont);
|
||||
}
|
||||
|
||||
m_ui->comboBoxWordSeparator->addItems(QStringList() << " " << "#" << "_" << ";" << "-" << ":" << "." << "@");
|
||||
// set default separator to Space
|
||||
m_ui->editWordSeparator->setText(" ");
|
||||
|
||||
QDir path(filePath()->dataPath("wordlists/"));
|
||||
QStringList files = path.entryList(QDir::Files);
|
||||
@ -97,7 +98,7 @@ void PasswordGeneratorWidget::loadSettings()
|
||||
|
||||
// Diceware config
|
||||
m_ui->spinBoxWordCount->setValue(config()->get("generator/WordCount", 6).toInt());
|
||||
m_ui->comboBoxWordSeparator->setCurrentIndex(config()->get("generator/WordSeparator", 0).toInt());
|
||||
m_ui->editWordSeparator->setText(config()->get("generator/WordSeparator", " ").toString());
|
||||
m_ui->comboBoxWordList->setCurrentText(config()->get("generator/WordList", "eff_large.wordlist").toString());
|
||||
|
||||
// Password or diceware?
|
||||
@ -117,7 +118,7 @@ void PasswordGeneratorWidget::saveSettings()
|
||||
|
||||
// Diceware config
|
||||
config()->set("generator/WordCount", m_ui->spinBoxWordCount->value());
|
||||
config()->set("generator/WordSeparator", m_ui->comboBoxWordSeparator->currentIndex());
|
||||
config()->set("generator/WordSeparator", m_ui->editWordSeparator->text());
|
||||
config()->set("generator/WordList", m_ui->comboBoxWordList->currentText());
|
||||
|
||||
// Password or diceware?
|
||||
@ -364,7 +365,7 @@ void PasswordGeneratorWidget::updateGenerator()
|
||||
QString path = filePath()->dataPath("wordlists/" + m_ui->comboBoxWordList->currentText());
|
||||
m_dicewareGenerator->setWordlist(path);
|
||||
}
|
||||
m_dicewareGenerator->setWordseparator(m_ui->comboBoxWordSeparator->currentText().at(0));
|
||||
m_dicewareGenerator->setWordseparator(m_ui->editWordSeparator->text());
|
||||
|
||||
if (m_dicewareGenerator->isValid()) {
|
||||
m_ui->buttonGenerate->setEnabled(true);
|
||||
|
@ -537,12 +537,9 @@ QProgressBar::chunk {
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="comboBoxWordSeparator">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
<widget class="QLineEdit" name="editWordSeparator">
|
||||
<property name="text">
|
||||
<string> </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
x
Reference in New Issue
Block a user