mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
gui: Clear YubiKeys detected on each load
* Clear the YubiKey detected list on each load. * In the event the YubiKey was removed, it will no longer be displayed. * If it's still present it won't be duplicated.
This commit is contained in:
parent
05774854ef
commit
f33cd15419
@ -64,6 +64,10 @@ DatabaseOpenWidget::DatabaseOpenWidget(QWidget* parent)
|
|||||||
|
|
||||||
connect(m_ui->buttonBox, SIGNAL(accepted()), SLOT(openDatabase()));
|
connect(m_ui->buttonBox, SIGNAL(accepted()), SLOT(openDatabase()));
|
||||||
connect(m_ui->buttonBox, SIGNAL(rejected()), SLOT(reject()));
|
connect(m_ui->buttonBox, SIGNAL(rejected()), SLOT(reject()));
|
||||||
|
|
||||||
|
connect(YubiKey::instance(), SIGNAL(detected(int,bool)),
|
||||||
|
SLOT(ykDetected(int,bool)),
|
||||||
|
Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
DatabaseOpenWidget::~DatabaseOpenWidget()
|
DatabaseOpenWidget::~DatabaseOpenWidget()
|
||||||
@ -92,10 +96,8 @@ void DatabaseOpenWidget::load(const QString& filename)
|
|||||||
|
|
||||||
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
|
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
|
||||||
|
|
||||||
/* YubiKey init is slow */
|
/* YubiKey init is slow, detect asynchronously to not block the UI */
|
||||||
connect(YubiKey::instance(), SIGNAL(detected(int,bool)),
|
m_ui->comboChallengeResponse->clear();
|
||||||
SLOT(ykDetected(int,bool)),
|
|
||||||
Qt::QueuedConnection);
|
|
||||||
QtConcurrent::run(YubiKey::instance(), &YubiKey::detect);
|
QtConcurrent::run(YubiKey::instance(), &YubiKey::detect);
|
||||||
|
|
||||||
m_ui->editPassword->setFocus();
|
m_ui->editPassword->setFocus();
|
||||||
|
Loading…
Reference in New Issue
Block a user