From 8c7cc90363d443506d72ff9ab18b63aebd9f64c7 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Sat, 21 Jun 2025 08:40:23 -0400 Subject: [PATCH] Fix TOTP visibility on unlock and setting change Also fix invalid key message being visible when adding new TOTP secret to an entry. --- src/gui/EntryPreviewWidget.cpp | 3 +++ src/gui/TotpSetupDialog.cpp | 1 + 2 files changed, 4 insertions(+) diff --git a/src/gui/EntryPreviewWidget.cpp b/src/gui/EntryPreviewWidget.cpp index d61d4ca06..02ab3622f 100644 --- a/src/gui/EntryPreviewWidget.cpp +++ b/src/gui/EntryPreviewWidget.cpp @@ -94,6 +94,8 @@ EntryPreviewWidget::EntryPreviewWidget(QWidget* parent) connect(config(), &Config::changed, this, [this](Config::ConfigKey key) { if (key == Config::GUI_HidePreviewPanel) { setVisible(!config()->get(Config::GUI_HidePreviewPanel).toBool()); + } else if (key == Config::Security_HideTotpPreviewPanel) { + m_ui->entryTotpButton->setChecked(!config()->get(Config::Security_HideTotpPreviewPanel).toBool()); } refresh(); }); @@ -258,6 +260,7 @@ void EntryPreviewWidget::updateEntryTotp() m_totpTimer.start(1000); m_ui->entryTotpProgress->setMaximum(m_currentEntry->totpSettings()->step); updateTotpLabel(); + m_ui->entryTotp->setVisible(m_ui->entryTotpButton->isChecked()); } else { m_ui->entryTotp->hide(); m_ui->entryTotpButton->setChecked(false); diff --git a/src/gui/TotpSetupDialog.cpp b/src/gui/TotpSetupDialog.cpp index 27bad9782..e7e0bd749 100644 --- a/src/gui/TotpSetupDialog.cpp +++ b/src/gui/TotpSetupDialog.cpp @@ -108,6 +108,7 @@ void TotpSetupDialog::init() m_ui->algorithmComboBox->addItem(item.first, item.second); } m_ui->algorithmComboBox->setCurrentIndex(0); + m_ui->invalidKeyLabel->setVisible(false); // Read entry totp settings auto settings = m_entry->totpSettings();