From f2a72c342e53340c7f3b67759411acc140dd8012 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Wed, 7 Jul 2021 04:38:15 +0200 Subject: [PATCH] Trezor: fix splashdialog hide on pin cancel --- src/WindowManager.cpp | 5 +++++ src/WindowManager.h | 1 + src/libwalletqt/WalletManager.cpp | 10 +++++----- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/WindowManager.cpp b/src/WindowManager.cpp index 8ca729e..89853d7 100644 --- a/src/WindowManager.cpp +++ b/src/WindowManager.cpp @@ -22,6 +22,7 @@ WindowManager::WindowManager() { connect(m_walletManager, &WalletManager::walletOpened, this, &WindowManager::onWalletOpened); connect(m_walletManager, &WalletManager::walletCreated, this, &WindowManager::onWalletCreated); connect(m_walletManager, &WalletManager::deviceButtonRequest, this, &WindowManager::onDeviceButtonRequest); + connect(m_walletManager, &WalletManager::deviceButtonPressed, this, &WindowManager::onDeviceButtonPressed); connect(m_walletManager, &WalletManager::deviceError, this, &WindowManager::onDeviceError); connect(qApp, &QGuiApplication::lastWindowClosed, this, &WindowManager::quitAfterLastWindow); @@ -374,6 +375,10 @@ void WindowManager::onDeviceButtonRequest(quint64 code) { m_splashDialog->setEnabled(true); } +void WindowManager::onDeviceButtonPressed() { + m_splashDialog->hide(); +} + void WindowManager::onDeviceError(const QString &errorMessage) { // TODO: when does this get called? qCritical() << Q_FUNC_INFO << errorMessage; diff --git a/src/WindowManager.h b/src/WindowManager.h index c82c81b..1bf852f 100644 --- a/src/WindowManager.h +++ b/src/WindowManager.h @@ -39,6 +39,7 @@ private slots: void onWalletOpenPasswordRequired(bool invalidPassword, const QString &path); void onInitialNetworkConfigured(); void onDeviceButtonRequest(quint64 code); + void onDeviceButtonPressed(); void onDeviceError(const QString &errorMessage); private: diff --git a/src/libwalletqt/WalletManager.cpp b/src/libwalletqt/WalletManager.cpp index aab885f..fbecd33 100644 --- a/src/libwalletqt/WalletManager.cpp +++ b/src/libwalletqt/WalletManager.cpp @@ -36,11 +36,11 @@ public: emit m_mgr->deviceButtonRequest(code); } // -// virtual void onDeviceButtonPressed() override -// { -// qDebug() << __FUNCTION__; -// emit m_mgr->deviceButtonPressed(); -// } + virtual void onDeviceButtonPressed() override + { + qDebug() << __FUNCTION__; + emit m_mgr->deviceButtonPressed(); + } virtual void onDeviceError(const std::string &message) override {