QtPass 1.6.0
Multi-platform GUI for pass, the standard unix password manager.
Loading...
Searching...
No Matches
usersdialog.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2015 Anne Jan Brouwer
2// SPDX-License-Identifier: GPL-3.0-or-later
3#ifndef SRC_USERSDIALOG_H_
4#define SRC_USERSDIALOG_H_
5
6#include "userinfo.h"
7
8#include <QDialog>
9#include <QList>
10#include <QRegularExpression>
11
12namespace Ui {
13class UsersDialog;
14}
15
16class QCloseEvent;
17class QKeyEvent;
18class QListWidgetItem;
19
28class UsersDialog : public QDialog {
29 Q_OBJECT
30
31public:
37 explicit UsersDialog(const QString &dir, QWidget *parent = nullptr);
41 ~UsersDialog() override;
42
43public slots:
47 void accept() override;
48
49protected:
54 void closeEvent(QCloseEvent *event) override;
59 void keyPressEvent(QKeyEvent *event) override;
60
61private slots:
66 void itemChange(QListWidgetItem *item);
71 void on_lineEdit_textChanged(const QString &filter);
75 void on_checkBox_clicked();
76
77private:
78 Ui::UsersDialog *ui;
79 QList<UserInfo> m_userList;
80 QString m_dir;
81 QString m_lastFilter;
82 QString m_cachedPatternString;
83 QRegularExpression m_cachedNameFilter;
84 mutable QDateTime m_cachedCurrentDateTime;
86 mutable bool m_cachedDateTimeValid =
87 false;
88
89 void restoreDialogState();
90
94 void connectSignals();
95
100 auto loadGpgKeys() -> bool;
101
106 void markSecretKeys(QList<UserInfo> &users);
107
111 void loadRecipients();
112
117 void populateList(const QString &filter = QString());
125 bool passesFilter(const UserInfo &user, const QString &filter,
126 const QRegularExpression &nameFilter) const;
132 auto isUserExpired(const UserInfo &user) const -> bool;
138 QString buildUserText(const UserInfo &user) const;
144 void applyUserStyling(QListWidgetItem *item, const UserInfo &user) const;
145};
146
147#endif // SRC_USERSDIALOG_H_
~UsersDialog() override
Destructor.
void keyPressEvent(QKeyEvent *event) override
Handle key press.
void accept() override
Handle dialog acceptance.
void closeEvent(QCloseEvent *event) override
Handle close event.
UsersDialog(const QString &dir, QWidget *parent=nullptr)
Construct users dialog.
Stores key info lines including validity, creation date and more.
Definition userinfo.h:13