mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-24 05:31:11 -05:00
Add ability to hide a protected attribute after reveal
This commit is contained in:
parent
c0b1c9e106
commit
9363123047
@ -201,7 +201,7 @@ void EditEntryWidget::setupAdvanced()
|
||||
connect(m_advancedUi->editAttributeButton, SIGNAL(clicked()), SLOT(editCurrentAttribute()));
|
||||
connect(m_advancedUi->removeAttributeButton, SIGNAL(clicked()), SLOT(removeCurrentAttribute()));
|
||||
connect(m_advancedUi->protectAttributeButton, SIGNAL(toggled(bool)), SLOT(protectCurrentAttribute(bool)));
|
||||
connect(m_advancedUi->revealAttributeButton, SIGNAL(clicked(bool)), SLOT(revealCurrentAttribute()));
|
||||
connect(m_advancedUi->revealAttributeButton, SIGNAL(clicked(bool)), SLOT(toggleCurrentAttributeVisibility()));
|
||||
connect(m_advancedUi->attributesView->selectionModel(),
|
||||
SIGNAL(currentChanged(QModelIndex,QModelIndex)),
|
||||
SLOT(updateCurrentAttribute()));
|
||||
@ -1297,6 +1297,7 @@ void EditEntryWidget::displayAttribute(QModelIndex index, bool showProtected)
|
||||
// Block signals to prevent modified being set
|
||||
m_advancedUi->protectAttributeButton->blockSignals(true);
|
||||
m_advancedUi->attributesEdit->blockSignals(true);
|
||||
m_advancedUi->revealAttributeButton->setText(tr("Reveal"));
|
||||
|
||||
if (index.isValid()) {
|
||||
QString key = m_attributesModel->keyByIndex(index);
|
||||
@ -1348,7 +1349,7 @@ void EditEntryWidget::protectCurrentAttribute(bool state)
|
||||
}
|
||||
}
|
||||
|
||||
void EditEntryWidget::revealCurrentAttribute()
|
||||
void EditEntryWidget::toggleCurrentAttributeVisibility()
|
||||
{
|
||||
if (!m_advancedUi->attributesEdit->isEnabled()) {
|
||||
QModelIndex index = m_advancedUi->attributesView->currentIndex();
|
||||
@ -1359,6 +1360,10 @@ void EditEntryWidget::revealCurrentAttribute()
|
||||
m_advancedUi->attributesEdit->setEnabled(true);
|
||||
m_advancedUi->attributesEdit->blockSignals(oldBlockSignals);
|
||||
}
|
||||
m_advancedUi->revealAttributeButton->setText(tr("Hide"));
|
||||
} else {
|
||||
protectCurrentAttribute(true);
|
||||
m_advancedUi->revealAttributeButton->setText(tr("Reveal"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ private slots:
|
||||
void removeCurrentAttribute();
|
||||
void updateCurrentAttribute();
|
||||
void protectCurrentAttribute(bool state);
|
||||
void revealCurrentAttribute();
|
||||
void toggleCurrentAttributeVisibility();
|
||||
void updateAutoTypeEnabled();
|
||||
void openAutotypeHelp();
|
||||
void insertAutoTypeAssoc();
|
||||
|
Loading…
Reference in New Issue
Block a user