Add an option to show passwords by default.

Closes #93
This commit is contained in:
Felix Geyer 2014-01-12 17:23:47 +01:00
parent 223c5a1651
commit 29c997e1bc
4 changed files with 13 additions and 1 deletions

View File

@ -98,6 +98,7 @@ void Config::init(const QString& fileName)
m_defaults.insert("security/clearclipboardtimeout", 10); m_defaults.insert("security/clearclipboardtimeout", 10);
m_defaults.insert("security/lockdatabaseidle", false); m_defaults.insert("security/lockdatabaseidle", false);
m_defaults.insert("security/lockdatabaseidlesec", 10); m_defaults.insert("security/lockdatabaseidlesec", 10);
m_defaults.insert("security/passwordscleartext", false);
} }
Config* Config::instance() Config* Config::instance()

View File

@ -79,6 +79,8 @@ void SettingsWidget::loadSettings()
m_secUi->lockDatabaseIdleCheckBox->setChecked(config()->get("security/lockdatabaseidle").toBool()); m_secUi->lockDatabaseIdleCheckBox->setChecked(config()->get("security/lockdatabaseidle").toBool());
m_secUi->lockDatabaseIdleSpinBox->setValue(config()->get("security/lockdatabaseidlesec").toInt()); m_secUi->lockDatabaseIdleSpinBox->setValue(config()->get("security/lockdatabaseidlesec").toInt());
m_secUi->passwordCleartextCheckBox->setChecked(config()->get("security/passwordscleartext").toBool());
setCurrentRow(0); setCurrentRow(0);
} }
@ -100,6 +102,8 @@ void SettingsWidget::saveSettings()
config()->set("security/lockdatabaseidle", m_secUi->lockDatabaseIdleCheckBox->isChecked()); config()->set("security/lockdatabaseidle", m_secUi->lockDatabaseIdleCheckBox->isChecked());
config()->set("security/lockdatabaseidlesec", m_secUi->lockDatabaseIdleSpinBox->value()); config()->set("security/lockdatabaseidlesec", m_secUi->lockDatabaseIdleSpinBox->value());
config()->set("security/passwordscleartext", m_secUi->passwordCleartextCheckBox->isChecked());
Q_EMIT editFinished(true); Q_EMIT editFinished(true);
} }

View File

@ -57,6 +57,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0">
<widget class="QCheckBox" name="passwordCleartextCheckBox">
<property name="text">
<string>Show passwords in cleartext by default</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<tabstops> <tabstops>

View File

@ -308,7 +308,7 @@ void EditEntryWidget::setForms(const Entry* entry, bool restore)
m_mainUi->expireCheck->setChecked(entry->timeInfo().expires()); m_mainUi->expireCheck->setChecked(entry->timeInfo().expires());
m_mainUi->expireDatePicker->setDateTime(entry->timeInfo().expiryTime().toLocalTime()); m_mainUi->expireDatePicker->setDateTime(entry->timeInfo().expiryTime().toLocalTime());
m_mainUi->expirePresets->setEnabled(!m_history); m_mainUi->expirePresets->setEnabled(!m_history);
m_mainUi->togglePasswordButton->setChecked(false); m_mainUi->togglePasswordButton->setChecked(config()->get("security/passwordscleartext").toBool());
m_mainUi->notesEdit->setPlainText(entry->notes()); m_mainUi->notesEdit->setPlainText(entry->notes());