From f18db0647160088422804cfa341857a8b0f1f518 Mon Sep 17 00:00:00 2001 From: Florian Geyer Date: Mon, 28 May 2012 00:09:54 +0200 Subject: [PATCH] Store remember last opened files setting. --- src/CMakeLists.txt | 1 + src/gui/SettingsWidget.cpp | 7 +++++++ src/gui/SettingsWidget.h | 3 +++ 3 files changed, 11 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 103e896a7..863b31a6d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -139,6 +139,7 @@ set(keepassx_FORMS gui/EditWidgetIcons.ui gui/MainWindow.ui gui/SearchWidget.ui + gui/SettingsWidgetGeneral.ui gui/SettingsWidgetSecurity.ui gui/WelcomeWidget.ui gui/entry/EditEntryWidgetAdvanced.ui diff --git a/src/gui/SettingsWidget.cpp b/src/gui/SettingsWidget.cpp index 0932bbdde..cd425d00e 100644 --- a/src/gui/SettingsWidget.cpp +++ b/src/gui/SettingsWidget.cpp @@ -16,6 +16,7 @@ */ #include "SettingsWidget.h" +#include "ui_SettingsWidgetGeneral.h" #include "ui_SettingsWidgetSecurity.h" #include "core/Config.h" @@ -23,11 +24,15 @@ SettingsWidget::SettingsWidget(QWidget* parent) : EditWidget(parent) , m_secWidget(new QWidget()) + , m_generalWidget(new QWidget()) , m_secUi(new Ui::SettingsWidgetSecurity()) + , m_generalUi(new Ui::SettingsWidgetGeneral()) { setHeadline(tr("Application Settings")); m_secUi->setupUi(m_secWidget); + m_generalUi->setupUi(m_generalWidget); + add(tr("General"), m_generalWidget); add(tr("Security"), m_secWidget); connect(this, SIGNAL(accepted()), SLOT(saveSettings())); @@ -43,6 +48,7 @@ SettingsWidget::~SettingsWidget() void SettingsWidget::loadSettings() { + m_generalUi->rememberLastDatabasesCheckBox->setChecked(config()->get("RememberLastDatabases").toBool()); m_secUi->clearClipboardCheckBox->setChecked(config()->get("security/clearclipboard").toBool()); m_secUi->clearClipboardSpinBox->setValue(config()->get("security/clearclipboardtimeout").toInt()); @@ -51,6 +57,7 @@ void SettingsWidget::loadSettings() void SettingsWidget::saveSettings() { + config()->set("RememberLastDatabases", m_generalUi->rememberLastDatabasesCheckBox->isChecked()); config()->set("security/clearclipboard", m_secUi->clearClipboardCheckBox->isChecked()); config()->set("security/clearclipboardtimeout", m_secUi->clearClipboardSpinBox->value()); diff --git a/src/gui/SettingsWidget.h b/src/gui/SettingsWidget.h index 0e339c92f..5b3796ce9 100644 --- a/src/gui/SettingsWidget.h +++ b/src/gui/SettingsWidget.h @@ -21,6 +21,7 @@ #include "gui/EditWidget.h" namespace Ui { + class SettingsWidgetGeneral; class SettingsWidgetSecurity; } @@ -42,7 +43,9 @@ private Q_SLOTS: private: QWidget* const m_secWidget; + QWidget* const m_generalWidget; const QScopedPointer m_secUi; + const QScopedPointer m_generalUi; }; #endif // KEEPASSX_SETTINGSWIDGET_H