Add action item for removing a passkey from entry (#10777)

This commit is contained in:
Sami Vänttinen
2024-05-27 23:50:35 +03:00
committed by GitHub
parent 9aa040604a
commit 5de669eb7b
13 changed files with 94 additions and 11 deletions

View File

@@ -1428,6 +1428,22 @@ void DatabaseWidget::showImportPasskeyDialog(bool isEntry)
passkeyImporter.importPasskey(m_db);
}
}
void DatabaseWidget::removePasskeyFromEntry()
{
auto currentEntry = currentSelectedEntry();
if (!currentEntry) {
return;
}
auto result = MessageBox::question(this,
tr("Remove passkey from entry"),
tr("Do you want to remove the passkey from this entry?"),
MessageBox::Remove | MessageBox::Cancel);
if (result == MessageBox::Remove) {
currentEntry->removePasskey();
}
}
#endif
void DatabaseWidget::performUnlockDatabase(const QString& password, const QString& keyfile)
@@ -2020,6 +2036,14 @@ bool DatabaseWidget::currentEntryHasSshKey()
}
#endif
#ifdef WITH_XC_BROWSER_PASSKEYS
bool DatabaseWidget::currentEntryHasPasskey()
{
auto currentEntry = m_entryView->currentEntry();
return currentEntry && currentEntry->hasPasskey();
}
#endif
bool DatabaseWidget::currentEntryHasNotes()
{
auto currentEntry = currentSelectedEntry();