QtPass  1.2.1
Multi-platform GUI for pass, the standard unix password manager.
configdialog.cpp
Go to the documentation of this file.
1 #include "configdialog.h"
2 #include "debughelper.h"
3 #include "keygendialog.h"
4 #include "mainwindow.h"
5 #include "qtpasssettings.h"
6 #include "ui_configdialog.h"
7 #include <QClipboard>
8 #include <QDir>
9 #include <QFileDialog>
10 #include <QMessageBox>
11 #ifdef Q_OS_WIN
12 #include <windows.h>
13 #endif
14 
20  : QDialog(parent), ui(new Ui::ConfigDialog) {
21  mainWindow = parent;
22  ui->setupUi(this);
23  ui->profileTable->verticalHeader()->hide();
24  ui->profileTable->horizontalHeader()->setStretchLastSection(true);
25  ui->label->setText(ui->label->text() + VERSION);
26  ui->comboBoxClipboard->clear();
27 
28  ui->comboBoxClipboard->addItem(tr("No Clipboard"));
29  ui->comboBoxClipboard->addItem(tr("Always copy to clipboard"));
30  ui->comboBoxClipboard->addItem(tr("On-demand copy to clipboard"));
31  ui->comboBoxClipboard->setCurrentIndex(0);
32 
33  QClipboard *clip = QApplication::clipboard();
34  if (!clip->supportsSelection()) {
35  useSelection(false);
36  ui->checkBoxSelection->setVisible(false);
37  }
38 }
39 
45  QtPassSettings::setGitExecutable(ui->gitPath->text());
46  QtPassSettings::setGpgExecutable(ui->gpgPath->text());
47  QtPassSettings::setPassExecutable(ui->passPath->text());
48 }
49 
54 void ConfigDialog::setPassPath(QString path) { ui->passPath->setText(path); }
55 
61 void ConfigDialog::setGitPath(QString path) {
62  ui->gitPath->setText(path);
63  if (path.isEmpty()) {
64  useGit(false);
65  ui->checkBoxUseGit->setEnabled(false);
66  } else {
67  ui->checkBoxUseGit->setEnabled(true);
68  }
69 }
70 
75 void ConfigDialog::setGpgPath(QString path) { ui->gpgPath->setText(path); }
76 
81 void ConfigDialog::setStorePath(QString path) { ui->storePath->setText(path); }
82 
87 QString ConfigDialog::getPassPath() { return ui->passPath->text(); }
88 
93 QString ConfigDialog::getGitPath() { return ui->gitPath->text(); }
94 
99 QString ConfigDialog::getGpgPath() { return ui->gpgPath->text(); }
100 
105 QString ConfigDialog::getStorePath() { return ui->storePath->text(); }
106 
112 bool ConfigDialog::usePass() { return ui->radioButtonPass->isChecked(); }
113 
119 void ConfigDialog::usePass(bool usePass) {
120  if (usePass) {
121  ui->radioButtonNative->setChecked(false);
122  ui->radioButtonPass->setChecked(true);
123  } else {
124  ui->radioButtonNative->setChecked(true);
125  ui->radioButtonPass->setChecked(false);
126  }
127  setGroupBoxState();
128 }
129 
134 void ConfigDialog::on_radioButtonNative_clicked() { setGroupBoxState(); }
135 
140 void ConfigDialog::on_radioButtonPass_clicked() { setGroupBoxState(); }
141 
145 void ConfigDialog::setGroupBoxState() {
146  if (ui->radioButtonPass->isChecked()) {
147  ui->groupBoxNative->setEnabled(false);
148  ui->groupBoxPass->setEnabled(true);
149  } else {
150  ui->groupBoxNative->setEnabled(true);
151  ui->groupBoxPass->setEnabled(false);
152  }
153 }
154 
159 QString ConfigDialog::selectExecutable() {
160  QFileDialog dialog(this);
161  dialog.setFileMode(QFileDialog::ExistingFile);
162  dialog.setOption(QFileDialog::ReadOnly);
163  if (dialog.exec())
164  return dialog.selectedFiles().first();
165  else
166  return "";
167 }
168 
173 QString ConfigDialog::selectFolder() {
174  QFileDialog dialog(this);
175  dialog.setFileMode(QFileDialog::Directory);
176  dialog.setFilter(QDir::NoFilter);
177  dialog.setOption(QFileDialog::ShowDirsOnly);
178  if (dialog.exec())
179  return dialog.selectedFiles().first();
180  else
181  return "";
182 }
183 
188 void ConfigDialog::on_toolButtonGit_clicked() {
189  QString git = selectExecutable();
190  if (!git.isEmpty()) {
191  ui->gitPath->setText(git);
192  ui->checkBoxUseGit->setEnabled(true);
193  } else {
194  useGit(false);
195  ui->checkBoxUseGit->setEnabled(false);
196  }
197 }
198 
202 void ConfigDialog::on_toolButtonGpg_clicked() {
203  QString gpg = selectExecutable();
204  if (!gpg.isEmpty())
205  ui->gpgPath->setText(gpg);
206 }
207 
211 void ConfigDialog::on_toolButtonPass_clicked() {
212  QString pass = selectExecutable();
213  if (!pass.isEmpty())
214  ui->passPath->setText(pass);
215 }
216 
221 void ConfigDialog::on_toolButtonStore_clicked() {
222  QString store = selectFolder();
223  if (!store.isEmpty()) // TODO(annejan) call check
224  ui->storePath->setText(store);
225 }
226 
231 void ConfigDialog::on_comboBoxClipboard_activated(int index) {
232  if (index > 0) {
233  ui->checkBoxSelection->setEnabled(true);
234  ui->checkBoxAutoclear->setEnabled(true);
235  ui->checkBoxHidePassword->setEnabled(true);
236  ui->checkBoxHideContent->setEnabled(true);
237  if (ui->checkBoxAutoclear->isChecked()) {
238  ui->spinBoxAutoclearSeconds->setEnabled(true);
239  ui->labelSeconds->setEnabled(true);
240  } else {
241  ui->spinBoxAutoclearSeconds->setEnabled(false);
242  ui->labelSeconds->setEnabled(false);
243  }
244  } else {
245  ui->checkBoxSelection->setEnabled(false);
246  ui->checkBoxAutoclear->setEnabled(false);
247  ui->spinBoxAutoclearSeconds->setEnabled(false);
248  ui->labelSeconds->setEnabled(false);
249  ui->checkBoxHidePassword->setEnabled(false);
250  ui->checkBoxHideContent->setEnabled(false);
251  }
252 }
253 
258 void ConfigDialog::on_checkBoxAutoclearPanel_clicked() {
259  if (ui->checkBoxAutoclearPanel->isChecked()) {
260  ui->spinBoxAutoclearPanelSeconds->setEnabled(true);
261  ui->labelPanelSeconds->setEnabled(true);
262  } else {
263  ui->spinBoxAutoclearPanelSeconds->setEnabled(false);
264  ui->labelPanelSeconds->setEnabled(false);
265  }
266 }
267 
272  ui->comboBoxClipboard->setCurrentIndex(static_cast<int>(useClipboard));
273  on_comboBoxClipboard_activated(static_cast<int>(useClipboard));
274 }
275 
281 void ConfigDialog::useSelection(bool useSelection) {
282  ui->checkBoxSelection->setChecked(useSelection);
283  on_checkBoxSelection_clicked();
284 }
285 
291 void ConfigDialog::useAutoclear(bool useAutoclear) {
292  ui->checkBoxAutoclear->setChecked(useAutoclear);
293  on_checkBoxAutoclear_clicked();
294 }
295 
301 void ConfigDialog::setAutoclear(int seconds) {
302  ui->spinBoxAutoclearSeconds->setValue(seconds);
303 }
304 
310 void ConfigDialog::useAutoclearPanel(bool useAutoclearPanel) {
311  ui->checkBoxAutoclearPanel->setChecked(useAutoclearPanel);
312  on_checkBoxAutoclearPanel_clicked();
313 }
314 
321  ui->spinBoxAutoclearPanelSeconds->setValue(seconds);
322 }
323 
329  return static_cast<Enums::clipBoardType>(
330  ui->comboBoxClipboard->currentIndex());
331 }
332 
337 bool ConfigDialog::useSelection() { return ui->checkBoxSelection->isChecked(); }
338 
343 void ConfigDialog::on_checkBoxSelection_clicked() {
344  on_comboBoxClipboard_activated(ui->comboBoxClipboard->currentIndex());
345 }
346 
351 bool ConfigDialog::useAutoclear() { return ui->checkBoxAutoclear->isChecked(); }
352 
358  return ui->spinBoxAutoclearSeconds->value();
359 }
360 
365 void ConfigDialog::on_checkBoxAutoclear_clicked() {
366  on_comboBoxClipboard_activated(ui->comboBoxClipboard->currentIndex());
367 }
368 
374  return ui->checkBoxAutoclearPanel->isChecked();
375 }
376 
382  return ui->spinBoxAutoclearPanelSeconds->value();
383 }
384 
391  return ui->checkBoxHidePassword->isChecked();
392 }
393 
400  return ui->checkBoxHideContent->isChecked();
401 }
402 
408 void ConfigDialog::hidePassword(bool hidePassword) {
409  ui->checkBoxHidePassword->setChecked(hidePassword);
410 }
411 
417 void ConfigDialog::hideContent(bool hideContent) {
418  ui->checkBoxHideContent->setChecked(hideContent);
419 }
420 
426 bool ConfigDialog::addGPGId() { return ui->checkBoxAddGPGId->isChecked(); }
427 
433 void ConfigDialog::addGPGId(bool addGPGId) {
434  ui->checkBoxAddGPGId->setChecked(addGPGId);
435 }
436 
444 void ConfigDialog::genKey(QString batch, QDialog *dialog) {
445  mainWindow->generateKeyPair(batch, dialog);
446 }
447 
454 void ConfigDialog::setProfiles(QHash<QString, QString> profiles,
455  QString profile) {
456  // dbg()<< profiles;
457  if (profiles.contains("")) {
458  profiles.remove("");
459  // remove weird "" key value pairs
460  }
461 
462  ui->profileTable->setRowCount(profiles.count());
463  QHashIterator<QString, QString> i(profiles);
464  int n = 0;
465  while (i.hasNext()) {
466  i.next();
467  if (!i.value().isEmpty() && !i.key().isEmpty()) {
468  ui->profileTable->setItem(n, 0, new QTableWidgetItem(i.key()));
469  ui->profileTable->setItem(n, 1, new QTableWidgetItem(i.value()));
470  // dbg()<< "naam:" + i.key();
471  if (i.key() == profile)
472  ui->profileTable->selectRow(n);
473  }
474  ++n;
475  }
476 }
477 
482 QHash<QString, QString> ConfigDialog::getProfiles() {
483  QHash<QString, QString> profiles;
484  // Check?
485  for (int i = 0; i < ui->profileTable->rowCount(); ++i) {
486  QTableWidgetItem *pathItem = ui->profileTable->item(i, 1);
487  if (0 != pathItem) {
488  QTableWidgetItem *item = ui->profileTable->item(i, 0);
489  if (item == 0) {
490  dbg() << "empty name, should fix in frontend";
491  continue;
492  }
493  profiles.insert(item->text(), pathItem->text());
494  }
495  }
496  return profiles;
497 }
498 
502 void ConfigDialog::on_addButton_clicked() {
503  int n = ui->profileTable->rowCount();
504  ui->profileTable->insertRow(n);
505  ui->profileTable->setItem(n, 1, new QTableWidgetItem(ui->storePath->text()));
506  ui->profileTable->selectRow(n);
507  ui->deleteButton->setEnabled(true);
508 }
509 
513 void ConfigDialog::on_deleteButton_clicked() {
514  QSet<int> selectedRows; // we use a set to prevent doubles
515  QList<QTableWidgetItem *> itemList = ui->profileTable->selectedItems();
516  if (itemList.count() == 0) {
517  QMessageBox::warning(this, tr("No profile selected"),
518  tr("No profile selected to delete"));
519  return;
520  }
521  QTableWidgetItem *item;
522  foreach (item, itemList)
523  selectedRows.insert(item->row());
524  // get a list, and sort it big to small
525  QList<int> rows = selectedRows.toList();
526  qSort(rows.begin(), rows.end());
527  // now actually do the removing:
528  foreach (int row, rows)
529  ui->profileTable->removeRow(row);
530  if (ui->profileTable->rowCount() < 1)
531  ui->deleteButton->setEnabled(false);
532 }
533 
540 void ConfigDialog::criticalMessage(const QString &title, const QString &text) {
541  QMessageBox::critical(this, title, text, QMessageBox::Ok, QMessageBox::Ok);
542 }
543 
549  // mainWindow->checkConfig();
550  bool clean = false;
551 
552  QString gpg = ui->gpgPath->text();
553  // QString gpg = mainWindow->getGpgExecutable();
554  if (!QFile(gpg).exists()) {
555  criticalMessage(
556  tr("GnuPG not found"),
557  tr("Please install GnuPG on your system.<br>Install "
558  "<strong>gpg</strong> using your favorite package manager<br>or <a "
559  "href=\"https://www.gnupg.org/download/#sec-1-2\">download</a> it "
560  "from GnuPG.org"));
561  clean = true;
562  }
563 
564  QStringList names = mainWindow->getSecretKeys();
565  dbg() << names;
566  if (QFile(gpg).exists() && names.empty()) {
567  KeygenDialog d(this);
568  if (!d.exec())
569  return;
570  }
571 
572  QString passStore = ui->storePath->text();
573 
574  if (!QFile(passStore).exists()) {
575  // TODO(annejan) pass version?
576  if (QMessageBox::question(
577  this, tr("Create password-store?"),
578  tr("Would you like to create a password-store at %1?")
579  .arg(passStore),
580  QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
581  QDir().mkdir(passStore);
582 #ifdef Q_OS_WIN
583  SetFileAttributes(passStore.toStdWString().c_str(),
584  FILE_ATTRIBUTE_HIDDEN);
585 #endif
586  if (useGit())
587  mainWindow->executePassGitInit();
588  mainWindow->userDialog(passStore);
589  }
590  }
591 
592  if (!QFile(QDir(passStore).filePath(".gpg-id")).exists()) {
593  dbg() << ".gpg-id file does not exist";
594 
595  if (!clean) {
596  criticalMessage(tr("Password store not initialised"),
597  tr("The folder %1 doesn't seem to be a password store or "
598  "is not yet initialised.")
599  .arg(passStore));
600  }
601  while (!QFile(passStore).exists()) {
602  on_toolButtonStore_clicked();
603  // allow user to cancel
604  if (passStore == ui->storePath->text())
605  return;
606  passStore = ui->storePath->text();
607  }
608  if (!QFile(passStore + ".gpg-id").exists()) {
609  dbg() << ".gpg-id file still does not exist :/";
610  // appears not to be store
611  // init yes / no ?
612  mainWindow->userDialog(passStore);
613  }
614  }
615 }
616 
623  return ui->checkBoxUseTrayIcon->isChecked();
624 }
625 
632  return ui->checkBoxHideOnClose->isEnabled() &&
633  ui->checkBoxHideOnClose->isChecked();
634 }
635 
641 void ConfigDialog::useTrayIcon(bool useSystray) {
642  ui->checkBoxUseTrayIcon->setChecked(useSystray);
643  ui->checkBoxHideOnClose->setEnabled(useSystray);
644  ui->checkBoxStartMinimized->setEnabled(useSystray);
645  if (!useSystray) {
646  ui->checkBoxHideOnClose->setChecked(false);
647  ui->checkBoxStartMinimized->setChecked(false);
648  }
649 }
650 
656 void ConfigDialog::hideOnClose(bool hideOnClose) {
657  ui->checkBoxHideOnClose->setChecked(hideOnClose);
658 }
659 
664 void ConfigDialog::on_checkBoxUseTrayIcon_clicked() {
665  if (ui->checkBoxUseTrayIcon->isChecked()) {
666  ui->checkBoxHideOnClose->setEnabled(true);
667  ui->checkBoxStartMinimized->setEnabled(true);
668  } else {
669  ui->checkBoxStartMinimized->setEnabled(false);
670  ui->checkBoxHideOnClose->setEnabled(false);
671  }
672 }
673 
678 void ConfigDialog::closeEvent(QCloseEvent *event) {
679  // TODO(annejan) save window size or something?
680  event->accept();
681 }
682 
687 void ConfigDialog::useGit(bool useGit) {
688  ui->checkBoxUseGit->setChecked(useGit);
689  on_checkBoxUseGit_clicked();
690 }
691 
696 bool ConfigDialog::useGit() { return ui->checkBoxUseGit->isChecked(); }
697 
702 void ConfigDialog::on_checkBoxUseGit_clicked() {
703  ui->checkBoxAddGPGId->setEnabled(ui->checkBoxUseGit->isChecked());
704  ui->checkBoxAutoPull->setEnabled(ui->checkBoxUseGit->isChecked());
705  ui->checkBoxAutoPush->setEnabled(ui->checkBoxUseGit->isChecked());
706 }
707 
712 void ConfigDialog::on_toolButtonPwgen_clicked() {
713  QString pwgen = selectExecutable();
714  if (!pwgen.isEmpty()) {
715  ui->pwgenPath->setText(pwgen);
716  ui->checkBoxUsePwgen->setEnabled(true);
717  } else {
718  ui->checkBoxUsePwgen->setEnabled(false);
719  ui->checkBoxUsePwgen->setChecked(false);
720  }
721 }
722 
727 QString ConfigDialog::getPwgenPath() { return ui->pwgenPath->text(); }
728 
734 void ConfigDialog::setPwgenPath(QString pwgen) {
735  ui->pwgenPath->setText(pwgen);
736  if (pwgen.isEmpty()) {
737  ui->checkBoxUsePwgen->setChecked(false);
738  ui->checkBoxUsePwgen->setEnabled(false);
739  }
740  on_checkBoxUsePwgen_clicked();
741 }
742 
747 void ConfigDialog::on_checkBoxUsePwgen_clicked() {
748  bool usePwgen = ui->checkBoxUsePwgen->isChecked();
749  ui->checkBoxAvoidCapitals->setEnabled(usePwgen);
750  ui->checkBoxAvoidNumbers->setEnabled(usePwgen);
751  ui->checkBoxLessRandom->setEnabled(usePwgen);
752  ui->checkBoxUseSymbols->setEnabled(usePwgen);
753  ui->lineEditPasswordChars->setEnabled(!usePwgen);
754  ui->labelPasswordChars->setEnabled(!usePwgen);
755  ui->passwordCharTemplateSelector->setEnabled(!usePwgen);
756 }
757 
765 void ConfigDialog::usePwgen(bool usePwgen) {
766  if (ui->pwgenPath->text().isEmpty())
767  usePwgen = false;
768  ui->checkBoxUsePwgen->setChecked(usePwgen);
769  on_checkBoxUsePwgen_clicked();
770 }
771 
777 void ConfigDialog::avoidCapitals(bool avoidCapitals) {
778  ui->checkBoxAvoidCapitals->setChecked(avoidCapitals);
779 }
780 
786 void ConfigDialog::avoidNumbers(bool avoidNumbers) {
787  ui->checkBoxAvoidNumbers->setChecked(avoidNumbers);
788 }
789 
795 void ConfigDialog::lessRandom(bool lessRandom) {
796  ui->checkBoxLessRandom->setChecked(lessRandom);
797 }
798 
804 void ConfigDialog::useSymbols(bool useSymbols) {
805  ui->checkBoxUseSymbols->setChecked(useSymbols);
806 }
807 
809  const PasswordConfiguration &config) {
810  ui->spinBoxPasswordLength->setValue(config.length);
811  ui->passwordCharTemplateSelector->setCurrentIndex(config.selected);
813  ui->lineEditPasswordChars->setEnabled(false);
814  ui->lineEditPasswordChars->setText(config.Characters[config.selected]);
815 }
816 
818  PasswordConfiguration config;
819  config.length = ui->spinBoxPasswordLength->value();
820  config.selected = static_cast<PasswordConfiguration::characterSet>(
821  ui->passwordCharTemplateSelector->currentIndex());
823  ui->lineEditPasswordChars->text();
824  return config;
825 }
826 
831 bool ConfigDialog::usePwgen() { return ui->checkBoxUsePwgen->isChecked(); }
832 
839  return ui->checkBoxAvoidCapitals->isChecked();
840 }
841 
848  return ui->checkBoxAvoidNumbers->isChecked();
849 }
850 
856 bool ConfigDialog::lessRandom() { return ui->checkBoxLessRandom->isChecked(); }
857 
863 bool ConfigDialog::useSymbols() { return ui->checkBoxUseSymbols->isChecked(); }
864 
871 void ConfigDialog::on_passwordCharTemplateSelector_activated(int index) {
872  ui->lineEditPasswordChars->setText(
873  QtPassSettings::getPasswordConfiguration().Characters[index]);
874  if (index == 3) {
875  ui->lineEditPasswordChars->setEnabled(true);
876  } else {
877  ui->lineEditPasswordChars->setEnabled(false);
878  }
879 }
880 
887  return ui->checkBoxStartMinimized->isChecked();
888 }
889 
895 void ConfigDialog::startMinimized(bool startMinimized) {
896  ui->checkBoxStartMinimized->setChecked(startMinimized);
897 }
898 
903 void ConfigDialog::on_checkBoxUseTemplate_clicked() {
904  ui->plainTextEditTemplate->setEnabled(ui->checkBoxUseTemplate->isChecked());
905  ui->checkBoxTemplateAllFields->setEnabled(
906  ui->checkBoxUseTemplate->isChecked());
907 }
908 
913 void ConfigDialog::useTemplate(bool useTemplate) {
914  ui->checkBoxUseTemplate->setChecked(useTemplate);
915  on_checkBoxUseTemplate_clicked();
916 }
917 
923  return ui->checkBoxUseTemplate->isChecked();
924 }
925 
930 void ConfigDialog::setTemplate(QString passTemplate) {
931  ui->plainTextEditTemplate->setPlainText(passTemplate);
932 }
933 
939  return ui->plainTextEditTemplate->toPlainText();
940 }
941 
947 void ConfigDialog::autoPull(bool autoPull) {
948  ui->checkBoxAutoPull->setChecked(autoPull);
949 }
950 
955 void ConfigDialog::autoPush(bool autoPush) {
956  ui->checkBoxAutoPush->setChecked(autoPush);
957 }
958 
964 bool ConfigDialog::autoPull() { return ui->checkBoxAutoPull->isChecked(); }
965 
971 bool ConfigDialog::autoPush() { return ui->checkBoxAutoPush->isChecked(); }
972 
979  return ui->checkBoxTemplateAllFields->isChecked();
980 }
981 
987 void ConfigDialog::templateAllFields(bool templateAll) {
988  ui->checkBoxTemplateAllFields->setChecked(templateAll);
989 }
990 
996 void ConfigDialog::alwaysOnTop(bool alwaysOnTop) {
997  ui->checkBoxAlwaysOnTop->setChecked(alwaysOnTop);
998 }
999 
1006  return ui->checkBoxAlwaysOnTop->isChecked();
1007 }
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...
static void setPassExecutable(const QString &passExecutable)
bool hideOnClose()
ConfigDialog::hideOnClose return preference for hiding instead of closing (quitting) application...
bool useTemplate()
ConfigDialog::useTemplate return preference for using templates.
int length
Length of the password.
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.
#define dbg()
Definition: debughelper.h:7
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.
static void setGitExecutable(const QString &gitExecutable)
Handles GPG keypair generation.
Definition: keygendialog.h:16
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.
void userDialog(QString="")
MainWindow::userDialog see MainWindow::on_usersButton_clicked()
Definition: mainwindow.cpp:996
enum PasswordConfiguration::characterSet selected
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.
void executePassGitInit()
MainWindow::executePassGitInit git init wrapper.
Definition: mainwindow.cpp:544
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.
static void setGpgExecutable(const QString &gpgExecutable)
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.
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.
QStringList getSecretKeys()
MainWindow::getSecretKeys get list of secret/private keys.
QString Characters[CHARSETS_COUNT]
The different character sets.
static PasswordConfiguration getPasswordConfiguration()
PasswordConfiguration getPasswordConfiguration()
void generateKeyPair(QString, QDialog *)
MainWindow::generateKeyPair internal gpg keypair generator . .
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.
characterSet
The selected character set.