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 "mainwindow.h"
5 #include <QCloseEvent>
6 #include <QDialog>
7 #include <QFileDialog>
8 #include <QTableWidgetItem>
9 
10 namespace Ui {
11 struct UserInfo;
12 
13 class ConfigDialog;
14 } // namespace Ui
15 
22 class ConfigDialog : public QDialog {
23  Q_OBJECT
24 
25 public:
26  explicit ConfigDialog(MainWindow *parent);
27  ~ConfigDialog();
28  void setPassPath(QString);
29  void setGitPath(QString);
30  void setGpgPath(QString);
31  void setStorePath(QString);
32  void setProfiles(QHash<QString, QString>, QString);
33  void usePass(bool usePass);
35  void useSelection(bool useSelection);
36  void useAutoclear(bool useAutoclear);
37  void setAutoclear(int seconds);
39  void setAutoclearPanel(int seconds);
40  void hidePassword(bool hidePassword);
41  void hideContent(bool hideContent);
42  void addGPGId(bool addGPGId);
43  QString getPassPath();
44  QString getGitPath();
45  QString getGpgPath();
46  QString getStorePath();
47  QHash<QString, QString> getProfiles();
48  bool usePass();
50  bool useSelection();
51  bool useAutoclear();
52  int getAutoclear();
53  bool useAutoclearPanel();
54  int getAutoclearPanel();
55  bool hidePassword();
56  bool hideContent();
57  bool addGPGId();
58  void wizard();
59  void genKey(QString, QDialog *);
60  bool useTrayIcon();
61  bool hideOnClose();
62  bool startMinimized();
63  void useTrayIcon(bool useTrayIdon);
64  void hideOnClose(bool hideOnClose);
65  void startMinimized(bool startMinimized);
66  void useGit(bool useGit);
67  bool useGit();
68  QString getPwgenPath();
69  void setPwgenPath(QString);
70  void usePwgen(bool usePwgen);
71  void avoidCapitals(bool avoidCapitals);
72  void avoidNumbers(bool avoidNumbers);
73  void lessRandom(bool lessRandom);
74  void useSymbols(bool useSymbols);
75  void setPasswordLength(int pwLen);
76  void setPasswordChars(QString);
77  void setPwdTemplateSelector(int selection);
78  void setLineEditEnabled(bool b);
80  bool usePwgen();
81  bool avoidCapitals();
82  bool avoidNumbers();
83  bool lessRandom();
84  bool useSymbols();
85  int getPasswordLength();
86  QString getPasswordChars();
87  bool useTemplate();
88  void useTemplate(bool useTemplate);
89  QString getTemplate();
90  void setTemplate(QString);
92  bool templateAllFields();
93  bool autoPull();
94  void autoPull(bool autoPull);
95  bool autoPush();
96  void autoPush(bool autoPush);
97  bool alwaysOnTop();
98  void alwaysOnTop(bool alwaysOnTop);
99 
100 protected:
101  void closeEvent(QCloseEvent *event);
102 
103 private slots:
104  void on_radioButtonNative_clicked();
105  void on_radioButtonPass_clicked();
106  void on_toolButtonGit_clicked();
107  void on_toolButtonGpg_clicked();
108  void on_toolButtonPwgen_clicked();
109  void on_toolButtonPass_clicked();
110  void on_toolButtonStore_clicked();
111  void on_comboBoxClipboard_activated(int);
112  void on_passwordCharTemplateSelector_activated(int);
113  void on_checkBoxSelection_clicked();
114  void on_checkBoxAutoclear_clicked();
115  void on_checkBoxAutoclearPanel_clicked();
116  void on_addButton_clicked();
117  void on_deleteButton_clicked();
118  void on_checkBoxUseTrayIcon_clicked();
119  void on_checkBoxUseGit_clicked();
120  void on_checkBoxUsePwgen_clicked();
121  void on_checkBoxUseTemplate_clicked();
122 
123 private:
124  QScopedPointer<Ui::ConfigDialog> ui;
125  void setGroupBoxState();
126  QString selectExecutable();
127  QString selectFolder();
128  // QMessageBox::critical with hack to avoid crashes with
129  // Qt 5.4.1 when QApplication::exec was not yet called
130  void criticalMessage(const QString &title, const QString &text);
131  MainWindow *mainWindow;
132 };
133 
134 #endif // CONFIGDIALOG_H_
QHash< QString, QString > getProfiles()
ConfigDialog::getProfiles return profile list.
~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.
void setPassPath(QString)
ConfigDialog::setPassPath set the pass executable path.
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...
int getPwdTemplateSelector()
ConfigDialog::getPwdTemplateSelector returns the selection of the password characters template combob...
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 setLineEditEnabled(bool b)
ConfigDialog::setLineEditEnabled enabling/disabling the textbox with the password characters...
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.
QString getPasswordChars()
ConfigDialog::getPasswordChars return characters to use in password generation (non-pwgen).
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.
void setPasswordChars(QString)
ConfigDialog::setPasswordChars use these charcters to generate password (non-pwgen option)...
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 setPasswordLength(int pwLen)
ConfigDialog::setPasswordLength set the length of desired (generated) passwords.
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:22
void setPwdTemplateSelector(int selection)
ConfigDialog::setPwdTemplateSelector sets the current index of the password characters template combo...
int getAutoclear()
ConfigDialog::getAutoclear return the clipboard autoclear timout.
Stores key info lines including validity, creation date and more.
Definition: datahelpers.h:46
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.
The MainWindow class does way too much, not only is it a switchboard, configuration handler and more...
Definition: mainwindow.h:42
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...
int getPasswordLength()
ConfigDialog::getPasswordLength return desired length for generated passwords.
void setGpgPath(QString)
ConfigDialog::setGpgPath set the gpg executable path.
bool alwaysOnTop()
ConfigDialog::alwaysOnTop return preference for running application on top of others.