diff options
Diffstat (limited to 'src/ui/dialog/settings/SettingsGeneral.cpp')
-rw-r--r-- | src/ui/dialog/settings/SettingsGeneral.cpp | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/ui/dialog/settings/SettingsGeneral.cpp b/src/ui/dialog/settings/SettingsGeneral.cpp index 7e48b4e1..17d9251c 100644 --- a/src/ui/dialog/settings/SettingsGeneral.cpp +++ b/src/ui/dialog/settings/SettingsGeneral.cpp @@ -47,7 +47,7 @@ GeneralTab::GeneralTab(QWidget* parent) ui_->saveCheckedKeysCheckBox->setText( _("Save checked private keys on exit and restore them on next start.")); ui_->clearGpgPasswordCacheCheckBox->setText( - "Clear gpg password cache when closing GpgFrontend."); + _("Clear gpg password cache when closing GpgFrontend.")); ui_->importConfirmationBox->setTitle(_("Operation")); ui_->longerKeyExpirationDateCheckBox->setText( @@ -57,6 +57,8 @@ GeneralTab::GeneralTab(QWidget* parent) ui_->gnupgDatabaseBox->setTitle(_("GnuPG")); ui_->asciiModeCheckBox->setText(_("No ASCII Mode")); + ui_->usePinentryAsPasswordInputDialogCheckBox->setText( + _("Use Pinentry as Password Input Dialog")); ui_->useCustomGnuPGInstallPathCheckBox->setText(_("Use Custom GnuPG")); ui_->useCustomGnuPGInstallPathButton->setText(_("Select GnuPG Path")); ui_->keyDatabseUseCustomCheckBox->setText( @@ -167,6 +169,12 @@ GeneralTab::GeneralTab(QWidget* parent) } }); + connect(ui_->usePinentryAsPasswordInputDialogCheckBox, + &QCheckBox::stateChanged, this, [=](int state) { + // announce the restart + this->slot_gnupg_stettings_changed(); + }); + SetSettings(); } @@ -260,6 +268,16 @@ void GeneralTab::SetSettings() { SPDLOG_ERROR("setting operation error: use_custom_gnupg_install_path"); } + try { + bool use_pinentry_as_password_input_dialog = + settings.lookup("general.use_pinentry_as_password_input_dialog"); + if (use_pinentry_as_password_input_dialog) + ui_->usePinentryAsPasswordInputDialogCheckBox->setCheckState(Qt::Checked); + } catch (...) { + SPDLOG_ERROR( + "setting operation error: use_pinentry_as_password_input_dialog"); + } + this->slot_update_custom_gnupg_install_path_label( ui_->useCustomGnuPGInstallPathCheckBox->checkState()); } @@ -343,6 +361,15 @@ void GeneralTab::ApplySettings() { general["use_custom_gnupg_install_path"] = ui_->useCustomGnuPGInstallPathCheckBox->isChecked(); } + + if (!general.exists("use_pinentry_as_password_input_dialog")) + general.add("use_pinentry_as_password_input_dialog", + libconfig::Setting::TypeBoolean) = + ui_->usePinentryAsPasswordInputDialogCheckBox->isChecked(); + else { + general["use_pinentry_as_password_input_dialog"] = + ui_->usePinentryAsPasswordInputDialogCheckBox->isChecked(); + } } #ifdef MULTI_LANG_SUPPORT |