QtPass  1.3.3
Multi-platform GUI for pass, the standard unix password manager.
configdialog.h
Go to the documentation of this file.
1 #ifndef CONFIGDIALOG_H_
2 #define CONFIGDIALOG_H_
3 
4 #include "enums.h"
6 
7 #include <QDialog>
8 
9 namespace Ui {
10 struct UserInfo;
11 
12 class ConfigDialog;
13 } // namespace Ui
14 
21 class MainWindow;
22 class QCloseEvent;
23 class QTableWidgetItem;
24 class ConfigDialog : public QDialog {
25  Q_OBJECT
26 
27 public:
28  explicit ConfigDialog(MainWindow *parent);
29  ~ConfigDialog();
30 
31  void useSelection(bool useSelection);
32  void useAutoclear(bool useAutoclear);
34  QHash<QString, QString> getProfiles();
35  void wizard();
36  void genKey(QString, QDialog *);
37  void useTrayIcon(bool useSystray);
38  void useGit(bool useGit);
39  void useOtp(bool useOtp);
40  void useQrencode(bool useQrencode);
41  void setPwgenPath(QString);
42  void usePwgen(bool usePwgen);
45  void useTemplate(bool useTemplate);
46 
47 protected:
48  void closeEvent(QCloseEvent *event);
49 
50 private slots:
51  void on_accepted();
52  void on_autodetectButton_clicked();
53  void on_radioButtonNative_clicked();
54  void on_radioButtonPass_clicked();
55  void on_toolButtonGit_clicked();
56  void on_toolButtonGpg_clicked();
57  void on_toolButtonPwgen_clicked();
58  void on_toolButtonPass_clicked();
59  void on_toolButtonStore_clicked();
60  void on_comboBoxClipboard_activated(int);
61  void on_passwordCharTemplateSelector_activated(int);
62  void on_checkBoxSelection_clicked();
63  void on_checkBoxAutoclear_clicked();
64  void on_checkBoxAutoclearPanel_clicked();
65  void on_addButton_clicked();
66  void on_deleteButton_clicked();
67  void on_checkBoxUseTrayIcon_clicked();
68  void on_checkBoxUseGit_clicked();
69  void on_checkBoxUsePwgen_clicked();
70  void on_checkBoxUseTemplate_clicked();
71  void onProfileTableItemChanged(QTableWidgetItem *item);
72 
73 private:
74  QScopedPointer<Ui::ConfigDialog> ui;
75 
76  QStringList getSecretKeys();
77 
78  void setGitPath(QString);
79  void setProfiles(QHash<QString, QString>, QString);
80  void usePass(bool usePass);
81 
82  void setGroupBoxState();
83  QString selectExecutable();
84  QString selectFolder();
85  // QMessageBox::critical with hack to avoid crashes with
86  // Qt 5.4.1 when QApplication::exec was not yet called
87  void criticalMessage(const QString &title, const QString &text);
88 
89  bool isPassOtpAvailable();
90  bool isQrencodeAvailable();
91  void validate(QTableWidgetItem *item = nullptr);
92 
93  MainWindow *mainWindow;
94 };
95 
96 #endif // CONFIGDIALOG_H_
ConfigDialog::setPasswordConfiguration
void setPasswordConfiguration(const PasswordConfiguration &config)
Definition: configdialog.cpp:800
ConfigDialog::useTemplate
void useTemplate(bool useTemplate)
ConfigDialog::useTemplate set preference for using templates.
Definition: configdialog.cpp:853
ConfigDialog::useQrencode
void useQrencode(bool useQrencode)
ConfigDialog::useOtp set preference for using otp plugin.
Definition: configdialog.cpp:728
ConfigDialog::useOtp
void useOtp(bool useOtp)
ConfigDialog::useOtp set preference for using otp plugin.
Definition: configdialog.cpp:720
ConfigDialog::useGit
void useGit(bool useGit)
ConfigDialog::useGit set preference for using git.
Definition: configdialog.cpp:711
ConfigDialog::getProfiles
QHash< QString, QString > getProfiles()
ConfigDialog::getProfiles return profile list.
Definition: configdialog.cpp:485
ConfigDialog::useTrayIcon
void useTrayIcon(bool useSystray)
ConfigDialog::useTrayIcon set preference for using trayicon. Enable or disable related checkboxes acc...
Definition: configdialog.cpp:675
ConfigDialog::genKey
void genKey(QString, QDialog *)
ConfigDialog::genKey tunnel function to make MainWindow generate a gpg key pair.
Definition: configdialog.cpp:447
ConfigDialog::wizard
void wizard()
ConfigDialog::wizard first-time use wizard.
Definition: configdialog.cpp:576
ConfigDialog::setPwgenPath
void setPwgenPath(QString)
ConfigDialog::setPwgenPath set pwgen executable path. Enable or disable related options in the interf...
Definition: configdialog.cpp:762
ConfigDialog
The ConfigDialog handles the configuration interface.
Definition: configdialog.h:24
ConfigDialog::closeEvent
void closeEvent(QCloseEvent *event)
ConfigDialog::closeEvent close this window.
Definition: configdialog.cpp:702
ConfigDialog::ConfigDialog
ConfigDialog(MainWindow *parent)
ConfigDialog::ConfigDialog this sets up the configuration screen.
Definition: configdialog.cpp:25
ConfigDialog::~ConfigDialog
~ConfigDialog()
ConfigDialog::~ConfigDialog config destructor, makes sure the mainWindow knows about git,...
Definition: configdialog.cpp:132
Ui
Definition: configdialog.h:9
ConfigDialog::useSelection
void useSelection(bool useSelection)
ConfigDialog::useSelection set the clipboard type use from MainWindow.
Definition: configdialog.cpp:399
enums.h
PasswordConfiguration
Holds the Password configuration settings.
Definition: passwordconfiguration.h:10
ConfigDialog::useAutoclearPanel
void useAutoclearPanel(bool useAutoclearPanel)
ConfigDialog::useAutoclearPanel set the panel autoclear use from MainWindow.
Definition: configdialog.cpp:419
ConfigDialog::usePwgen
void usePwgen(bool usePwgen)
ConfigDialog::usePwgen set preference for using pwgen (can be overruled buy empty pwgenPath)....
Definition: configdialog.cpp:793
UserInfo
Stores key info lines including validity, creation date and more.
Definition: userinfo.h:11
MainWindow
The MainWindow class does way too much, not only is it a switchboard, configuration handler and more,...
Definition: mainwindow.h:39
ConfigDialog::getPasswordConfiguration
PasswordConfiguration getPasswordConfiguration()
Definition: configdialog.cpp:809
ConfigDialog::useAutoclear
void useAutoclear(bool useAutoclear)
ConfigDialog::useAutoclear set the clipboard autoclear use from MainWindow.
Definition: configdialog.cpp:409
passwordconfiguration.h