QtPass 2.0.0
Developer documentation
Loading...
Searching...
No Matches
PasswordDialog Class Reference

Dialog for creating a password entry or editing an existing one. More...

#include <passworddialog.h>

Inheritance diagram for PasswordDialog:
Collaboration diagram for PasswordDialog:

Public Slots

void cycleTemplate ()
 Cycle to next template (Ctrl+T).
void setPass (const QString &output, const QString &file=QString())
 Populate the dialog from a decrypted entry (Pass::finishedShow).

Signals

void copied (const QString &text)
 Text was copied out of the password, a field or the body, marked as a secret: for ClipboardManager::trackCopied(), so autoclear clears it.

Public Member Functions

 PasswordDialog (PasswordConfiguration passConfig, QWidget *parent=nullptr)
 Construct a PasswordDialog for entering a new password.
 PasswordDialog (Pass *pass, const AppSettings &s, QString file, const bool &isNew, QWidget *parent=nullptr)
 Construct a PasswordDialog for editing an existing password file.
 ~PasswordDialog () override
 Hides the window before QDialog tears it down, so the focus-out emitted on hiding cannot reach slots of a half-destroyed dialog.
void accept () override
 OK: for a new entry, resolve and check the name first and stay open when it is not usable; then insert the entry and close as accepted only once the insert has succeeded.
void reject () override
 Cancel, Esc and the window's close button. While an insert is in flight they ask first: closing then means a failure can no longer hand back what was typed, but a save that never reports must not leave quitting as the only way out.
void setNewEntryLocation (const QString &storeRoot, const QStringList &folders, const QString &currentFolder)
 Let a new entry be named inside the dialog: a folder picker over the store's folders and a name field, instead of a separate prompt.
auto entryPath () const -> QString
 The entry the dialog writes to, relative to the store and without the .gpg suffix (for example work/vpn).
void setPassword (const QString &password)
 Populate the dialog's password field with the given text.
auto getPassword () -> QString
 Retrieve the current text from the dialog's password field.
void setTemplate (const QString &rawFields, bool useTemplate)
 Set the template fields and whether templating is enabled.
void templateAll (bool templateAll)
 Whether every key: value line becomes a field of its own.
void setLength (int length)
 Set the desired password length shown in the dialog.
void setPasswordCharTemplate (int templateIndex)
 Set the password character template index.
void usePwgen (bool usePwgen)
 Enable or disable pwgen-style password generation mode.
void setAvailableTemplates (const QHash< QString, QStringList > &templates, const QString &defaultTemplate)
 Set available templates from file and select default.

Private Slots

void setPasswordVisible (bool show)
 Show or mask the password field.
void on_createPasswordButton_clicked ()
 "Generate" button: asks the backend for a password of the chosen length from the selected character set (Pass::generatePassword, which runs pwgen when that mode is on) and puts it in the password field. An empty result leaves the field alone.
void on_rejected ()
 Connected to QDialog::rejected: blanks the password and field widgets so the decrypted secret does not linger in a dialog that is being discarded.
void onInsertFinished ()
 The insert started by accept() succeeded: close as accepted.
void onInsertFailed (const QString &err, bool written)
 The insert started by accept() failed: unlock the fields, which still hold what was typed, and show why.
void onShowError (int exitCode, const QString &err)
 Handle a process error while waiting for an entry's decrypt.

Private Member Functions

void reportCopies (SecretLineEdit *line)
 Forwards the line edit's SecretLineEdit::copied to this dialog's copied(), so every copy out of any field reaches ClipboardManager.
auto otpLineEdit () const -> QLineEdit *
 Locate the field that holds the one-time password configuration.
void setEditorEnabled (bool enabled)
 Enabled or grey out every editable field of the dialog.
void save ()
 Start inserting what the dialog holds and wait for the result.
void setSaving (bool saving)
 Lock or unlock the dialog while an insert is in flight.
auto isOwnInsertReport () -> bool
 Whether the insert report now arriving is this dialog's own.
void showNotSaved (const QString &err)
 Say why the entry was not saved and let the user try again; the fields keep what was typed.
void hookOtpField ()
 Connect validation and normalisation to the OTP field, if present.
void validateOtpField ()
 Flag an OTP value that is neither a URI nor valid base32.
