|
QtPass 2.0.0
Developer documentation
|
The first start of QtPass: find GnuPG (and pass and Git), make sure there is a secret key, pick or create the password store. Replaces the chain of message boxes ConfigDialog::wizard() used to run before showing the whole configuration dialog. More...
#include <firstrunwizard.h>
Public Types | |
| enum | Page { IntroPage , ProgramsPage , KeyPage , StorePage , DonePage } |
| Page ids, in order. More... | |
Public Member Functions | |
| FirstRunWizard (QWidget *parent=nullptr) | |
| Build the wizard from the current settings. | |
| auto | settings () const -> AppSettings |
| The settings as the pages have edited them so far. | |
| void | accept () override |
| Write the settings and, when the chosen store has no .gpg-id yet, create and initialise it for the chosen keys first. | |
Static Public Member Functions | |
| static auto | secretKeys (const QString &gpgExecutable, QString *problem=nullptr) -> QList< UserInfo > |
The secret keys gpg lists for gpgExecutable. | |
| static auto | isStore (const QString &path) -> bool |
Whether path points at an initialised store. | |
Private Member Functions | |
| auto | initialiseStore (const QString &store) -> bool |
Make store a password store for the ticked keys: create the folder when it is missing, write and sign its .gpg-id, and set up Git when chosen. On failure what was written is taken back, so a second Finish runs the whole initialisation again. | |
| auto | initialiseGit (const QString &store) -> bool |
| Give an existing store the Git repository it was chosen to have. | |
Private Attributes | |
| AppSettings | m_settings |
| bool | m_detectChoices = false |
| QList< UserInfo > | m_keys |
Friends | |
| class | ProgramsWizardPage |
| class | KeyWizardPage |
| class | StoreWizardPage |
| class | DoneWizardPage |
The first start of QtPass: find GnuPG (and pass and Git), make sure there is a secret key, pick or create the password store. Replaces the chain of message boxes ConfigDialog::wizard() used to run before showing the whole configuration dialog.
The wizard works on a copy of the settings and writes it back on Finish, after it has created and initialised the store when that was needed (ProfileInit). Cancel leaves the settings as they were; the caller keeps asking until the configuration is usable or the user gives up.
Definition at line 37 of file firstrunwizard.h.
| enum FirstRunWizard::Page |
Page ids, in order.
| Enumerator | |
|---|---|
| IntroPage | What QtPass is and what the wizard will do. |
| ProgramsPage | ProgramsWizardPage: where gpg, pass and git are. |
| KeyPage | KeyWizardPage: the secret keys, with generation. |
| StorePage | StoreWizardPage: the store folder and the Git choice. |
| DonePage | DoneWizardPage: summary and two preferences. |
Definition at line 77 of file firstrunwizard.h.
|
explicit |
Build the wizard from the current settings.
| parent | The main window. |
Definition at line 72 of file firstrunwizard.cpp.
|
override |
Write the settings and, when the chosen store has no .gpg-id yet, create and initialise it for the chosen keys first.
Definition at line 197 of file firstrunwizard.cpp.
|
private |
Give an existing store the Git repository it was chosen to have.
| store | The folder, cleaned. |
Definition at line 185 of file firstrunwizard.cpp.
|
private |
Make store a password store for the ticked keys: create the folder when it is missing, write and sign its .gpg-id, and set up Git when chosen. On failure what was written is taken back, so a second Finish runs the whole initialisation again.
| store | The folder, cleaned. |
Definition at line 140 of file firstrunwizard.cpp.
|
static |
Whether path points at an initialised store.
| path | A directory. |
Definition at line 135 of file firstrunwizard.cpp.
|
static |
The secret keys gpg lists for gpgExecutable.
gpg exits with 2 after a complete listing when one key holds something it cannot handle (a subkey of an unknown algorithm, say): the keys it listed are taken, and what it reported goes to problem. Any other failure lists no keys.
| gpgExecutable | The gpg binary. |
| problem | Receives gpg's error output when it did not exit cleanly, cut to a few hundred characters and made displayable (Util::displayable()); null to not care. |
Definition at line 105 of file firstrunwizard.cpp.
|
inline |
The settings as the pages have edited them so far.
Definition at line 51 of file firstrunwizard.h.
|
friend |
Definition at line 111 of file firstrunwizard.h.
|
friend |
Definition at line 109 of file firstrunwizard.h.
|
friend |
Definition at line 108 of file firstrunwizard.h.
|
friend |
Definition at line 110 of file firstrunwizard.h.
|
private |
Whether nothing was chosen yet (SettingsConstants::firstRunPending): only then are "Use pass" and "Use Git" turned on from what is detected. The wizard also runs again for a store that lost its recipient list, and then shows the choices saved before.
Definition at line 120 of file firstrunwizard.h.
|
private |
The secret keys as listed on the key page; the enabled ones become the recipients of a new store.
Definition at line 123 of file firstrunwizard.h.
|
private |
The pages' working copy of the settings, loaded in the constructor and saved by accept(); the pages edit it through their friend access.
Definition at line 115 of file firstrunwizard.h.