diff --git a/src/gui/DatabaseOpenWidget.cpp b/src/gui/DatabaseOpenWidget.cpp index 107304266..475d00c72 100644 --- a/src/gui/DatabaseOpenWidget.cpp +++ b/src/gui/DatabaseOpenWidget.cpp @@ -102,6 +102,10 @@ void DatabaseOpenWidget::showEvent(QShowEvent* event) { DialogyWidget::showEvent(event); m_ui->editPassword->setFocus(); + +#ifdef WITH_XC_YUBIKEY + pollYubikey(); +#endif } void DatabaseOpenWidget::load(const QString& filename) @@ -118,11 +122,6 @@ void DatabaseOpenWidget::load(const QString& filename) } } -#ifdef WITH_XC_YUBIKEY - m_ui->comboChallengeResponse->clear(); - pollYubikey(); -#endif - m_ui->editPassword->setFocus(); } @@ -229,7 +228,7 @@ CompositeKey DatabaseOpenWidget::databaseKey() void DatabaseOpenWidget::reject() { - Q_EMIT editFinished(false); + emit editFinished(false); } void DatabaseOpenWidget::activatePassword() diff --git a/src/gui/DatabaseOpenWidget.h b/src/gui/DatabaseOpenWidget.h index d02346055..975a530c4 100644 --- a/src/gui/DatabaseOpenWidget.h +++ b/src/gui/DatabaseOpenWidget.h @@ -41,18 +41,21 @@ public: void enterKey(const QString& pw, const QString& keyFile); Database* database(); -Q_SIGNALS: +public slots: + void pollYubikey(); + +signals: void editFinished(bool accepted); protected: void showEvent(QShowEvent* event) override; CompositeKey databaseKey(); -protected Q_SLOTS: +protected slots: virtual void openDatabase(); void reject(); -private Q_SLOTS: +private slots: void activatePassword(); void activateKeyFile(); void activateChallengeResponse(); @@ -60,10 +63,8 @@ private Q_SLOTS: void browseKeyFile(); void yubikeyDetected(int slot, bool blocking); void noYubikeyFound(); - void pollYubikey(); protected: - const QScopedPointer m_ui; Database* m_db; QString m_filename; diff --git a/src/gui/DatabaseOpenWidget.ui b/src/gui/DatabaseOpenWidget.ui index 7a97d0083..dba71d0fa 100644 --- a/src/gui/DatabaseOpenWidget.ui +++ b/src/gui/DatabaseOpenWidget.ui @@ -156,7 +156,7 @@ - false + true Refresh diff --git a/src/gui/DatabaseTabWidget.cpp b/src/gui/DatabaseTabWidget.cpp index 3a48098dd..734dc3f2e 100644 --- a/src/gui/DatabaseTabWidget.cpp +++ b/src/gui/DatabaseTabWidget.cpp @@ -53,7 +53,7 @@ const int DatabaseTabWidget::LastDatabasesCount = 5; DatabaseTabWidget::DatabaseTabWidget(QWidget* parent) : QTabWidget(parent) - , m_dbWidgetSateSync(new DatabaseWidgetStateSync(this)) + , m_dbWidgetStateSync(new DatabaseWidgetStateSync(this)) { DragTabBar* tabBar = new DragTabBar(this); setTabBar(tabBar); @@ -61,7 +61,7 @@ DatabaseTabWidget::DatabaseTabWidget(QWidget* parent) connect(this, SIGNAL(tabCloseRequested(int)), SLOT(closeDatabase(int))); connect(this, SIGNAL(currentChanged(int)), SLOT(emitActivateDatabaseChanged())); - connect(this, SIGNAL(activateDatabaseChanged(DatabaseWidget*)), m_dbWidgetSateSync, SLOT(setActive(DatabaseWidget*))); + connect(this, SIGNAL(activateDatabaseChanged(DatabaseWidget*)), m_dbWidgetStateSync, SLOT(setActive(DatabaseWidget*))); connect(autoType(), SIGNAL(globalShortcutTriggered()), SLOT(performGlobalAutoType())); } diff --git a/src/gui/DatabaseTabWidget.h b/src/gui/DatabaseTabWidget.h index 8f01a987d..6eabcd49c 100644 --- a/src/gui/DatabaseTabWidget.h +++ b/src/gui/DatabaseTabWidget.h @@ -116,7 +116,7 @@ private: KeePass2Writer m_writer; QHash m_dbList; - DatabaseWidgetStateSync* m_dbWidgetSateSync; + DatabaseWidgetStateSync* m_dbWidgetStateSync; }; #endif // KEEPASSX_DATABASETABWIDGET_H