aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/settings/SettingsGeneral.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/dialog/settings/SettingsGeneral.cpp')
-rw-r--r--src/ui/dialog/settings/SettingsGeneral.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/ui/dialog/settings/SettingsGeneral.cpp b/src/ui/dialog/settings/SettingsGeneral.cpp
index c967b8fd..719e5de8 100644
--- a/src/ui/dialog/settings/SettingsGeneral.cpp
+++ b/src/ui/dialog/settings/SettingsGeneral.cpp
@@ -48,6 +48,9 @@ GeneralTab::GeneralTab(QWidget* parent)
_("Save checked private keys on exit and restore them on next start."));
ui_->clearGpgPasswordCacheCheckBox->setText(
_("Clear gpg password cache when closing GpgFrontend."));
+ ui_->restoreTextEditorPageCheckBox->setText(
+ _("Automatically restore unsaved Text Editor pages after an application "
+ "crash."));
ui_->importConfirmationBox->setTitle(_("Operation"));
ui_->longerKeyExpirationDateCheckBox->setText(
@@ -98,6 +101,15 @@ void GeneralTab::SetSettings() {
}
try {
+ bool restore_text_editor_page =
+ settings.lookup("general.restore_text_editor_page");
+ if (restore_text_editor_page)
+ ui_->restoreTextEditorPageCheckBox->setCheckState(Qt::Checked);
+ } catch (...) {
+ SPDLOG_ERROR("setting operation error: restore_text_editor_page");
+ }
+
+ try {
bool longer_expiration_date =
settings.lookup("general.longer_expiration_date");
SPDLOG_DEBUG("longer_expiration_date: {}", longer_expiration_date);
@@ -170,6 +182,14 @@ void GeneralTab::ApplySettings() {
ui_->saveCheckedKeysCheckBox->isChecked();
}
+ if (!general.exists("restore_text_editor_page"))
+ general.add("restore_text_editor_page", libconfig::Setting::TypeBoolean) =
+ ui_->restoreTextEditorPageCheckBox->isChecked();
+ else {
+ general["restore_text_editor_page"] =
+ ui_->restoreTextEditorPageCheckBox->isChecked();
+ }
+
#ifdef MULTI_LANG_SUPPORT
if (!general.exists("lang"))
general.add("lang", libconfig::Setting::TypeBoolean) =