QtPass 1.7.0
Multi-platform GUI for pass, the standard unix password manager.
Loading...
Searching...
No Matches
passworddialog.h
1// SPDX-FileCopyrightText: 2015 Anne Jan Brouwer
2// SPDX-License-Identifier: GPL-3.0-or-later
3#ifndef SRC_PASSWORDDIALOG_H_
4#define SRC_PASSWORDDIALOG_H_
5
6#include "passwordconfiguration.h"
7#include <QDialog>
8
9namespace Ui {
10class PasswordDialog;
11}
12
13class QLineEdit;
14class QWidget;
15
23class PasswordDialog : public QDialog {
24 Q_OBJECT
25
26public:
33 QWidget *parent = nullptr);
40 PasswordDialog(QString file, const bool &isNew, QWidget *parent = nullptr);
41 ~PasswordDialog() override;
42
48 void setPassword(const QString &password);
49
55 auto getPassword() -> QString;
56
62 void setTemplate(const QString &rawFields, bool useTemplate);
63
69
74 void setLength(int length);
75
80 void setPasswordCharTemplate(int templateIndex);
81
86 void usePwgen(bool usePwgen);
87
88public slots:
93 void setPass(const QString &output);
94
95private slots:
96 void on_checkBoxShow_stateChanged(int arg1);
97 void on_createPasswordButton_clicked();
98 void on_accepted();
99 void on_rejected();
100
101private:
102 Ui::PasswordDialog *ui;
103 PasswordConfiguration m_passConfig;
104 QStringList m_fields;
105 QString m_file;
106 bool m_templating{};
107 bool m_allFields{};
108 bool m_isNew;
109 QList<QLineEdit *> templateLines;
110 QList<QLineEdit *> otherLines;
111};
112
113#endif // SRC_PASSWORDDIALOG_H_
PasswordDialog(QString file, const bool &isNew, QWidget *parent=nullptr)
Construct a PasswordDialog for editing an existing password file.
void setPassword(const QString &password)
Populate the dialog's password field with the given text.
PasswordDialog(PasswordConfiguration passConfig, QWidget *parent=nullptr)
Construct a PasswordDialog for entering a new password.
void setLength(int length)
Set the desired password length shown in the dialog.
void usePwgen(bool usePwgen)
Enable or disable pwgen-style password generation mode.
void setPasswordCharTemplate(int templateIndex)
Set the password character template index.
void setTemplate(const QString &rawFields, bool useTemplate)
Set the template fields and whether templating is enabled.
void templateAll(bool templateAll)
Enable or disable applying the template to all applicable fields.
void setPass(const QString &output)
Populate the dialog's password field from pass show output.
auto getPassword() -> QString
Retrieve the current text from the dialog's password field.
Holds the password configuration settings.