QtPass  1.2.1
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 ConfigDialog : public QDialog {
24  Q_OBJECT
25 
26 public:
27  explicit ConfigDialog(MainWindow *parent);
28  ~ConfigDialog();
29  void setPassPath(QString);
30  void setGitPath(QString);
31  void setGpgPath(QString);
32  void setStorePath(QString);
33  void setProfiles(QHash<QString, QString>, QString);
34  void usePass(bool usePass);
36  void useSelection(bool useSelection);
37  void useAutoclear(bool useAutoclear);
38  void setAutoclear(int seconds);
40  void setAutoclearPanel(int seconds);
41  void hidePassword(bool hidePassword);
42  void hideContent(bool hideContent);
43  void addGPGId(bool addGPGId);
44  QString getPassPath();
45  QString getGitPath();
46  QString getGpgPath();
47  QString getStorePath();
48  QHash<QString, QString> getProfiles();
49  bool usePass();
51  bool useSelection();
52  bool useAutoclear();
53  int getAutoclear();
54  bool useAutoclearPanel();
55  int getAutoclearPanel();
56  bool hidePassword();
57  bool hideContent();
58  bool addGPGId();
59  void wizard();
60  void genKey(QString, QDialog *);
61  bool useTrayIcon();
62  bool hideOnClose();
63  bool startMinimized();
64  void useTrayIcon(bool useTrayIdon);
65  void hideOnClose(bool hideOnClose);
66  void startMinimized(bool startMinimized);
67  void useGit(bool useGit);
68  bool useGit();
69  QString getPwgenPath();
70  void setPwgenPath(QString);
71  void usePwgen(bool usePwgen);
72  void avoidCapitals(bool avoidCapitals);
73  void avoidNumbers(bool avoidNumbers);
74  void lessRandom(bool lessRandom);
75  void useSymbols(bool useSymbols);
78  bool usePwgen();
79  bool avoidCapitals();
80  bool avoidNumbers();
81  bool lessRandom();
82  bool useSymbols();
83  bool useTemplate();
84  void useTemplate(bool useTemplate);
85  QString getTemplate();
86  void setTemplate(QString);
88  bool templateAllFields();
89  bool autoPull();
90  void autoPull(bool autoPull);
91  bool autoPush();
92  void autoPush(bool autoPush);
93  bool alwaysOnTop();
94  void alwaysOnTop(bool alwaysOnTop);
95 
96 protected:
97  void closeEvent(QCloseEvent *event);
98 
99 private slots:
100  void on_radioButtonNative_clicked();
101  void on_radioButtonPass_clicked();
102  void on_toolButtonGit_clicked();
103  void on_toolButtonGpg_clicked();
104  void on_toolButtonPwgen_clicked();
105  void on_toolButtonPass_clicked();
106  void on_toolButtonStore_clicked();
107  void on_comboBoxClipboard_activated(int);
108  void on_passwordCharTemplateSelector_activated(int);
109  void on_checkBoxSelection_clicked();
110  void on_checkBoxAutoclear_clicked();
111  void on_checkBoxAutoclearPanel_clicked();
112  void on_addButton_clicked();
113  void on_deleteButton_clicked();
114  void on_checkBoxUseTrayIcon_clicked();
115  void on_checkBoxUseGit_clicked();
116  void on_checkBoxUsePwgen_clicked();
117  void on_checkBoxUseTemplate_clicked();
118 
119 private:
120  QScopedPointer<Ui::ConfigDialog> ui;
121  void setGroupBoxState();
122  QString selectExecutable();
123  QString selectFolder();
124  // QMessageBox::critical with hack to avoid crashes with
125  // Qt 5.4.1 when QApplication::exec was not yet called
126  void criticalMessage(const QString &title, const QString &text);
127  MainWindow *mainWindow;
128 };
129 
130 #endif // CONFIGDIALOG_H_
QHash< QString, QString > getProfiles()
ConfigDialog::getProfiles return profile list.
void setPasswordConfiguration(const PasswordConfiguration &config)
~ConfigDialog()
ConfigDialog::~ConfigDialog config destructor, makes sure the mainWindow knows about git...
bool hideOnClose()
ConfigDialog::hideOnClose return preference for hiding instead of closing (quitting) application...
bool useTemplate()
ConfigDialog::useTemplate return preference for using templates.
QString getPwgenPath()
ConfigDialog::getPwgenPath return pwgen executable path.
bool autoPush()
ConfigDialog::autoPush return preference for automatically pushing to git.
bool usePwgen()
ConfigDialog::usePwgen return preference for using pwgen.
Holds the Password configuration settings.
void setPassPath(QString)
ConfigDialog::setPassPath set the pass executable path.
Definition: configdialog.h:9
bool useGit()
ConfigDialog::useGit retrun preference for using git.
ConfigDialog(MainWindow *parent)
ConfigDialog::ConfigDialog this sets up the configuration screen.
bool lessRandom()
ConfigDialog::lessRandom return preference for using less random passwords in pwgen.
void setGitPath(QString)
ConfigDialog::setGitPath set the git executable path. Make sure the checkBoxUseGit is updated...
void setAutoclear(int seconds)
ConfigDialog::setAutoclear set the clipboard autoclear timout from MainWindow.
int getAutoclearPanel()
ConfigDialog::getAutoclearPanel return panel autoclear timeout.
bool templateAllFields()
ConfigDialog::templateAllFields return preference for templating all tokenisable fields.
bool autoPull()
ConfigDialog::autoPull return preference for automatically pulling from git.
bool avoidCapitals()
ConfigDialog::avoidCapitals return preference for avoiding uppercase letters using pwgen...
QString getStorePath()
ConfigDialog::getStorePath return path to .password-store.
void setProfiles(QHash< QString, QString >, QString)
ConfigDialog::setProfiles set the profiles and chosen profile from MainWindow.
QString getTemplate()
ConfigDialog::getTemplate return the desired template.
void genKey(QString, QDialog *)
ConfigDialog::genKey tunnel function to make MainWindow generate a gpg key pair.
bool useAutoclear()
ConfigDialog::useAutoclear return the use of clipboard autoclear.
clipBoardType
Definition: enums.h:10
bool useSelection()
ConfigDialog::useSelection return the clipboard type.
Enums::clipBoardType useClipboard()
ConfigDialog::useClipboard set the use of clipboard from MainWindow.
void wizard()
ConfigDialog::wizard first-time use wizard.
QString getPassPath()
ConfigDialog::getPassPath return path to pass.
bool hidePassword()
ConfigDialog::hidePassword return preference for hiding passwords from shoulder-surfers.
bool useTrayIcon()
ConfigDialog::useTrayIcon return preference for using a (system) tray icon.
bool useSymbols()
ConfigDialog::useSymbols return preference for using special characters with pwgen.
bool startMinimized()
ConfigDialog::startMinimized return preference for starting application minimized (tray icon)...
void setStorePath(QString)
ConfigDialog::setStorePath set the .password-store folder path.
void closeEvent(QCloseEvent *event)
ConfigDialog::closeEvent close this window.
bool addGPGId()
ConfigDialog::addGPGId return preference for always adding gpg-id changes to git. ...
QString getGpgPath()
ConfigDialog::getGpgPath return path to gpg.
void setTemplate(QString)
ConfigDialog::setTemplate set the desired template.
bool avoidNumbers()
ConfigDialog::avoidNumbers return preference for using numbers in generated password using pwgen...
bool useAutoclearPanel()
ConfigDialog::useAutoclearPanel return panel autoclear usage.
The ConfigDialog handles the configuration interface.
Definition: configdialog.h:23
int getAutoclear()
ConfigDialog::getAutoclear return the clipboard autoclear timout.
Stores key info lines including validity, creation date and more.
Definition: userinfo.h:11
QString getGitPath()
ConfigDialog::getGitPath return path to git.
bool usePass()
ConfigDialog::usePass return wether or not we want to use pass (or native gpg+git etc)...
void setAutoclearPanel(int seconds)
ConfigDialog::setAutoclearPanel set the panel autoclear timout from MainWindow.
PasswordConfiguration getPasswordConfiguration()
The MainWindow class does way too much, not only is it a switchboard, configuration handler and more...
Definition: mainwindow.h:38
bool hideContent()
ConfigDialog::hideContent return preference for hiding all information from shoulder-surfers.
void setPwgenPath(QString)
ConfigDialog::setPwgenPath set pwgen executable path. Enable or disable related options in the interf...
void setGpgPath(QString)
ConfigDialog::setGpgPath set the gpg executable path.
bool alwaysOnTop()
ConfigDialog::alwaysOnTop return preference for running application on top of others.