Open TOTP setup dialog if entry has no valid TOTP set (#12584)

---------

Co-authored-by: x <a@b.c>
Co-authored-by: Jonathan White <support@dmapps.us>
This commit is contained in:
Xì Gà
2025-10-27 04:46:51 +09:00
committed by GitHub
parent 61fdb85a3c
commit c016e8af9b
2 changed files with 8 additions and 1 deletions

View File

@@ -555,6 +555,13 @@ void DatabaseWidget::copyTotp()
if (!currentEntry) {
return;
}
// If the entry has no TOTP set, open the setup dialog first
if (!currentEntry->hasValidTotp()) {
setupTotp();
return;
}
setClipboardTextAndMinimize(currentEntry->totp());
}

View File

@@ -1000,7 +1000,7 @@ void MainWindow::updateMenuActionState()
m_ui->actionEntryAutoTypeTOTP->setVisible(singleEntrySelected && dbWidget->currentEntryHasTotp());
m_ui->actionEntryOpenUrl->setEnabled(singleEntryOrEditing && dbWidget->currentEntryHasUrl());
m_ui->actionEntryTotp->setEnabled(singleEntrySelected && dbWidget->currentEntryHasTotp());
m_ui->actionEntryCopyTotp->setEnabled(singleEntrySelected && dbWidget->currentEntryHasTotp());
m_ui->actionEntryCopyTotp->setEnabled(singleEntrySelected);
m_ui->actionEntryCopyPasswordTotp->setEnabled(singleEntrySelected && dbWidget->currentEntryHasTotp());
m_ui->actionEntrySetupTotp->setEnabled(singleEntrySelected);
m_ui->actionEntryTotpQRCode->setEnabled(singleEntrySelected && dbWidget->currentEntryHasTotp());