void markOtpFieldEdited ()
 Remember, on the line edit that sent textEdited(), that the user typed in it: only such a field has a bare secret canonicalised, a loaded value is kept as it was. The mark lives on the widget, not on the dialog, so typing into a field that used to be the OTP one (renamed away) says nothing about the field that is the OTP one now. A member function: Qt::UniqueConnection, which hookOtpField() needs because it runs more than once for the same field, is refused for a lambda (a debug build asserts, a release build makes no connection).
void normalizeOtpField ()
 Rewrite the OTP field as a canonical otpauth URI.
auto resolveNewEntry (QString *problem) const -> QString
 The name the user typed, resolved against the picked folder.
void validateNewEntry ()
 Re-runs resolveNewEntry() as the user types or picks a folder: shows the problem (if any) in the status label and enables OK only for a usable name.
void renameField (QLineEdit *line, FieldLabel *label, const QString &to)
 Give a key: value field a new key (#132). Refused, with the reason in the status label, when another field has that name. Re-runs hookOtpField(), as the field may have become or stopped being the OTP one.
void removeField (QLineEdit *line)
 Drop a key: value field and its row from the form. The widgets are deleted once control is back in the event loop: the request comes from the line's own trailing action or its label's context menu, both still on the stack.
void applyTemplate (const QString &templateName)
 Switch to a named template: records it, selects it in the combo box and rebuilds the field rows through setTemplate(). Unknown names are ignored, and nothing changes while a save is in flight.
void setupTemplateBox ()
 Hides the template row until setAvailableTemplates() fills it and wires the combo box so that a user selection calls applyTemplate().

Private Attributes

QScopedPointer< Ui::PasswordDialog > ui
 Generated form (passworddialog.ui); owned.
PasswordConfiguration m_passConfig
 Generator settings: character sets and default length.
Pass * m_pass {nullptr}
 Backend for Show, Insert and generatePassword; not owned.
QStringList m_fields
 Field names of the current template, in template order.
QString m_file
 Entry path relative to the store, without .gpg; empty for a new entry until accept() resolves the typed name.
QString m_storeRoot
 Absolute store root while a new entry is being named; empty otherwise.
QString m_newEntryFolder
bool m_templating {}
 Whether template fields get widgets of their own (the "Use template" setting).
bool m_allFields {}
 Whether every key: value line becomes a field (the "Template all fields" setting), as given to FileContent::parse().
bool m_isNew {}
 True when creating an entry, false when editing one; decides whether the name row and the decrypt-before-edit lock apply.
bool m_contentLoaded {}
bool m_saving {}
 True from accept() starting an insert until the backend reports back.
int m_insertsAhead {}
bool m_usePwgen {}
QList< QLineEdit * > m_templateLines
QList< QLineEdit * > m_otherLines
QHash< QString, QStringList > m_availableTemplates
QString m_currentTemplateName
 Name of the template currently applied; cycleTemplate() steps from it.
QShortcut * m_templateShortcut {nullptr}
 Ctrl+T, created once templates are available; owned by the dialog.
QPointer< QAction > m_otpWarning
QPointer< QLineEdit > m_otpLine

Detailed Description

Dialog for creating a password entry or editing an existing one.

The first line is the password, with a generator beside it; below it are one field per template line when templates are in use, and a free text box for everything else. For an existing entry the dialog asks the backend to Show() it and fills the fields when the content arrives. On OK it puts the entry together again and calls Pass::Insert(), then stays open with its fields locked until the backend reports: it closes on Pass::finishedInsert() and gives the fields back with the reason on Pass::insertFailed(), so a failed save never loses what was typed.

Definition at line 43 of file passworddialog.h.

Constructor & Destructor Documentation

◆ PasswordDialog() [1/2]

PasswordDialog::PasswordDialog ( PasswordConfiguration passConfig,
QWidget * parent = nullptr )
explicit

Construct a PasswordDialog for entering a new password.

Parameters
passConfigPassword generation configuration.
parentOptional parent widget.

Definition at line 54 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PasswordDialog() [2/2]

PasswordDialog::PasswordDialog ( Pass * pass,
const AppSettings & s,
QString file,
const bool & isNew,
QWidget * parent = nullptr )

Construct a PasswordDialog for editing an existing password file.

Parameters
passBackend used to show, insert, and generate passwords.
sApplication settings snapshot (password config, template, pwgen).
filePath to the password file being edited.
isNewtrue if creating a new entry, false if editing existing.
parentOptional parent widget.

Definition at line 79 of file passworddialog.cpp.

Here is the call graph for this function:

◆ ~PasswordDialog()

PasswordDialog::~PasswordDialog ( )
override

Hides the window before QDialog tears it down, so the focus-out emitted on hiding cannot reach slots of a half-destroyed dialog.

Definition at line 124 of file passworddialog.cpp.

Member Function Documentation

◆ accept()

void PasswordDialog::accept ( )
override

OK: for a new entry, resolve and check the name first and stay open when it is not usable; then insert the entry and close as accepted only once the insert has succeeded.

The insert is asynchronous. Until it reports back the dialog stays open with its fields locked; when it fails (a missing recipient key, an unusable .gpg-id, a refused path) the fields come back with what was typed and the reason is shown, instead of the entry being lost with the closed dialog.

Definition at line 350 of file passworddialog.cpp.

Here is the call graph for this function:

◆ applyTemplate()

void PasswordDialog::applyTemplate ( const QString & templateName)
private

Switch to a named template: records it, selects it in the combo box and rebuilds the field rows through setTemplate(). Unknown names are ignored, and nothing changes while a save is in flight.

Parameters
templateNameA key of m_availableTemplates.

Definition at line 746 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copied

void PasswordDialog::copied ( const QString & text)
signal

Text was copied out of the password, a field or the body, marked as a secret: for ClipboardManager::trackCopied(), so autoclear clears it.

Parameters
textThe text copied.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cycleTemplate

void PasswordDialog::cycleTemplate ( )
slot

Cycle to next template (Ctrl+T).

Definition at line 760 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ entryPath()

auto PasswordDialog::entryPath ( ) const -> QString
inline

The entry the dialog writes to, relative to the store and without the .gpg suffix (for example work/vpn).

Returns
The path; for an existing entry the one given at construction.

Definition at line 112 of file passworddialog.h.

◆ getPassword()

auto PasswordDialog::getPassword ( ) -> QString

Retrieve the current text from the dialog's password field.

Returns
Current password as a QString.
See also
setPassword

Definition at line 604 of file passworddialog.cpp.

Here is the caller graph for this function:

◆ hookOtpField()

void PasswordDialog::hookOtpField ( )
private

Connect validation and normalisation to the OTP field, if present.

Called whenever the field widgets are rebuilt, since both setTemplate() and setPassword() recreate them.

Definition at line 502 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isOwnInsertReport()

auto PasswordDialog::isOwnInsertReport ( ) -> bool
private

Whether the insert report now arriving is this dialog's own.

False when the dialog is not saving. Otherwise it lets the reports of the inserts that were already pending when save() ran pass first (one per call), so an earlier dialog's result does not close or fail this one.

Returns
true when the arriving report belongs to this dialog's insert.

Definition at line 210 of file passworddialog.cpp.

Here is the caller graph for this function:

◆ markOtpFieldEdited()

void PasswordDialog::markOtpFieldEdited ( )
private

Remember, on the line edit that sent textEdited(), that the user typed in it: only such a field has a bare secret canonicalised, a loaded value is kept as it was. The mark lives on the widget, not on the dialog, so typing into a field that used to be the OTP one (renamed away) says nothing about the field that is the OTP one now. A member function: Qt::UniqueConnection, which hookOtpField() needs because it runs more than once for the same field, is refused for a lambda (a debug build asserts, a release build makes no connection).

Definition at line 544 of file passworddialog.cpp.

Here is the caller graph for this function:

◆ normalizeOtpField()

void PasswordDialog::normalizeOtpField ( )
private

Rewrite the OTP field as a canonical otpauth URI.

A value that cannot be parsed is left exactly as the user typed it, so nothing is silently destroyed.

Definition at line 582 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_createPasswordButton_clicked

void PasswordDialog::on_createPasswordButton_clicked ( )
privateslot

"Generate" button: asks the backend for a password of the chosen length from the selected character set (Pass::generatePassword, which runs pwgen when that mode is on) and puts it in the password field. An empty result leaves the field alone.

Definition at line 139 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_rejected

void PasswordDialog::on_rejected ( )
privateslot

Connected to QDialog::rejected: blanks the password and field widgets so the decrypted secret does not linger in a dialog that is being discarded.

Definition at line 275 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onInsertFailed

void PasswordDialog::onInsertFailed ( const QString & err,
bool written )
privateslot

The insert started by accept() failed: unlock the fields, which still hold what was typed, and show why.

Parameters
errThe reason reported by the backend.
writtentrue when the entry was written and only a later step (git) failed; a new entry then closes the dialog.

Definition at line 234 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onInsertFinished

void PasswordDialog::onInsertFinished ( )
privateslot

The insert started by accept() succeeded: close as accepted.

Definition at line 226 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onShowError

void PasswordDialog::onShowError ( int exitCode,
const QString & err )
privateslot

Handle a process error while waiting for an entry's decrypt.

When the asynchronous Show() fails, keep the dialog open and surface the reason in statusLabel instead of closing silently: Ok stays disabled and the editor keeps its lock so the user can only Cancel/withdraw.

Parameters
exitCodeExit code of the failed process (unused).
errError output to present to the user.

Definition at line 810 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ otpLineEdit()

auto PasswordDialog::otpLineEdit ( ) const -> QLineEdit *
nodiscardprivate

Locate the field that holds the one-time password configuration.

Returns
The matching QLineEdit, or nullptr when the entry has no OTP field.

Definition at line 481 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reject()

void PasswordDialog::reject ( )
override

Cancel, Esc and the window's close button. While an insert is in flight they ask first: closing then means a failure can no longer hand back what was typed, but a save that never reports must not leave quitting as the only way out.

Definition at line 251 of file passworddialog.cpp.

◆ removeField()

void PasswordDialog::removeField ( QLineEdit * line)
private

Drop a key: value field and its row from the form. The widgets are deleted once control is back in the event loop: the request comes from the line's own trailing action or its label's context menu, both still on the stack.

Parameters
lineThe field's editor, one of m_otherLines.

Definition at line 455 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ renameField()

void PasswordDialog::renameField ( QLineEdit * line,
FieldLabel * label,
const QString & to )
private

Give a key: value field a new key (#132). Refused, with the reason in the status label, when another field has that name. Re-runs hookOtpField(), as the field may have become or stopped being the OTP one.

Parameters
lineThe field's editor; its object name is the key.
labelThe field's label, updated to show the new key.
toThe new key.

Definition at line 438 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reportCopies()

void PasswordDialog::reportCopies ( SecretLineEdit * line)
private

Forwards the line edit's SecretLineEdit::copied to this dialog's copied(), so every copy out of any field reaches ClipboardManager.

Parameters
lineA password or field editor just created.

Definition at line 683 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resolveNewEntry()

auto PasswordDialog::resolveNewEntry ( QString * problem) const -> QString
private

The name the user typed, resolved against the picked folder.

Parameters
problemReceives a translated reason when the name is unusable.
Returns
The relative entry path, or an empty string on a problem.

Definition at line 306 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ save()

void PasswordDialog::save ( )
private

Start inserting what the dialog holds and wait for the result.

Definition at line 158 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAvailableTemplates()

void PasswordDialog::setAvailableTemplates ( const QHash< QString, QStringList > & templates,
const QString & defaultTemplate )

Set available templates from file and select default.

Parameters
templatesHash of template name to field list.
defaultTemplateName of default template.

Definition at line 719 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setEditorEnabled()

void PasswordDialog::setEditorEnabled ( bool enabled)
private

Enabled or grey out every editable field of the dialog.

Used while an existing entry's decrypted content is being fetched, so an early Ok cannot report success while writing nothing and a late setPass() cannot clobber edits made on the still-empty fields.

Parameters
enabledtrue to restore the editor, false to lock it.

Definition at line 822 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setLength()

void PasswordDialog::setLength ( int length)

Set the desired password length shown in the dialog.

Parameters
lengthDesired password length.

Definition at line 691 of file passworddialog.cpp.

Here is the caller graph for this function:

◆ setNewEntryLocation()

void PasswordDialog::setNewEntryLocation ( const QString & storeRoot,
const QStringList & folders,
const QString & currentFolder )

Let a new entry be named inside the dialog: a folder picker over the store's folders and a name field, instead of a separate prompt.

The dialog validates as the user types (empty, escaping the store, already taken) and keeps OK off until the name is good; accept() then creates any subfolder the name needs and inserts the entry at entryPath(). Only meaningful for a dialog constructed with isNew.

Parameters
storeRootAbsolute path of the password store.
foldersFolders relative to the store, "" for the root; shown in the picker in this order.
currentFolderThe folder to preselect (relative, may be "").

Definition at line 277 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPass

void PasswordDialog::setPass ( const QString & output,
const QString & file = QString() )
slot

Populate the dialog from a decrypted entry (Pass::finishedShow).

Entries with more than FileContent::kMaxDisplayLines lines are not loaded at all; the status label says so and the editor stays locked.

Parameters
outputDecrypted content of the entry.
fileThe entry the output belongs to; output for any other entry than the one being edited is ignored. Empty means unspecified.

Definition at line 777 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPassword()

void PasswordDialog::setPassword ( const QString & password)

Populate the dialog's password field with the given text.

Parameters
passwordPassword text to display.
See also
getPassword

Definition at line 374 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPasswordCharTemplate()

void PasswordDialog::setPasswordCharTemplate ( int templateIndex)

Set the password character template index.

Parameters
templateIndexIndex identifying the character template to use.

Definition at line 695 of file passworddialog.cpp.

Here is the caller graph for this function:

◆ setPasswordVisible

void PasswordDialog::setPasswordVisible ( bool show)
privateslot

Show or mask the password field.

Connected explicitly to QCheckBox::toggled in both constructors; the box is two-state, so the deprecated stateChanged(int) is not needed.

Parameters
showtrue to display the password in clear text.

Definition at line 131 of file passworddialog.cpp.

Here is the caller graph for this function:

◆ setSaving()

void PasswordDialog::setSaving ( bool saving)
private

Lock or unlock the dialog while an insert is in flight.

Parameters
savingtrue while waiting for the backend.

Definition at line 197 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTemplate()

void PasswordDialog::setTemplate ( const QString & rawFields,
bool useTemplate )

Set the template fields and whether templating is enabled.

Parameters
rawFieldsTemplate text containing field definitions.
useTemplatetrue to enable the template, false to disable.

Definition at line 642 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setupTemplateBox()

void PasswordDialog::setupTemplateBox ( )
private

Hides the template row until setAvailableTemplates() fills it and wires the combo box so that a user selection calls applyTemplate().

Definition at line 706 of file passworddialog.cpp.

Here is the caller graph for this function:

◆ showNotSaved()

void PasswordDialog::showNotSaved ( const QString & err)
private

Say why the entry was not saved and let the user try again; the fields keep what was typed.

Parameters
errThe reason reported by the backend.

Definition at line 268 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ templateAll()

void PasswordDialog::templateAll ( bool templateAll)

Whether every key: value line becomes a field of its own.

Mirrors the "Template all fields" setting. Off, only the template's fields get widgets and every other line stays in the free-text body, where the user can edit key and value alike.

Parameters
templateAlltrue to split every tokenisable line into a field.

Definition at line 687 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ usePwgen()

void PasswordDialog::usePwgen ( bool usePwgen)

Enable or disable pwgen-style password generation mode.

Parameters
usePwgentrue to enable pwgen mode, false to disable.

Definition at line 699 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ validateNewEntry()

void PasswordDialog::validateNewEntry ( )
private

Re-runs resolveNewEntry() as the user types or picks a folder: shows the problem (if any) in the status label and enables OK only for a usable name.

Definition at line 343 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ validateOtpField()

void PasswordDialog::validateOtpField ( )
private

Flag an OTP value that is neither a URI nor valid base32.

Definition at line 550 of file passworddialog.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_allFields

bool PasswordDialog::m_allFields {}
private

Whether every key: value line becomes a field (the "Template all fields" setting), as given to FileContent::parse().

Definition at line 370 of file passworddialog.h.

◆ m_availableTemplates

QHash<QString, QStringList> PasswordDialog::m_availableTemplates
private

Named templates from .templates, name to field list, as given to setAvailableTemplates(); empty when the store has none.

Definition at line 394 of file passworddialog.h.

◆ m_contentLoaded

bool PasswordDialog::m_contentLoaded {}
private

True once the existing entry's decrypted content has been loaded, so save() can refuse to overwrite it with empty fields before the asynchronous Show completes.

Definition at line 377 of file passworddialog.h.

◆ m_currentTemplateName

QString PasswordDialog::m_currentTemplateName
private

Name of the template currently applied; cycleTemplate() steps from it.

Definition at line 396 of file passworddialog.h.

◆ m_fields

QStringList PasswordDialog::m_fields
private

Field names of the current template, in template order.

Definition at line 325 of file passworddialog.h.

◆ m_file

QString PasswordDialog::m_file
private

Entry path relative to the store, without .gpg; empty for a new entry until accept() resolves the typed name.

Definition at line 328 of file passworddialog.h.

◆ m_insertsAhead

int PasswordDialog::m_insertsAhead {}
private

Inserts already pending when save() ran, whose reports must pass before one is taken as this dialog's own (counted down in isOwnInsertReport()).

Definition at line 382 of file passworddialog.h.

◆ m_isNew

bool PasswordDialog::m_isNew {}
private

True when creating an entry, false when editing one; decides whether the name row and the decrypt-before-edit lock apply.

Definition at line 373 of file passworddialog.h.

◆ m_newEntryFolder

QString PasswordDialog::m_newEntryFolder
private

Folder chosen when the dialog opened; the template default follows the picker, so this is what setAvailableTemplates() was computed for.

Definition at line 333 of file passworddialog.h.

◆ m_otherLines

QList<QLineEdit *> PasswordDialog::m_otherLines
private

Fields that came from the entry rather than the template; their names are the user's, so their labels are FieldLabels that can be renamed.

Definition at line 391 of file passworddialog.h.

◆ m_otpLine

QPointer<QLineEdit> PasswordDialog::m_otpLine
private

The line edit hookOtpField() last wired up, so its signals can be disconnected when another field becomes the OTP one (a rename, a removal): a stale editingFinished from the old field must not rewrite the new one.

Definition at line 409 of file passworddialog.h.

◆ m_otpWarning

QPointer<QAction> PasswordDialog::m_otpWarning
private

Warning indicator shown inside the OTP field; owned by that field.

QPointer, not a raw pointer: the QAction is parented to the QLineEdit, and setPassword() deletes the m_otherLines widgets before calling hookOtpField(), so a raw pointer would already dangle there.

Definition at line 404 of file passworddialog.h.

◆ m_pass

Pass* PasswordDialog::m_pass {nullptr}
private

Backend for Show, Insert and generatePassword; not owned.

Definition at line 323 of file passworddialog.h.

◆ m_passConfig

PasswordConfiguration PasswordDialog::m_passConfig
private

Generator settings: character sets and default length.

Definition at line 321 of file passworddialog.h.

◆ m_saving

bool PasswordDialog::m_saving {}
private

True from accept() starting an insert until the backend reports back.

Definition at line 379 of file passworddialog.h.

◆ m_storeRoot

QString PasswordDialog::m_storeRoot
private

Absolute store root while a new entry is being named; empty otherwise.

Definition at line 330 of file passworddialog.h.

◆ m_templateLines

QList<QLineEdit *> PasswordDialog::m_templateLines
private

Editors for the template's fields, in template order; rebuilt by setTemplate(). Their labels are plain QLabels: the names are fixed.

Definition at line 388 of file passworddialog.h.

◆ m_templateShortcut

QShortcut* PasswordDialog::m_templateShortcut {nullptr}
private

Ctrl+T, created once templates are available; owned by the dialog.

Definition at line 398 of file passworddialog.h.

◆ m_templating

bool PasswordDialog::m_templating {}
private

Whether template fields get widgets of their own (the "Use template" setting).

Definition at line 367 of file passworddialog.h.

◆ m_usePwgen

bool PasswordDialog::m_usePwgen {}
private

Last pwgen mode passed to usePwgen(), so the policy can be re-applied after setEditorEnabled() re-enables the character-set widgets.

Definition at line 385 of file passworddialog.h.

◆ ui

QScopedPointer<Ui::PasswordDialog> PasswordDialog::ui
private

Generated form (passworddialog.ui); owned.

Definition at line 319 of file passworddialog.h.


The documentation for this class was generated from the following files: