QtPass 1.7.0
Multi-platform GUI for pass, the standard unix password manager.
Loading...
Searching...
No Matches
configdialog.h
1// SPDX-FileCopyrightText: 2014 Anne Jan Brouwer
2// SPDX-License-Identifier: GPL-3.0-or-later
3#ifndef SRC_CONFIGDIALOG_H_
4#define SRC_CONFIGDIALOG_H_
5
6#include "enums.h"
7#include "passwordconfiguration.h"
8
9#include <QDialog>
10
11namespace Ui {
12struct UserInfo;
13
14class ConfigDialog;
15} // namespace Ui
16
17class MainWindow;
18class QCloseEvent;
19class QTableWidgetItem;
20
29class ConfigDialog : public QDialog {
30 Q_OBJECT
31
32public:
37 explicit ConfigDialog(MainWindow *parent);
38 ~ConfigDialog() override;
39
45
51
57
62 auto getProfiles() -> QHash<QString, QHash<QString, QString>>;
63
67 void wizard();
68
74 void genKey(const QString &batch, QDialog *dialog);
75
80 void useTrayIcon(bool useSystray);
81
86 void useGit(bool useGit);
87
92 void useOtp(bool useOtp);
93
99
105
110 void setPwgenPath(const QString &path);
111
116 void usePwgen(bool usePwgen);
117
123
129
135
136protected:
141 void closeEvent(QCloseEvent *event) override;
142
143private slots:
144 void on_accepted();
145 void on_autodetectButton_clicked();
146 void on_radioButtonNative_clicked();
147 void on_radioButtonPass_clicked();
148 void on_toolButtonGit_clicked();
149 void on_toolButtonGpg_clicked();
150 void on_pushButtonGenerateKey_clicked();
151 void on_toolButtonPwgen_clicked();
152 void on_toolButtonPass_clicked();
153 void on_toolButtonStore_clicked();
154 void on_comboBoxClipboard_activated(int);
155 void on_passwordCharTemplateSelector_activated(int);
156 void on_checkBoxSelection_clicked();
157 void on_checkBoxAutoclear_clicked();
158 void on_checkBoxAutoclearPanel_clicked();
159 void on_addButton_clicked();
160 void on_deleteButton_clicked();
161 void on_profileTable_cellDoubleClicked(int row, int column);
162 void on_checkBoxUseTrayIcon_clicked();
163 void on_checkBoxUseGit_clicked();
164 void on_checkBoxUsePwgen_clicked();
165 void on_checkBoxUseTemplate_clicked();
166 void onProfileTableItemChanged(QTableWidgetItem *item);
167
168private:
169 QScopedPointer<Ui::ConfigDialog> ui;
170
171 auto getSecretKeys() -> QStringList;
172
173 void setGitPath(const QString &);
174 void setProfiles(QHash<QString, QHash<QString, QString>>, const QString &);
175 void usePass(bool usePass);
176
177 void setGroupBoxState();
178 auto selectExecutable() -> QString;
179 auto selectFolder() -> QString;
180 // QMessageBox::critical with hack to avoid crashes with
181 // Qt 5.4.1 when QApplication::exec was not yet called
182 void criticalMessage(const QString &title, const QString &text);
183
184 auto isPassOtpAvailable() -> bool;
185 auto isQrencodeAvailable() -> bool;
186 void validate(QTableWidgetItem *item = nullptr);
187
188 auto checkGpgExistence() -> bool;
189 auto checkSecretKeys() -> bool;
190 auto checkPasswordStore() -> bool;
191 void handleGpgIdFile();
192 void initializeNewProfiles(
193 const QHash<QString, QHash<QString, QString>> &existingProfiles);
194
195 MainWindow *mainWindow;
196};
197
198#endif // SRC_CONFIGDIALOG_H_
void setPasswordConfiguration(const PasswordConfiguration &config)
Apply a password configuration to the dialog controls.
auto getProfiles() -> QHash< QString, QHash< QString, QString > >
Return all configured profiles.
void useOtp(bool useOtp)
Enable or disable OTP support.
void setPwgenPath(const QString &path)
Set the path to the pwgen executable.
void useGit(bool useGit)
Enable or disable git integration.
void useAutoclearPanel(bool useAutoclearPanel)
Enable or disable autoclear of the panel.
void useAutoclear(bool useAutoclear)
Enable or disable autoclear of the clipboard.
void useQrencode(bool useQrencode)
Enable or disable QR code display.
void useTemplate(bool useTemplate)
Enable or disable password file templating.
ConfigDialog(MainWindow *parent)
Construct a ConfigDialog associated with the given main window.
void useGrepSearch(bool useGrepSearch)
Enable or disable grep content search.
auto getPasswordConfiguration() -> PasswordConfiguration
Read the current password configuration from the dialog controls.
void genKey(const QString &batch, QDialog *dialog)
Start GPG key generation.
void useTrayIcon(bool useSystray)
Show or hide the system tray icon.
void usePwgen(bool usePwgen)
Enable or disable pwgen-based password generation.
void wizard()
Run the first-time setup wizard.
void closeEvent(QCloseEvent *event) override
Save settings and clean up on close.
void useSelection(bool useSelection)
Enable or disable clipboard selection mode.
Main application window orchestrating UI, user interactions, and external process handlers.
Definition mainwindow.h:45
Holds the password configuration settings.