Reworked the PasswordGeneratorWidget.

It's loosely based on OS X PasswordAssistant. Generation happens as soon as a
change is made, and on open of the widget. A combobox has been added to allow
one to choose from some randomally-generated alternatives, and the UI is
generally been made a bit more compact.

Written by Michael Curtis <michael@moltenmercury.org> and revised by me.

Closes #119

https://github.com/keepassx/keepassx/pull/38
This commit is contained in:
Felix Geyer 2014-01-12 23:33:36 +01:00
parent 29c997e1bc
commit 3af2307468
8 changed files with 449 additions and 197 deletions

View file

@ -19,6 +19,7 @@
#define KEEPASSX_PASSWORDGENERATORWIDGET_H
#include <QWidget>
#include <QComboBox>
#include "core/Global.h"
#include "core/PasswordGenerator.h"
@ -27,6 +28,8 @@ namespace Ui {
class PasswordGeneratorWidget;
}
class PasswordGenerator;
class PasswordGeneratorWidget : public QWidget
{
Q_OBJECT
@ -43,14 +46,21 @@ Q_SIGNALS:
private Q_SLOTS:
void updateApplyEnabled(const QString& password);
void togglePassword(bool checked);
void generatePassword();
void emitNewPassword();
void saveSettings();
void sliderMoved();
void spinBoxChanged();
void updateGenerator();
private:
bool m_updatingSpinBox;
PasswordGenerator::CharClasses charClasses();
PasswordGenerator::GeneratorFlags generatorFlags();
const QScopedPointer<PasswordGenerator> m_generator;
const QScopedPointer<Ui::PasswordGeneratorWidget> m_ui;
};