QtPass  1.2.3
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 
24  ui->passPath->setText(QtPassSettings::getPassExecutable());
26  ui->gpgPath->setText(QtPassSettings::getGpgExecutable());
27  ui->storePath->setText(QtPassSettings::getPassStore());
28 
29  ui->spinBoxAutoclearSeconds->setValue(QtPassSettings::getAutoclearSeconds());
30  ui->spinBoxAutoclearPanelSeconds->setValue(
32  ui->checkBoxHidePassword->setChecked(QtPassSettings::isHidePassword());
33  ui->checkBoxHideContent->setChecked(QtPassSettings::isHideContent());
34  ui->checkBoxAddGPGId->setChecked(QtPassSettings::isAddGPGId(true));
35  ui->checkBoxHideOnClose->setChecked(QtPassSettings::isHideOnClose());
36  ui->checkBoxStartMinimized->setChecked(QtPassSettings::isStartMinimized());
37  ui->checkBoxAvoidCapitals->setChecked(QtPassSettings::isAvoidCapitals());
38  ui->checkBoxAvoidNumbers->setChecked(QtPassSettings::isAvoidNumbers());
39  ui->checkBoxLessRandom->setChecked(QtPassSettings::isLessRandom());
40  ui->checkBoxUseSymbols->setChecked(QtPassSettings::isUseSymbols());
41  ui->plainTextEditTemplate->setPlainText(QtPassSettings::getPassTemplate());
42  ui->checkBoxTemplateAllFields->setChecked(
44  ui->checkBoxAutoPull->setChecked(QtPassSettings::isAutoPull());
45  ui->checkBoxAutoPush->setChecked(QtPassSettings::isAutoPush());
46  ui->checkBoxAlwaysOnTop->setChecked(QtPassSettings::isAlwaysOnTop());
47 
48 #if defined(Q_OS_WIN) || defined(__APPLE__)
49  ui->checkBoxUseOtp->hide();
50  ui->label_10->hide();
51 #endif
52 
56 
57  usePass(QtPassSettings::isUsePass());
65 
66  ui->profileTable->verticalHeader()->hide();
67  ui->profileTable->horizontalHeader()->setStretchLastSection(true);
68  ui->label->setText(ui->label->text() + VERSION);
69  ui->comboBoxClipboard->clear();
70 
71  ui->comboBoxClipboard->addItem(tr("No Clipboard"));
72  ui->comboBoxClipboard->addItem(tr("Always copy to clipboard"));
73  ui->comboBoxClipboard->addItem(tr("On-demand copy to clipboard"));
74 
75  int currentIndex = QtPassSettings::getClipBoardTypeRaw();
76  ui->comboBoxClipboard->setCurrentIndex(currentIndex);
77  on_comboBoxClipboard_activated(currentIndex);
78 
79  QClipboard *clip = QApplication::clipboard();
80  if (!clip->supportsSelection()) {
81  useSelection(false);
82  ui->checkBoxSelection->setVisible(false);
83  } else {
85  }
86 
87  connect(this, &ConfigDialog::accepted, this, &ConfigDialog::on_accepted);
88 }
89 
95  QtPassSettings::setGitExecutable(ui->gitPath->text());
96  QtPassSettings::setGpgExecutable(ui->gpgPath->text());
97  QtPassSettings::setPassExecutable(ui->passPath->text());
98 }
99 
105 void ConfigDialog::setGitPath(QString path) {
106  ui->gitPath->setText(path);
107  ui->checkBoxUseGit->setEnabled(!path.isEmpty());
108  if (path.isEmpty()) {
109  useGit(false);
110  }
111 }
112 
118 void ConfigDialog::usePass(bool usePass) {
119  ui->radioButtonNative->setChecked(!usePass);
120  ui->radioButtonPass->setChecked(usePass);
121  setGroupBoxState();
122 }
123 
124 void ConfigDialog::on_accepted() {
125  QtPassSettings::setPassExecutable(ui->passPath->text());
126  QtPassSettings::setGitExecutable(ui->gitPath->text());
127  QtPassSettings::setGpgExecutable(ui->gpgPath->text());
129  Util::normalizeFolderPath(ui->storePath->text()));
130  QtPassSettings::setUsePass(ui->radioButtonPass->isChecked());
131  QtPassSettings::setClipBoardType(ui->comboBoxClipboard->currentIndex());
132  QtPassSettings::setUseSelection(ui->checkBoxSelection->isChecked());
133  QtPassSettings::setUseAutoclear(ui->checkBoxAutoclear->isChecked());
134  QtPassSettings::setAutoclearSeconds(ui->spinBoxAutoclearSeconds->value());
135  QtPassSettings::setUseAutoclearPanel(ui->checkBoxAutoclearPanel->isChecked());
137  ui->spinBoxAutoclearPanelSeconds->value());
138  QtPassSettings::setHidePassword(ui->checkBoxHidePassword->isChecked());
139  QtPassSettings::setHideContent(ui->checkBoxHideContent->isChecked());
140  QtPassSettings::setAddGPGId(ui->checkBoxAddGPGId->isChecked());
141  QtPassSettings::setUseTrayIcon(ui->checkBoxUseTrayIcon->isChecked());
143  QtPassSettings::setStartMinimized(ui->checkBoxStartMinimized->isChecked());
145  QtPassSettings::setUseGit(ui->checkBoxUseGit->isChecked());
146  QtPassSettings::setUseOtp(ui->checkBoxUseOtp->isChecked());
147  QtPassSettings::setPwgenExecutable(ui->pwgenPath->text());
148  QtPassSettings::setUsePwgen(ui->checkBoxUsePwgen->isChecked());
149  QtPassSettings::setAvoidCapitals(ui->checkBoxAvoidCapitals->isChecked());
150  QtPassSettings::setAvoidNumbers(ui->checkBoxAvoidNumbers->isChecked());
151  QtPassSettings::setLessRandom(ui->checkBoxLessRandom->isChecked());
152  QtPassSettings::setUseSymbols(ui->checkBoxUseSymbols->isChecked());
154  QtPassSettings::setUseTemplate(ui->checkBoxUseTemplate->isChecked());
155  QtPassSettings::setPassTemplate(ui->plainTextEditTemplate->toPlainText());
157  ui->checkBoxTemplateAllFields->isChecked());
158  QtPassSettings::setAutoPush(ui->checkBoxAutoPush->isChecked());
159  QtPassSettings::setAutoPull(ui->checkBoxAutoPull->isChecked());
160  QtPassSettings::setAlwaysOnTop(ui->checkBoxAlwaysOnTop->isChecked());
161 
163 }
164 
169 void ConfigDialog::on_radioButtonNative_clicked() { setGroupBoxState(); }
170 
175 void ConfigDialog::on_radioButtonPass_clicked() { setGroupBoxState(); }
176 
180 void ConfigDialog::setGroupBoxState() {
181  bool state = ui->radioButtonPass->isChecked();
182  ui->groupBoxNative->setEnabled(!state);
183  ui->groupBoxPass->setEnabled(state);
184 }
185 
190 QString ConfigDialog::selectExecutable() {
191  QFileDialog dialog(this);
192  dialog.setFileMode(QFileDialog::ExistingFile);
193  dialog.setOption(QFileDialog::ReadOnly);
194  if (dialog.exec())
195  return dialog.selectedFiles().first();
196  else
197  return QString();
198 }
199 
204 QString ConfigDialog::selectFolder() {
205  QFileDialog dialog(this);
206  dialog.setFileMode(QFileDialog::Directory);
207  dialog.setFilter(QDir::NoFilter);
208  dialog.setOption(QFileDialog::ShowDirsOnly);
209  if (dialog.exec())
210  return dialog.selectedFiles().first();
211  else
212  return QString();
213 }
214 
219 void ConfigDialog::on_toolButtonGit_clicked() {
220  QString git = selectExecutable();
221  bool state = !git.isEmpty();
222  if (state) {
223  ui->gitPath->setText(git);
224  } else {
225  useGit(false);
226  }
227 
228  ui->checkBoxUseGit->setEnabled(state);
229 }
230 
234 void ConfigDialog::on_toolButtonGpg_clicked() {
235  QString gpg = selectExecutable();
236  if (!gpg.isEmpty())
237  ui->gpgPath->setText(gpg);
238 }
239 
243 void ConfigDialog::on_toolButtonPass_clicked() {
244  QString pass = selectExecutable();
245  if (!pass.isEmpty())
246  ui->passPath->setText(pass);
247 }
248 
253 void ConfigDialog::on_toolButtonStore_clicked() {
254  QString store = selectFolder();
255  if (!store.isEmpty()) // TODO(annejan) call check
256  ui->storePath->setText(store);
257 }
258 
263 void ConfigDialog::on_comboBoxClipboard_activated(int index) {
264  bool state = index > 0;
265 
266  ui->checkBoxSelection->setEnabled(state);
267  ui->checkBoxAutoclear->setEnabled(state);
268  ui->checkBoxHidePassword->setEnabled(state);
269  ui->checkBoxHideContent->setEnabled(state);
270  if (state) {
271  ui->spinBoxAutoclearSeconds->setEnabled(ui->checkBoxAutoclear->isChecked());
272  ui->labelSeconds->setEnabled(ui->checkBoxAutoclear->isChecked());
273  } else {
274  ui->spinBoxAutoclearSeconds->setEnabled(false);
275  ui->labelSeconds->setEnabled(false);
276  }
277 }
278 
283 void ConfigDialog::on_checkBoxAutoclearPanel_clicked() {
284  bool state = ui->checkBoxAutoclearPanel->isChecked();
285  ui->spinBoxAutoclearPanelSeconds->setEnabled(state);
286  ui->labelPanelSeconds->setEnabled(state);
287 }
288 
294 void ConfigDialog::useSelection(bool useSelection) {
295  ui->checkBoxSelection->setChecked(useSelection);
296  on_checkBoxSelection_clicked();
297 }
298 
304 void ConfigDialog::useAutoclear(bool useAutoclear) {
305  ui->checkBoxAutoclear->setChecked(useAutoclear);
306  on_checkBoxAutoclear_clicked();
307 }
308 
314 void ConfigDialog::useAutoclearPanel(bool useAutoclearPanel) {
315  ui->checkBoxAutoclearPanel->setChecked(useAutoclearPanel);
316  on_checkBoxAutoclearPanel_clicked();
317 }
318 
323 void ConfigDialog::on_checkBoxSelection_clicked() {
324  on_comboBoxClipboard_activated(ui->comboBoxClipboard->currentIndex());
325 }
326 
331 void ConfigDialog::on_checkBoxAutoclear_clicked() {
332  on_comboBoxClipboard_activated(ui->comboBoxClipboard->currentIndex());
333 }
334 
342 void ConfigDialog::genKey(QString batch, QDialog *dialog) {
343  mainWindow->generateKeyPair(batch, dialog);
344 }
345 
352 void ConfigDialog::setProfiles(QHash<QString, QString> profiles,
353  QString profile) {
354  // dbg()<< profiles;
355  if (profiles.contains("")) {
356  profiles.remove("");
357  // remove weird "" key value pairs
358  }
359 
360  ui->profileTable->setRowCount(profiles.count());
361  QHashIterator<QString, QString> i(profiles);
362  int n = 0;
363  while (i.hasNext()) {
364  i.next();
365  if (!i.value().isEmpty() && !i.key().isEmpty()) {
366  ui->profileTable->setItem(n, 0, new QTableWidgetItem(i.key()));
367  ui->profileTable->setItem(n, 1, new QTableWidgetItem(i.value()));
368  // dbg()<< "naam:" + i.key();
369  if (i.key() == profile)
370  ui->profileTable->selectRow(n);
371  }
372  ++n;
373  }
374 }
375 
380 QHash<QString, QString> ConfigDialog::getProfiles() {
381  QHash<QString, QString> profiles;
382  // Check?
383  for (int i = 0; i < ui->profileTable->rowCount(); ++i) {
384  QTableWidgetItem *pathItem = ui->profileTable->item(i, 1);
385  if (0 != pathItem) {
386  QTableWidgetItem *item = ui->profileTable->item(i, 0);
387  if (item == 0) {
388  dbg() << "empty name, should fix in frontend";
389  continue;
390  }
391  profiles.insert(item->text(), pathItem->text());
392  }
393  }
394  return profiles;
395 }
396 
400 void ConfigDialog::on_addButton_clicked() {
401  int n = ui->profileTable->rowCount();
402  ui->profileTable->insertRow(n);
403  ui->profileTable->setItem(n, 1, new QTableWidgetItem(ui->storePath->text()));
404  ui->profileTable->selectRow(n);
405  ui->deleteButton->setEnabled(true);
406 }
407 
411 void ConfigDialog::on_deleteButton_clicked() {
412  QSet<int> selectedRows; // we use a set to prevent doubles
413  QList<QTableWidgetItem *> itemList = ui->profileTable->selectedItems();
414  if (itemList.count() == 0) {
415  QMessageBox::warning(this, tr("No profile selected"),
416  tr("No profile selected to delete"));
417  return;
418  }
419  QTableWidgetItem *item;
420  foreach (item, itemList)
421  selectedRows.insert(item->row());
422  // get a list, and sort it big to small
423  QList<int> rows = selectedRows.toList();
424  qSort(rows.begin(), rows.end());
425  // now actually do the removing:
426  foreach (int row, rows)
427  ui->profileTable->removeRow(row);
428  if (ui->profileTable->rowCount() < 1)
429  ui->deleteButton->setEnabled(false);
430 }
431 
438 void ConfigDialog::criticalMessage(const QString &title, const QString &text) {
439  QMessageBox::critical(this, title, text, QMessageBox::Ok, QMessageBox::Ok);
440 }
441 
447  // mainWindow->checkConfig();
448  bool clean = false;
449 
450  QString gpg = ui->gpgPath->text();
451  // QString gpg = mainWindow->getGpgExecutable();
452  if (!QFile(gpg).exists()) {
453  criticalMessage(
454  tr("GnuPG not found"),
455  tr("Please install GnuPG on your system.<br>Install "
456  "<strong>gpg</strong> using your favorite package manager<br>or <a "
457  "href=\"https://www.gnupg.org/download/#sec-1-2\">download</a> it "
458  "from GnuPG.org"));
459  clean = true;
460  }
461 
462  QStringList names = mainWindow->getSecretKeys();
463  dbg() << names;
464  if (QFile(gpg).exists() && names.empty()) {
465  KeygenDialog d(this);
466  if (!d.exec())
467  return;
468  }
469 
470  QString passStore = ui->storePath->text();
471 
472  if (!QFile(passStore).exists()) {
473  // TODO(annejan) pass version?
474  if (QMessageBox::question(
475  this, tr("Create password-store?"),
476  tr("Would you like to create a password-store at %1?")
477  .arg(passStore),
478  QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
479  QDir().mkdir(passStore);
480 #ifdef Q_OS_WIN
481  SetFileAttributes(passStore.toStdWString().c_str(),
482  FILE_ATTRIBUTE_HIDDEN);
483 #endif
484  if (ui->checkBoxUseGit->isChecked())
485  mainWindow->executePassGitInit();
486  mainWindow->userDialog(passStore);
487  }
488  }
489 
490  if (!QFile(QDir(passStore).filePath(".gpg-id")).exists()) {
491  dbg() << ".gpg-id file does not exist";
492 
493  if (!clean) {
494  criticalMessage(tr("Password store not initialised"),
495  tr("The folder %1 doesn't seem to be a password store or "
496  "is not yet initialised.")
497  .arg(passStore));
498  }
499  while (!QFile(passStore).exists()) {
500  on_toolButtonStore_clicked();
501  // allow user to cancel
502  if (passStore == ui->storePath->text())
503  return;
504  passStore = ui->storePath->text();
505  }
506  if (!QFile(passStore + ".gpg-id").exists()) {
507  dbg() << ".gpg-id file still does not exist :/";
508  // appears not to be store
509  // init yes / no ?
510  mainWindow->userDialog(passStore);
511  }
512  }
513 }
514 
521  return ui->checkBoxHideOnClose->isEnabled() &&
522  ui->checkBoxHideOnClose->isChecked();
523 }
524 
530 void ConfigDialog::useTrayIcon(bool useSystray) {
531  ui->checkBoxUseTrayIcon->setChecked(useSystray);
532  ui->checkBoxHideOnClose->setEnabled(useSystray);
533  ui->checkBoxStartMinimized->setEnabled(useSystray);
534  if (!useSystray) {
535  ui->checkBoxHideOnClose->setChecked(false);
536  ui->checkBoxStartMinimized->setChecked(false);
537  }
538 }
539 
544 void ConfigDialog::on_checkBoxUseTrayIcon_clicked() {
545  bool state = ui->checkBoxUseTrayIcon->isChecked();
546  ui->checkBoxHideOnClose->setEnabled(state);
547  ui->checkBoxStartMinimized->setEnabled(state);
548 }
549 
554 void ConfigDialog::closeEvent(QCloseEvent *event) {
555  // TODO(annejan) save window size or something?
556  event->accept();
557 }
558 
563 void ConfigDialog::useGit(bool useGit) {
564  ui->checkBoxUseGit->setChecked(useGit);
565  on_checkBoxUseGit_clicked();
566 }
567 
572 void ConfigDialog::useOtp(bool useOtp) {
573  ui->checkBoxUseOtp->setChecked(useOtp);
574 }
575 
580 void ConfigDialog::on_checkBoxUseGit_clicked() {
581  ui->checkBoxAddGPGId->setEnabled(ui->checkBoxUseGit->isChecked());
582  ui->checkBoxAutoPull->setEnabled(ui->checkBoxUseGit->isChecked());
583  ui->checkBoxAutoPush->setEnabled(ui->checkBoxUseGit->isChecked());
584 }
585 
590 void ConfigDialog::on_toolButtonPwgen_clicked() {
591  QString pwgen = selectExecutable();
592  if (!pwgen.isEmpty()) {
593  ui->pwgenPath->setText(pwgen);
594  ui->checkBoxUsePwgen->setEnabled(true);
595  } else {
596  ui->checkBoxUsePwgen->setEnabled(false);
597  ui->checkBoxUsePwgen->setChecked(false);
598  }
599 }
600 
606 void ConfigDialog::setPwgenPath(QString pwgen) {
607  ui->pwgenPath->setText(pwgen);
608  if (pwgen.isEmpty()) {
609  ui->checkBoxUsePwgen->setChecked(false);
610  ui->checkBoxUsePwgen->setEnabled(false);
611  }
612  on_checkBoxUsePwgen_clicked();
613 }
614 
619 void ConfigDialog::on_checkBoxUsePwgen_clicked() {
620  bool usePwgen = ui->checkBoxUsePwgen->isChecked();
621  ui->checkBoxAvoidCapitals->setEnabled(usePwgen);
622  ui->checkBoxAvoidNumbers->setEnabled(usePwgen);
623  ui->checkBoxLessRandom->setEnabled(usePwgen);
624  ui->checkBoxUseSymbols->setEnabled(usePwgen);
625  ui->lineEditPasswordChars->setEnabled(!usePwgen);
626  ui->labelPasswordChars->setEnabled(!usePwgen);
627  ui->passwordCharTemplateSelector->setEnabled(!usePwgen);
628 }
629 
637 void ConfigDialog::usePwgen(bool usePwgen) {
638  if (ui->pwgenPath->text().isEmpty())
639  usePwgen = false;
640  ui->checkBoxUsePwgen->setChecked(usePwgen);
641  on_checkBoxUsePwgen_clicked();
642 }
643 
645  const PasswordConfiguration &config) {
646  ui->spinBoxPasswordLength->setValue(config.length);
647  ui->passwordCharTemplateSelector->setCurrentIndex(config.selected);
649  ui->lineEditPasswordChars->setEnabled(false);
650  ui->lineEditPasswordChars->setText(config.Characters[config.selected]);
651 }
652 
654  PasswordConfiguration config;
655  config.length = ui->spinBoxPasswordLength->value();
656  config.selected = static_cast<PasswordConfiguration::characterSet>(
657  ui->passwordCharTemplateSelector->currentIndex());
659  ui->lineEditPasswordChars->text();
660  return config;
661 }
662 
669 void ConfigDialog::on_passwordCharTemplateSelector_activated(int index) {
670  ui->lineEditPasswordChars->setText(
671  QtPassSettings::getPasswordConfiguration().Characters[index]);
672  if (index == 3) {
673  ui->lineEditPasswordChars->setEnabled(true);
674  } else {
675  ui->lineEditPasswordChars->setEnabled(false);
676  }
677 }
678 
683 void ConfigDialog::on_checkBoxUseTemplate_clicked() {
684  ui->plainTextEditTemplate->setEnabled(ui->checkBoxUseTemplate->isChecked());
685  ui->checkBoxTemplateAllFields->setEnabled(
686  ui->checkBoxUseTemplate->isChecked());
687 }
688 
693 void ConfigDialog::useTemplate(bool useTemplate) {
694  ui->checkBoxUseTemplate->setChecked(useTemplate);
695  on_checkBoxUseTemplate_clicked();
696 }
static void setPwgenExecutable(const QString &pwgenExecutable)
static void setAutoclearSeconds(const int &autoClearSeconds)
QHash< QString, QString > getProfiles()
ConfigDialog::getProfiles return profile list.
static int getAutoclearSeconds(const int &defaultValue=QVariant().toInt())
static void setUsePwgen(const bool &usePwgen)
static bool isStartMinimized(const bool &defaultValue=QVariant().toBool())
void setPasswordConfiguration(const PasswordConfiguration &config)
~ConfigDialog()
ConfigDialog::~ConfigDialog config destructor, makes sure the mainWindow knows about git...
static void setUsePass(const bool &usePass)
static bool isLessRandom(const bool &defaultValue=QVariant().toBool())
static void setPassExecutable(const QString &passExecutable)
bool hideOnClose()
ConfigDialog::hideOnClose return preference for hiding instead of closing (quitting) application...
int length
Length of the password.
void useOtp(bool useOtp)
ConfigDialog::useOtp set preference for using otp plugin.
#define dbg()
Definition: debughelper.h:7
static bool isAlwaysOnTop(const bool &defaultValue=QVariant().toBool())
Holds the Password configuration settings.
Definition: configdialog.h:9
static void setAutoPush(const bool &autoPush)
static void setGitExecutable(const QString &gitExecutable)
static void setAlwaysOnTop(const bool &alwaysOnTop)
static bool isUseSelection(const bool &defaultValue=QVariant().toBool())
Handles GPG keypair generation.
Definition: keygendialog.h:16
static void setPassTemplate(const QString &passTemplate)
ConfigDialog(MainWindow *parent)
ConfigDialog::ConfigDialog this sets up the configuration screen.
static void setUseGit(const bool &useGit)
static bool isAvoidNumbers(const bool &defaultValue=QVariant().toBool())
void useGit(bool useGit)
ConfigDialog::useGit set preference for using git.
static void setPasswordConfiguration(const PasswordConfiguration &config)
static void setHideContent(const bool &hideContent)
static bool isUseAutoclearPanel(const bool &defaultValue=QVariant().toBool())
static void setLessRandom(const bool &lessRandom)
static void setAutoPull(const bool &autoPull)
static bool isAddGPGId(const bool &defaultValue=QVariant().toBool())
static bool isUseAutoclear(const bool &defaultValue=QVariant().toBool())
static bool isHideOnClose(const bool &defaultValue=QVariant().toBool())
static void setProfiles(const QHash< QString, QString > &profiles)
static bool isUseGit(const bool &defaultValue=QVariant().toBool())
void useAutoclearPanel(bool useAutoclearPanel)
ConfigDialog::useAutoclearPanel set the panel autoclear use from MainWindow.
static QString getPassStore(const QString &defaultValue=QVariant().toString())
void userDialog(QString="")
MainWindow::userDialog see MainWindow::onUsers()
Definition: mainwindow.cpp:958
void useAutoclear(bool useAutoclear)
ConfigDialog::useAutoclear set the clipboard autoclear use from MainWindow.
static QString getGitExecutable(const QString &defaultValue=QVariant().toString())
enum PasswordConfiguration::characterSet selected
static void setAutoclearPanelSeconds(const int &autoClearPanelSeconds)
void genKey(QString, QDialog *)
ConfigDialog::genKey tunnel function to make MainWindow generate a gpg key pair.
static void setUseAutoclearPanel(const bool &useAutoclearPanel)
void wizard()
ConfigDialog::wizard first-time use wizard.
static bool isUseTrayIcon(const bool &defaultValue=QVariant().toBool())
static bool isUseOtp(const bool &defaultValue=QVariant().toBool())
static void setAvoidNumbers(const bool &avoidNumbers)
static QString getPassExecutable(const QString &defaultValue=QVariant().toString())
void executePassGitInit()
MainWindow::executePassGitInit git init wrapper.
Definition: mainwindow.cpp:525
static void setHideOnClose(const bool &hideOnClose)
static bool isAvoidCapitals(const bool &defaultValue=QVariant().toBool())
void closeEvent(QCloseEvent *event)
ConfigDialog::closeEvent close this window.
void usePwgen(bool usePwgen)
ConfigDialog::usePwgen set preference for using pwgen (can be overruled buy empty pwgenPath)...
static void setGpgExecutable(const QString &gpgExecutable)
void useSelection(bool useSelection)
ConfigDialog::useSelection set the clipboard type use from MainWindow.
static void setStartMinimized(const bool &startMinimized)
static bool isUsePwgen(const bool &defaultValue=QVariant().toBool())
static void setUseAutoclear(const bool &useAutoclear)
static QString getPassTemplate(const QString &defaultValue=QVariant().toString())
static QString getPwgenExecutable(const QString &defaultValue=QVariant().toString())
static void setUseOtp(const bool &useOtp)
static bool isUseSymbols(const bool &defaultValue=QVariant().toBool())
void useTemplate(bool useTemplate)
ConfigDialog::useTemplate set preference for using templates.
The ConfigDialog handles the configuration interface.
Definition: configdialog.h:23
static void setUseTemplate(const bool &useTemplate)
static int getAutoclearPanelSeconds(const int &defaultValue=QVariant().toInt())
static void setAddGPGId(const bool &addGPGId)
static QString getGpgExecutable(const QString &defaultValue=QVariant().toString())
static bool isUseTemplate(const bool &defaultValue=QVariant().toBool())
static bool isTemplateAllFields(const bool &defaultValue=QVariant().toBool())
static void setUseSymbols(const bool &useSymbols)
QStringList getSecretKeys()
MainWindow::getSecretKeys get list of secret/private keys.
QString Characters[CHARSETS_COUNT]
The different character sets.
static void setTemplateAllFields(const bool &templateAllFields)
static QHash< QString, QString > getProfiles()
static void setUseTrayIcon(const bool &useTrayIcon)
static PasswordConfiguration getPasswordConfiguration()
PasswordConfiguration getPasswordConfiguration()
static void setClipBoardType(const int &clipBoardType)
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
static bool isHidePassword(const bool &defaultValue=QVariant().toBool())
static bool isHideContent(const bool &defaultValue=QVariant().toBool())
static QString getProfile(const QString &defaultValue=QVariant().toString())
void setPwgenPath(QString)
ConfigDialog::setPwgenPath set pwgen executable path. Enable or disable related options in the interf...
static void setVersion(const QString &version)
static void setHidePassword(const bool &hidePassword)
static void setPassStore(const QString &passStore)
static void setUseSelection(const bool &useSelection)
void useTrayIcon(bool useTrayIdon)
ConfigDialog::useTrayIcon set preference for using trayicon. Enable or disable related checkboxes acc...
static bool isUsePass(const bool &defaultValue=QVariant().toBool())
static bool isAutoPull(const bool &defaultValue=QVariant().toBool())
static QString normalizeFolderPath(QString path)
Util::normalizeFolderPath let&#39;s always end folders with a QDir::separator()
Definition: util.cpp:64
characterSet
The selected character set.
static bool isAutoPush(const bool &defaultValue=QVariant().toBool())
static int getClipBoardTypeRaw(const Enums::clipBoardType &defaultvalue=Enums::CLIPBOARD_NEVER)
static void setAvoidCapitals(const bool &avoidCapitals)