mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-26 15:59:50 -05:00
Merge pull request #1124 from keepassxreboot/feature/hide_notes
Make notes hidden by default
This commit is contained in:
commit
cfe4299301
@ -163,6 +163,7 @@ void SettingsWidget::loadSettings()
|
||||
m_secUi->passwordCleartextCheckBox->setChecked(config()->get("security/passwordscleartext").toBool());
|
||||
m_secUi->passwordDetailsCleartextCheckBox->setChecked(config()->get("security/hidepassworddetails").toBool());
|
||||
m_secUi->passwordRepeatCheckBox->setChecked(config()->get("security/passwordsrepeat").toBool());
|
||||
m_secUi->hideNotesCheckBox->setChecked(config()->get("security/hidenotes").toBool());
|
||||
|
||||
|
||||
for (const ExtraPage& page: asConst(m_extraPages)) {
|
||||
@ -231,6 +232,7 @@ void SettingsWidget::saveSettings()
|
||||
config()->set("security/passwordscleartext", m_secUi->passwordCleartextCheckBox->isChecked());
|
||||
config()->set("security/hidepassworddetails", m_secUi->passwordDetailsCleartextCheckBox->isChecked());
|
||||
config()->set("security/passwordsrepeat", m_secUi->passwordRepeatCheckBox->isChecked());
|
||||
config()->set("security/hidenotes", m_secUi->hideNotesCheckBox->isChecked());
|
||||
|
||||
// Security: clear storage if related settings are disabled
|
||||
if (!config()->get("RememberLastDatabases").toBool()) {
|
||||
|
@ -143,6 +143,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="hideNotesCheckBox">
|
||||
<property name="text">
|
||||
<string>Hide entry notes by default</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -99,6 +99,7 @@ void EditEntryWidget::setupMain()
|
||||
connect(m_mainUi->togglePasswordButton, SIGNAL(toggled(bool)), m_mainUi->passwordEdit, SLOT(setShowPassword(bool)));
|
||||
connect(m_mainUi->togglePasswordGeneratorButton, SIGNAL(toggled(bool)), SLOT(togglePasswordGeneratorButton(bool)));
|
||||
connect(m_mainUi->expireCheck, SIGNAL(toggled(bool)), m_mainUi->expireDatePicker, SLOT(setEnabled(bool)));
|
||||
connect(m_mainUi->notesEnabled, SIGNAL(toggled(bool)), this, SLOT(toggleHideNotes(bool)));
|
||||
m_mainUi->passwordRepeatEdit->enableVerifyMode(m_mainUi->passwordEdit);
|
||||
connect(m_mainUi->passwordGenerator, SIGNAL(appliedPassword(QString)), SLOT(setGeneratedPassword(QString)));
|
||||
|
||||
@ -261,6 +262,12 @@ void EditEntryWidget::updateAttachmentButtonsEnabled(const QModelIndex& current)
|
||||
m_advancedUi->removeAttachmentButton->setEnabled(enable && !m_history);
|
||||
}
|
||||
|
||||
void EditEntryWidget::toggleHideNotes(bool visible)
|
||||
{
|
||||
m_mainUi->notesEdit->setVisible(visible);
|
||||
m_mainUi->notesHint->setVisible(!visible);
|
||||
}
|
||||
|
||||
QString EditEntryWidget::entryTitle() const
|
||||
{
|
||||
if (m_entry) {
|
||||
@ -308,7 +315,10 @@ void EditEntryWidget::setForms(const Entry* entry, bool restore)
|
||||
m_mainUi->passwordRepeatEdit->setReadOnly(m_history);
|
||||
m_mainUi->expireCheck->setEnabled(!m_history);
|
||||
m_mainUi->expireDatePicker->setReadOnly(m_history);
|
||||
m_mainUi->notesEnabled->setChecked(!config()->get("security/hidenotes").toBool());
|
||||
m_mainUi->notesEdit->setReadOnly(m_history);
|
||||
m_mainUi->notesEdit->setVisible(!config()->get("security/hidenotes").toBool());
|
||||
m_mainUi->notesHint->setVisible(config()->get("security/hidenotes").toBool());
|
||||
m_mainUi->togglePasswordGeneratorButton->setChecked(false);
|
||||
m_mainUi->togglePasswordGeneratorButton->setDisabled(m_history);
|
||||
m_mainUi->passwordGenerator->reset();
|
||||
|
@ -100,6 +100,7 @@ private slots:
|
||||
void updateHistoryButtons(const QModelIndex& current, const QModelIndex& previous);
|
||||
void useExpiryPreset(QAction* action);
|
||||
void updateAttachmentButtonsEnabled(const QModelIndex& current);
|
||||
void toggleHideNotes(bool visible);
|
||||
|
||||
private:
|
||||
void setupMain();
|
||||
|
@ -79,10 +79,10 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0" alignment="Qt::AlignRight|Qt::AlignTop">
|
||||
<widget class="QLabel" name="notesLabel">
|
||||
<item row="9" column="0" alignment="Qt::AlignLeft|Qt::AlignTop">
|
||||
<widget class="QCheckBox" name="notesEnabled">
|
||||
<property name="text">
|
||||
<string>Notes:</string>
|
||||
<string>Notes</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -127,6 +127,25 @@
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Monospace</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QLabel" name="notesHint">
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Toggle the checkbox to reveal the notes section.</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" alignment="Qt::AlignRight">
|
||||
|
Loading…
Reference in New Issue
Block a user