Fix closing modal dialogs on database lock

* Fixes #5719, Fixes #5744
This commit is contained in:
Jonathan White 2020-12-12 12:08:02 -05:00
parent 3b29f20d60
commit f0204dbb10
5 changed files with 12 additions and 16 deletions

View file

@ -31,10 +31,7 @@ TotpDialog::TotpDialog(QWidget* parent, Entry* entry)
, m_ui(new Ui::TotpDialog())
, m_entry(entry)
{
if (!m_entry->hasTotp()) {
close();
return;
}
setAttribute(Qt::WA_DeleteOnClose);
m_ui->setupUi(this);
@ -42,14 +39,11 @@ TotpDialog::TotpDialog(QWidget* parent, Entry* entry)
resetCounter();
updateProgressBar();
connect(parent, SIGNAL(databaseLocked()), SLOT(close()));
connect(&m_totpUpdateTimer, SIGNAL(timeout()), this, SLOT(updateProgressBar()));
connect(&m_totpUpdateTimer, SIGNAL(timeout()), this, SLOT(updateSeconds()));
m_totpUpdateTimer.start(m_step * 10);
updateTotp();
setAttribute(Qt::WA_DeleteOnClose);
new QShortcut(QKeySequence(QKeySequence::Copy), this, SLOT(copyToClipboard()));
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Copy"));