7#ifndef SRC_USERSDIALOG_H_
8#define SRC_USERSDIALOG_H_
15#include <QRegularExpression>
16#include <QScopedPointer>
53 QWidget *parent =
nullptr);
63 Preselect preselect, QWidget *parent =
nullptr);
204 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.
void showRecipientWarning(const QString &text)
Show text above the key list in bold red, for a recipient list that could not be verified.
auto isUserExpired(const UserInfo &user) const -> bool
Check if GPG key is expired.
void keyPressEvent(QKeyEvent *event) override
Handle key press.
void applyUserStyling(QListWidgetItem *item, const UserInfo &user) const
Apply visual styling to user item.
Preselect
Whether the recipients on disk are ticked when it opens.
@ FromList
The folder's recipient list, as the backend reads it.
QList< UserInfo > m_userList
void connectSignals()
Connect dialog signals.
QDateTime m_cachedCurrentDateTime
void restoreDialogState()
QString buildUserText(const UserInfo &user) const
Build display text for user.
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 selectRecipients(const QStringList &recipients)
Tick the keys the folder is encrypted to, and list recipients no key in the keyring answers to,...
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.
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.