QtPass  1.2.0-pre
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 <QMessageBox>
10 #ifdef Q_OS_WIN
11 #include <windows.h>
12 #endif
13 
19  : QDialog(parent), ui(new Ui::ConfigDialog) {
20  mainWindow = parent;
21  ui->setupUi(this);
22  ui->profileTable->verticalHeader()->hide();
23  ui->profileTable->horizontalHeader()->setStretchLastSection(true);
24  ui->label->setText(ui->label->text() + VERSION);
25  ui->comboBoxClipboard->clear();
26 
27  ui->comboBoxClipboard->addItem(tr("No Clipboard"));
28  ui->comboBoxClipboard->addItem(tr("Always copy to clipboard"));
29  ui->comboBoxClipboard->addItem(tr("On-demand copy to clipboard"));
30  ui->comboBoxClipboard->setCurrentIndex(0);
31 
32  QClipboard *clip = QApplication::clipboard();
33  if (!clip->supportsSelection()) {
34  useSelection(false);
35  ui->checkBoxSelection->setVisible(false);
36  }
37 }
38 
44  QtPassSettings::setGitExecutable(ui->gitPath->text());
45  QtPassSettings::setGpgExecutable(ui->gpgPath->text());
46  QtPassSettings::setPassExecutable(ui->passPath->text());
47 }
48 
53 void ConfigDialog::setPassPath(QString path) { ui->passPath->setText(path); }
54 
60 void ConfigDialog::setGitPath(QString path) {
61  ui->gitPath->setText(path);
62  if (path.isEmpty()) {
63  useGit(false);
64  ui->checkBoxUseGit->setEnabled(false);
65  } else {
66  ui->checkBoxUseGit->setEnabled(true);
67  }
68 }
69 
74 void ConfigDialog::setGpgPath(QString path) { ui->gpgPath->setText(path); }
75 
80 void ConfigDialog::setStorePath(QString path) { ui->storePath->setText(path); }
81 
86 QString ConfigDialog::getPassPath() { return ui->passPath->text(); }
87 
92 QString ConfigDialog::getGitPath() { return ui->gitPath->text(); }
93 
98 QString ConfigDialog::getGpgPath() { return ui->gpgPath->text(); }
99 
104 QString ConfigDialog::getStorePath() { return ui->storePath->text(); }
105 
111 bool ConfigDialog::usePass() { return ui->radioButtonPass->isChecked(); }
112 
119  if (usePass) {
120  ui->radioButtonNative->setChecked(false);
121  ui->radioButtonPass->setChecked(true);
122  } else {
123  ui->radioButtonNative->setChecked(true);
124  ui->radioButtonPass->setChecked(false);
125  }
126  setGroupBoxState();
127 }
128 
133 void ConfigDialog::on_radioButtonNative_clicked() { setGroupBoxState(); }
134 
139 void ConfigDialog::on_radioButtonPass_clicked() { setGroupBoxState(); }
140 
144 void ConfigDialog::setGroupBoxState() {
145  if (ui->radioButtonPass->isChecked()) {
146  ui->groupBoxNative->setEnabled(false);
147  ui->groupBoxPass->setEnabled(true);
148  } else {
149  ui->groupBoxNative->setEnabled(true);
150  ui->groupBoxPass->setEnabled(false);
151  }
152 }
153 
158 QString ConfigDialog::selectExecutable() {
159  QFileDialog dialog(this);
160  dialog.setFileMode(QFileDialog::ExistingFile);
161  dialog.setOption(QFileDialog::ReadOnly);
162  if (dialog.exec())
163  return dialog.selectedFiles().first();
164  else
165  return "";
166 }
167 
172 QString ConfigDialog::selectFolder() {
173  QFileDialog dialog(this);
174  dialog.setFileMode(QFileDialog::Directory);
175  dialog.setFilter(QDir::NoFilter);
176  dialog.setOption(QFileDialog::ShowDirsOnly);
177  if (dialog.exec())
178  return dialog.selectedFiles().first();
179  else
180  return "";
181 }
182 
187 void ConfigDialog::on_toolButtonGit_clicked() {
188  QString git = selectExecutable();
189  if (!git.isEmpty()) {
190  ui->gitPath->setText(git);
191  ui->checkBoxUseGit->setEnabled(true);
192  } else {
193  useGit(false);
194  ui->checkBoxUseGit->setEnabled(false);
195  }
196 }
197 
201 void ConfigDialog::on_toolButtonGpg_clicked() {
202  QString gpg = selectExecutable();
203  if (!gpg.isEmpty())
204  ui->gpgPath->setText(gpg);
205 }
206 
210 void ConfigDialog::on_toolButtonPass_clicked() {
211  QString pass = selectExecutable();
212  if (!pass.isEmpty())
213  ui->passPath->setText(pass);
214 }
215 
220 void ConfigDialog::on_toolButtonStore_clicked() {
221  QString store = selectFolder();
222  if (!store.isEmpty()) // TODO(annejan) call check
223  ui->storePath->setText(store);
224 }
225 
230 void ConfigDialog::on_comboBoxClipboard_activated(int index) {
231  if (index > 0) {
232  ui->checkBoxSelection->setEnabled(true);
233  ui->checkBoxAutoclear->setEnabled(true);
234  ui->checkBoxHidePassword->setEnabled(true);
235  ui->checkBoxHideContent->setEnabled(true);
236  if (ui->checkBoxAutoclear->isChecked()) {
237  ui->spinBoxAutoclearSeconds->setEnabled(true);
238  ui->labelSeconds->setEnabled(true);
239  } else {
240  ui->spinBoxAutoclearSeconds->setEnabled(false);
241  ui->labelSeconds->setEnabled(false);
242  }
243  } else {
244  ui->checkBoxSelection->setEnabled(false);
245  ui->checkBoxAutoclear->setEnabled(false);
246  ui->spinBoxAutoclearSeconds->setEnabled(false);
247  ui->labelSeconds->setEnabled(false);
248  ui->checkBoxHidePassword->setEnabled(false);
249  ui->checkBoxHideContent->setEnabled(false);
250  }
251 }
252 
257 void ConfigDialog::on_checkBoxAutoclearPanel_clicked() {
258  if (ui->checkBoxAutoclearPanel->isChecked()) {
259  ui->spinBoxAutoclearPanelSeconds->setEnabled(true);
260  ui->labelPanelSeconds->setEnabled(true);
261  } else {
262  ui->spinBoxAutoclearPanelSeconds->setEnabled(false);
263  ui->labelPanelSeconds->setEnabled(false);
264  }
265 }
266 
271  ui->comboBoxClipboard->setCurrentIndex(static_cast<int>(useClipboard));
272  on_comboBoxClipboard_activated(static_cast<int>(useClipboard));
273 }
274 
281  ui->checkBoxSelection->setChecked(useSelection);
282  on_checkBoxSelection_clicked();
283 }
284 
291  ui->checkBoxAutoclear->setChecked(useAutoclear);
292  on_checkBoxAutoclear_clicked();
293 }
294 
300 void ConfigDialog::setAutoclear(int seconds) {
301  ui->spinBoxAutoclearSeconds->setValue(seconds);
302 }
303 
310  ui->checkBoxAutoclearPanel->setChecked(useAutoclearPanel);
311  on_checkBoxAutoclearPanel_clicked();
312 }
313 
320  ui->spinBoxAutoclearPanelSeconds->setValue(seconds);
321 }
322 
328  return static_cast<Enums::clipBoardType>(
329  ui->comboBoxClipboard->currentIndex());
330 }
331 
336 bool ConfigDialog::useSelection() { return ui->checkBoxSelection->isChecked(); }
337 
342 void ConfigDialog::on_checkBoxSelection_clicked() {
343  on_comboBoxClipboard_activated(ui->comboBoxClipboard->currentIndex());
344 }
345 
350 bool ConfigDialog::useAutoclear() { return ui->checkBoxAutoclear->isChecked(); }
351 
357  return ui->spinBoxAutoclearSeconds->value();
358 }
359 
364 void ConfigDialog::on_checkBoxAutoclear_clicked() {
365  on_comboBoxClipboard_activated(ui->comboBoxClipboard->currentIndex());
366 }
367 
373  return ui->checkBoxAutoclearPanel->isChecked();
374 }
375 
381  return ui->spinBoxAutoclearPanelSeconds->value();
382 }
383 
390  return ui->checkBoxHidePassword->isChecked();
391 }
392 
399  return ui->checkBoxHideContent->isChecked();
400 }
401 
408  ui->checkBoxHidePassword->setChecked(hidePassword);
409 }
410 
417  ui->checkBoxHideContent->setChecked(hideContent);
418 }
419 
425 bool ConfigDialog::addGPGId() { return ui->checkBoxAddGPGId->isChecked(); }
426 
433  ui->checkBoxAddGPGId->setChecked(addGPGId);
434 }
435 
443 void ConfigDialog::genKey(QString batch, QDialog *dialog) {
444  mainWindow->generateKeyPair(batch, dialog);
445 }
446 
453 void ConfigDialog::setProfiles(QHash<QString, QString> profiles,
454  QString profile) {
455  // dbg()<< profiles;
456  if (profiles.contains("")) {
457  profiles.remove("");
458  // remove weird "" key value pairs
459  }
460 
461  ui->profileTable->setRowCount(profiles.count());
462  QHashIterator<QString, QString> i(profiles);
463  int n = 0;
464  while (i.hasNext()) {
465  i.next();
466  if (!i.value().isEmpty() && !i.key().isEmpty()) {
467  ui->profileTable->setItem(n, 0, new QTableWidgetItem(i.key()));
468  ui->profileTable->setItem(n, 1, new QTableWidgetItem(i.value()));
469  // dbg()<< "naam:" + i.key();
470  if (i.key() == profile)
471  ui->profileTable->selectRow(n);
472  }
473  ++n;
474  }
475 }
476 
481 QHash<QString, QString> ConfigDialog::getProfiles() {
482  QHash<QString, QString> profiles;
483  // Check?
484  for (int i = 0; i < ui->profileTable->rowCount(); ++i) {
485  QTableWidgetItem *pathItem = ui->profileTable->item(i, 1);
486  if (0 != pathItem) {
487  QTableWidgetItem *item = ui->profileTable->item(i, 0);
488  if (item == 0) {
489  dbg() << "empty name, should fix in frontend";
490  continue;
491  }
492  profiles.insert(item->text(), pathItem->text());
493  }
494  }
495  return profiles;
496 }
497 
501 void ConfigDialog::on_addButton_clicked() {
502  int n = ui->profileTable->rowCount();
503  ui->profileTable->insertRow(n);
504  ui->profileTable->setItem(n, 1, new QTableWidgetItem(ui->storePath->text()));
505  ui->profileTable->selectRow(n);
506  ui->deleteButton->setEnabled(true);
507 }
508 
512 void ConfigDialog::on_deleteButton_clicked() {
513  QSet<int> selectedRows; // we use a set to prevent doubles
514  QList<QTableWidgetItem *> itemList = ui->profileTable->selectedItems();
515  if (itemList.count() == 0) {
516  QMessageBox::warning(this, tr("No profile selected"),
517  tr("No profile selected to delete"));
518  return;
519  }
520  QTableWidgetItem *item;
521  foreach (item, itemList)
522  selectedRows.insert(item->row());
523  // get a list, and sort it big to small
524  QList<int> rows = selectedRows.toList();
525  qSort(rows.begin(), rows.end());
526  // now actually do the removing:
527  foreach (int row, rows)
528  ui->profileTable->removeRow(row);
529  if (ui->profileTable->rowCount() < 1)
530  ui->deleteButton->setEnabled(false);
531 }
532 
539 void ConfigDialog::criticalMessage(const QString &title, const QString &text) {
540  QMessageBox::critical(this, title, text, QMessageBox::Ok, QMessageBox::Ok);
541 }
542 
548  // mainWindow->checkConfig();
549  bool clean = false;
550 
551  QString gpg = ui->gpgPath->text();
552  // QString gpg = mainWindow->getGpgExecutable();
553  if (!QFile(gpg).exists()) {
554  criticalMessage(
555  tr("GnuPG not found"),
556  tr("Please install GnuPG on your system.<br>Install "
557  "<strong>gpg</strong> using your favorite package manager<br>or <a "
558  "href=\"https://www.gnupg.org/download/#sec-1-2\">download</a> it "
559  "from GnuPG.org"));
560  clean = true;
561  }
562 
563  QStringList names = mainWindow->getSecretKeys();
564  dbg() << names;
565  if (QFile(gpg).exists() && names.empty()) {
566  KeygenDialog d(this);
567  if (!d.exec())
568  return;
569  }
570 
571  QString passStore = ui->storePath->text();
572 
573  if (!QFile(passStore).exists()) {
574  // TODO(annejan) pass version?
575  if (QMessageBox::question(
576  this, tr("Create password-store?"),
577  tr("Would you like to create a password-store at %1?")
578  .arg(passStore),
579  QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
580  QDir().mkdir(passStore);
581 #ifdef Q_OS_WIN
582  SetFileAttributes(passStore.toStdWString().c_str(),
583  FILE_ATTRIBUTE_HIDDEN);
584 #endif
585  if (useGit())
586  mainWindow->executePassGitInit();
587  mainWindow->userDialog(passStore);
588  }
589  }
590 
591  if (!QFile(QDir(passStore).filePath(".gpg-id")).exists()) {
592  dbg() << ".gpg-id file does not exist";
593 
594  if (!clean) {
595  criticalMessage(tr("Password store not initialised"),
596  tr("The folder %1 doesn't seem to be a password store or "
597  "is not yet initialised.")
598  .arg(passStore));
599  }
600  while (!QFile(passStore).exists()) {
601  on_toolButtonStore_clicked();
602  // allow user to cancel
603  if (passStore == ui->storePath->text())
604  return;
605  passStore = ui->storePath->text();
606  }
607  if (!QFile(passStore + ".gpg-id").exists()) {
608  dbg() << ".gpg-id file still does not exist :/";
609  // appears not to be store
610  // init yes / no ?
611  mainWindow->userDialog(passStore);
612  }
613  }
614 }
615 
622  return ui->checkBoxUseTrayIcon->isChecked();
623 }
624 
631  return ui->checkBoxHideOnClose->isEnabled() &&
632  ui->checkBoxHideOnClose->isChecked();
633 }
634 
640 void ConfigDialog::useTrayIcon(bool useSystray) {
641  ui->checkBoxUseTrayIcon->setChecked(useSystray);
642  ui->checkBoxHideOnClose->setEnabled(useSystray);
643  ui->checkBoxStartMinimized->setEnabled(useSystray);
644  if (!useSystray) {
645  ui->checkBoxHideOnClose->setChecked(false);
646  ui->checkBoxStartMinimized->setChecked(false);
647  }
648 }
649 
656  ui->checkBoxHideOnClose->setChecked(hideOnClose);
657 }
658 
663 void ConfigDialog::on_checkBoxUseTrayIcon_clicked() {
664  if (ui->checkBoxUseTrayIcon->isChecked()) {
665  ui->checkBoxHideOnClose->setEnabled(true);
666  ui->checkBoxStartMinimized->setEnabled(true);
667  } else {
668  ui->checkBoxStartMinimized->setEnabled(false);
669  ui->checkBoxHideOnClose->setEnabled(false);
670  }
671 }
672 
677 void ConfigDialog::closeEvent(QCloseEvent *event) {
678  // TODO(annejan) save window size or something?
679  event->accept();
680 }
681 
687  ui->checkBoxUseGit->setChecked(useGit);
688  on_checkBoxUseGit_clicked();
689 }
690 
695 bool ConfigDialog::useGit() { return ui->checkBoxUseGit->isChecked(); }
696 
701 void ConfigDialog::on_checkBoxUseGit_clicked() {
702  ui->checkBoxAddGPGId->setEnabled(ui->checkBoxUseGit->isChecked());
703  ui->checkBoxAutoPull->setEnabled(ui->checkBoxUseGit->isChecked());
704  ui->checkBoxAutoPush->setEnabled(ui->checkBoxUseGit->isChecked());
705 }
706 
711 void ConfigDialog::on_toolButtonPwgen_clicked() {
712  QString pwgen = selectExecutable();
713  if (!pwgen.isEmpty()) {
714  ui->pwgenPath->setText(pwgen);
715  ui->checkBoxUsePwgen->setEnabled(true);
716  } else {
717  ui->checkBoxUsePwgen->setEnabled(false);
718  ui->checkBoxUsePwgen->setChecked(false);
719  }
720 }
721 
726 QString ConfigDialog::getPwgenPath() { return ui->pwgenPath->text(); }
727 
733 void ConfigDialog::setPwgenPath(QString pwgen) {
734  ui->pwgenPath->setText(pwgen);
735  if (pwgen.isEmpty()) {
736  ui->checkBoxUsePwgen->setChecked(false);
737  ui->checkBoxUsePwgen->setEnabled(false);
738  }
739  on_checkBoxUsePwgen_clicked();
740 }
741 
746 void ConfigDialog::on_checkBoxUsePwgen_clicked() {
747  bool usePwgen = ui->checkBoxUsePwgen->isChecked();
748  ui->checkBoxAvoidCapitals->setEnabled(usePwgen);
749  ui->checkBoxAvoidNumbers->setEnabled(usePwgen);
750  ui->checkBoxLessRandom->setEnabled(usePwgen);
751  ui->checkBoxUseSymbols->setEnabled(usePwgen);
752  ui->lineEditPasswordChars->setEnabled(!usePwgen);
753  ui->labelPasswordChars->setEnabled(!usePwgen);
754  ui->passwordCharTemplateSelector->setEnabled(!usePwgen);
755 }
756 
765  if (ui->pwgenPath->text().isEmpty())
766  usePwgen = false;
767  ui->checkBoxUsePwgen->setChecked(usePwgen);
768  on_checkBoxUsePwgen_clicked();
769 }
770 
777  ui->checkBoxAvoidCapitals->setChecked(avoidCapitals);
778 }
779 
786  ui->checkBoxAvoidNumbers->setChecked(avoidNumbers);
787 }
788 
795  ui->checkBoxLessRandom->setChecked(lessRandom);
796 }
797 
804  ui->checkBoxUseSymbols->setChecked(useSymbols);
805 }
806 
813  ui->spinBoxPasswordLength->setValue(pwLen);
814 }
815 
821 void ConfigDialog::setPasswordChars(QString pwChars) {
822  ui->lineEditPasswordChars->setText(pwChars);
823 }
824 
829 bool ConfigDialog::usePwgen() { return ui->checkBoxUsePwgen->isChecked(); }
830 
837  return ui->checkBoxAvoidCapitals->isChecked();
838 }
839 
846  return ui->checkBoxAvoidNumbers->isChecked();
847 }
848 
854 bool ConfigDialog::lessRandom() { return ui->checkBoxLessRandom->isChecked(); }
855 
861 bool ConfigDialog::useSymbols() { return ui->checkBoxUseSymbols->isChecked(); }
862 
869  return ui->spinBoxPasswordLength->value();
870 }
871 
878  return ui->lineEditPasswordChars->text();
879 }
880 
887  ui->passwordCharTemplateSelector->setCurrentIndex(selection);
888 }
889 
896  return ui->passwordCharTemplateSelector->currentIndex();
897 }
898 
905 void ConfigDialog::on_passwordCharTemplateSelector_activated(int index) {
906  ui->lineEditPasswordChars->setText(mainWindow->pwdConfig.Characters[index]);
907  if (index == 3) {
908  ui->lineEditPasswordChars->setEnabled(true);
909  } else {
910  ui->lineEditPasswordChars->setEnabled(false);
911  }
912 }
913 
921  ui->lineEditPasswordChars->setEnabled(b);
922 }
923 
930  return ui->checkBoxStartMinimized->isChecked();
931 }
932 
939  ui->checkBoxStartMinimized->setChecked(startMinimized);
940 }
941 
946 void ConfigDialog::on_checkBoxUseTemplate_clicked() {
947  ui->plainTextEditTemplate->setEnabled(ui->checkBoxUseTemplate->isChecked());
948  ui->checkBoxTemplateAllFields->setEnabled(
949  ui->checkBoxUseTemplate->isChecked());
950 }
951 
957  ui->checkBoxUseTemplate->setChecked(useTemplate);
958  on_checkBoxUseTemplate_clicked();
959 }
960 
966  return ui->checkBoxUseTemplate->isChecked();
967 }
968 
973 void ConfigDialog::setTemplate(QString passTemplate) {
974  ui->plainTextEditTemplate->setPlainText(passTemplate);
975 }
976 
982  return ui->plainTextEditTemplate->toPlainText();
983 }
984 
991  ui->checkBoxAutoPull->setChecked(autoPull);
992 }
993 
999  ui->checkBoxAutoPush->setChecked(autoPush);
1000 }
1001 
1007 bool ConfigDialog::autoPull() { return ui->checkBoxAutoPull->isChecked(); }
1008 
1014 bool ConfigDialog::autoPush() { return ui->checkBoxAutoPush->isChecked(); }
1015 
1022  return ui->checkBoxTemplateAllFields->isChecked();
1023 }
1024 
1030 void ConfigDialog::templateAllFields(bool templateAll) {
1031  ui->checkBoxTemplateAllFields->setChecked(templateAll);
1032 }
1033 
1040  ui->checkBoxAlwaysOnTop->setChecked(alwaysOnTop);
1041 }
1042 
1049  return ui->checkBoxAlwaysOnTop->isChecked();
1050 }
QHash< QString, QString > getProfiles()
ConfigDialog::getProfiles return profile list.
~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...
passwordConfiguration pwdConfig
MainWindow::pwdConfig instance of passwordConfiguration.
Definition: mainwindow.h:61
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.
#define dbg()
Definition: debughelper.h:7
void setPassPath(QString)
ConfigDialog::setPassPath set the pass executable path.
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...
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 Characters[CHARSETS_COUNT]
passwordConfiguration::Characters the different character sets.
Definition: datahelpers.h:29
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()
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)...
void executePassGitInit()
MainWindow::executePassGitInit git init wrapper.
Definition: mainwindow.cpp:619
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.
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: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.
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.
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: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.