7#ifndef SRC_USERSDIALOG_H_
8#define SRC_USERSDIALOG_H_
15#include <QRegularExpression>
16#include <QScopedPointer>
54 QWidget *parent =
nullptr);
64 Preselect preselect, QWidget *parent =
nullptr);
210 const QString &name = QStringLiteral(
"recipientWarning"));
241 auto
tickReached(const QStringList &ids, const QStringList &lines) ->
bool;
280 const QRegularExpression &nameFilter) const;
AppSettings, the value object holding every flat QtPass setting.
Abstract base class for password store operations.
QString m_cachedPatternString
~UsersDialog() override
Destroys the dialog and its generated form.
void updateOkButton()
Enable OK only while at least one key is ticked (hasSelection()).
void itemChange(QListWidgetItem *item)
Handle user selection change.
QRegularExpression m_cachedNameFilter
void on_importKeyButton_clicked()
Import a GPG key and refresh the list.
auto selectedUsers() const -> QList< UserInfo >
The key list with the user's choice in each entry's enabled flag.
void on_lineEdit_textChanged(const QString &filter)
Filter user list.
auto isUserExpired(const UserInfo &user) const -> bool
Check if GPG key is expired.
void keyPressEvent(QKeyEvent *event) override
Handle key press.
void showRecipientWarning(const QString &text, const QString &name=QStringLiteral("recipientWarning"))
Show text above the key list in bold red, for a recipient list that could not be verified.
void selectRecipients(const QStringList &listed)
Tick the keys the folder is encrypted to, and list recipients no key in the keyring answers to,...
void applyUserStyling(QListWidgetItem *item, const UserInfo &user) const
Apply visual styling to user item.
void searchKeyring(const QStringList &recipients)
Tick the keys a keyring search resolves recipients to, and list the lines no key answers to,...
Preselect
Whether the recipients on disk are ticked when it opens.
@ FromList
The folder's recipient list, as the backend reads it.
auto tickReached(const QStringList &ids, const QStringList &lines) -> bool
Tick the rows of the keys ids, which a probe of lines reached. A key on more than one row (a shared s...
void keepAsWritten(const QString &line, const QString &why)
List line as a ticked row of its own, named by why, so OK writes it back as it was.
QList< UserInfo > m_userList
void connectSignals()
Connect dialog signals.
auto setAsideHeldTwice(QStringList *recipients) -> bool
Keep as written, and warn about, the lines a key ID or fingerprint names that two key blocks hold,...
QDateTime m_cachedCurrentDateTime
void restoreDialogState()
auto listChangedSinceRead() const -> bool
Whether the folder's recipient list reads differently now from when loadRecipients() read it: a pull,...
QString buildUserText(const UserInfo &user) const
Build display text for user: the user ID and key ID on a line each, each cut to 256 characters (the r...
QStringList m_readRecipients
The recipients the list named when the dialog read it.
void populateList(const QString &filter=QString())
Populate user list.
void selectImportedKey(const QString &importedKey)
Make the key gpg just imported the current row. gpg reports a 16-character long ID (IMPORTED) or a 40...
void showNestedLists()
Name the folders below this one that have a recipient list of their own: saving here does not change ...
void loadRecipients()
Load recipients and handle missing keys.
void accept() override
Handle dialog acceptance.
bool m_cachedDateTimeValid
UsersDialog(Pass *pass, const AppSettings &s, QString dir, QWidget *parent=nullptr)
Construct users dialog.
void markSecretKeys(QList< UserInfo > &users)
Mark which keys have secret counterparts.
void setInitOnAccept(bool initOnAccept)
Choose whether OK runs Pass::Init on the folder.
auto probeEachLine(QStringList *recipients) -> bool
After gpg refused the list as a whole, probe each line on its own (address and name lines first,...
QSet< QString > m_notLookedUp
.gpg-id lines selectRecipients() listed unticked without asking gpg. They are shown without "Show unu...
bool passesFilter(const UserInfo &user, const QString &filter, const QRegularExpression &nameFilter) const
Check if user passes filter.
auto hasSelection() const -> bool
Whether at least one key is ticked.
void on_checkBox_clicked()
Handle select all checkbox.
QScopedPointer< Ui::UsersDialog > ui
The widgets from usersdialog.ui.
auto loadGpgKeys() -> bool
Load GPG keys and determine secret key status.
Plain value-object holding all flat QtPass configuration.
Stores GPG key info including validity, creation date, and more.
UserInfo, one GPG key as listed by gpg, with the selection flag the recipient dialogs use.