mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-09-19 23:56:10 +00:00
Display TOTP code split in halfs
This commit is contained in:
parent
4c9b8c7794
commit
d3ed14ebb7
@ -67,7 +67,7 @@ void TotpDialog::copyToClipboard()
|
|||||||
void TotpDialog::updateProgressBar()
|
void TotpDialog::updateProgressBar()
|
||||||
{
|
{
|
||||||
if (uCounter < 100) {
|
if (uCounter < 100) {
|
||||||
m_ui->progressBar->setValue(100 - uCounter);
|
m_ui->progressBar->setValue(static_cast<int>(100 - uCounter));
|
||||||
m_ui->progressBar->update();
|
m_ui->progressBar->update();
|
||||||
uCounter++;
|
uCounter++;
|
||||||
} else {
|
} else {
|
||||||
@ -85,7 +85,10 @@ void TotpDialog::updateSeconds()
|
|||||||
|
|
||||||
void TotpDialog::updateTotp()
|
void TotpDialog::updateTotp()
|
||||||
{
|
{
|
||||||
m_ui->totpLabel->setText(m_entry->totp());
|
QString totpCode = m_entry->totp();
|
||||||
|
QString firstHalf = totpCode.left(totpCode.size()/2);
|
||||||
|
QString secondHalf = totpCode.right(totpCode.size()/2);
|
||||||
|
m_ui->totpLabel->setText(firstHalf + " " + secondHalf);
|
||||||
}
|
}
|
||||||
|
|
||||||
double TotpDialog::resetCounter()
|
double TotpDialog::resetCounter()
|
||||||
|
@ -489,7 +489,7 @@ void TestGui::testTotp()
|
|||||||
TotpDialog* totpDialog = m_dbWidget->findChild<TotpDialog*>("TotpDialog");
|
TotpDialog* totpDialog = m_dbWidget->findChild<TotpDialog*>("TotpDialog");
|
||||||
QLabel* totpLabel = totpDialog->findChild<QLabel*>("totpLabel");
|
QLabel* totpLabel = totpDialog->findChild<QLabel*>("totpLabel");
|
||||||
|
|
||||||
QCOMPARE(totpLabel->text(), entry->totp());
|
QCOMPARE(totpLabel->text().replace(" ", ""), entry->totp());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestGui::testSearch()
|
void TestGui::testSearch()
|
||||||
|
Loading…
Reference in New Issue
Block a user