Add settings option if visual changes mark databases as modified.

This commit is contained in:
Florian Geyer 2012-05-28 20:16:49 +02:00
parent 8aefb1ed82
commit 5003499700
4 changed files with 21 additions and 1 deletions

View File

@ -68,6 +68,7 @@ Config::Config()
m_settings.reset(new QSettings(userPath, QSettings::IniFormat));
m_defaults.insert("RememberLastDatabases", true);
m_defaults.insert("ModifiedOnVisualChanges", true);
m_defaults.insert("security/clearclipboard", true);
m_defaults.insert("security/clearclipboardtimeout", 10);
}

View File

@ -17,6 +17,7 @@
#include "Group.h"
#include "core/Config.h"
#include "core/DatabaseIcons.h"
#include "core/Metadata.h"
#include "core/Tools.h"
@ -225,7 +226,13 @@ void Group::setTimeInfo(const TimeInfo& timeInfo)
void Group::setExpanded(bool expanded)
{
set(m_isExpanded, expanded);
if (m_isExpanded != expanded) {
m_isExpanded = expanded;
updateTimeinfo();
if (config()->get("ModifiedOnVisualChanges").toBool()) {
Q_EMIT modified();
}
}
}
void Group::setDefaultAutoTypeSequence(const QString& sequence)

View File

@ -49,6 +49,7 @@ SettingsWidget::~SettingsWidget()
void SettingsWidget::loadSettings()
{
m_generalUi->rememberLastDatabasesCheckBox->setChecked(config()->get("RememberLastDatabases").toBool());
m_generalUi->modifiedOnVisualChangesCheckBox->setChecked(config()->get("ModifiedOnVisualChanges").toBool());
m_secUi->clearClipboardCheckBox->setChecked(config()->get("security/clearclipboard").toBool());
m_secUi->clearClipboardSpinBox->setValue(config()->get("security/clearclipboardtimeout").toInt());
@ -58,6 +59,7 @@ void SettingsWidget::loadSettings()
void SettingsWidget::saveSettings()
{
config()->set("RememberLastDatabases", m_generalUi->rememberLastDatabasesCheckBox->isChecked());
config()->set("ModifiedOnVisualChanges", m_generalUi->modifiedOnVisualChangesCheckBox->isChecked());
config()->set("security/clearclipboard", m_secUi->clearClipboardCheckBox->isChecked());
config()->set("security/clearclipboardtimeout", m_secUi->clearClipboardSpinBox->value());

View File

@ -13,6 +13,16 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="modifiedOnVisualChangesCheckBox">
<property name="text">
<string>Mark as modified on minor visual changes</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>