]> Nutra Git (v2) - gamesguru/feather.git/commitdiff
ledger: show reconnect dialog if ledger is locked during sync
authortobtoht <tob@featherwallet.org>
Wed, 18 Dec 2024 23:37:01 +0000 (00:37 +0100)
committertobtoht <tob@featherwallet.org>
Wed, 18 Dec 2024 23:37:01 +0000 (00:37 +0100)
monero
src/MainWindow.cpp
src/MainWindow.h
src/WindowManager.cpp
src/WindowManager.h
src/libwalletqt/Wallet.h
src/libwalletqt/WalletListenerImpl.cpp
src/libwalletqt/WalletListenerImpl.h
src/libwalletqt/WalletManager.cpp
src/libwalletqt/WalletManager.h

diff --git a/monero b/monero
index 665c304735b68b2a6e55ed8a5efadbeb60056248..f10ad631fe7a35fc0c00e9706ae57b8d8eb8f30d 160000 (submodule)
--- a/monero
+++ b/monero
@@ -1 +1 @@
-Subproject commit 665c304735b68b2a6e55ed8a5efadbeb60056248
+Subproject commit f10ad631fe7a35fc0c00e9706ae57b8d8eb8f30d
index f852263ccbb3692338450a813d89876702450b64..4a54c72929c384465aa163b6aaa5d89fdbc0919e 100644 (file)
@@ -1431,7 +1431,7 @@ void MainWindow::importTransaction() {
     dialog.exec();
 }
 
-void MainWindow::onDeviceError(const QString &error) {
+void MainWindow::onDeviceError(const QString &error, quint64 errorCode) {
     qCritical() << "Device error: " << error;
 
     if (m_showDeviceError) {
@@ -1441,7 +1441,13 @@ void MainWindow::onDeviceError(const QString &error) {
     m_statusBtnHwDevice->setIcon(this->hardwareDeviceUnpairedIcon());
     while (true) {
         m_showDeviceError = true;
-        auto result = QMessageBox::question(this, "Hardware device", "Lost connection to hardware device. Attempt to reconnect?");
+
+        QString prompt = "Lost connection to hardware device. Attempt to reconnect?";
+        if (errorCode == 0x5515) {
+            prompt = QString("Device must be unlocked to continue scanning. Attempt to continue?");
+        }
+
+        auto result = QMessageBox::question(this, "Hardware device", prompt);
         if (result == QMessageBox::Yes) {
             bool r = m_wallet->reconnectDevice();
             if (r) {
index 84cbe410700e034a5037480693bc546e6c21e88e..9cdf2ecc3af8f3e1e03f2d6aa75d55217f39ba6e 100644 (file)
@@ -161,7 +161,7 @@ private slots:
     void onResendTransaction(const QString &txid);
     void importContacts();
     void importTransaction();
-    void onDeviceError(const QString &error);
+    void onDeviceError(const QString &error, quint64 errorCode);
     void onDeviceButtonRequest(quint64 code);
     void onDeviceButtonPressed();
     void onWalletPassphraseNeeded(bool on_device);
index 48b5de1f230f5e5552a9c32e6e54d09cb0ca5760..c94e55f92c8b0e37e0d2f2729a9c43031debc891 100644 (file)
@@ -608,7 +608,7 @@ void WindowManager::onDeviceButtonPressed() {
     m_splashDialog->hide();
 }
 
-void WindowManager::onDeviceError(const QString &errorMessage) {
+void WindowManager::onDeviceError(const QString &errorMessage, quint64 errorCode) {
     // TODO: when does this get called?
     qCritical() << Q_FUNC_INFO << errorMessage;
 }
index a694ef791162d50a949682ae7c76ecdb9cd877c1..d6a5553fa83c5853d2432b8fd00aab07c7656895 100644 (file)
@@ -68,7 +68,7 @@ private slots:
     void onInitialNetworkConfigured();
     void onDeviceButtonRequest(quint64 code);
     void onDeviceButtonPressed();
-    void onDeviceError(const QString &errorMessage);
+    void onDeviceError(const QString &errorMessage, quint64 errorCode);
     void onWalletPassphraseNeeded(bool on_device);
     void onChangeTheme(const QString &themeName);
 
index 8d647606a0733fdb53a134d0ff4254e944fb29e6..0282e00481b963b92b697b28b2d4a5e6c6210eb6 100644 (file)
@@ -441,7 +441,7 @@ signals:
     void walletCreationHeightChanged();
     void deviceButtonRequest(quint64 buttonCode);
     void deviceButtonPressed();
-    void deviceError(const QString &message);
+    void deviceError(const QString &message, quint64 errorCode);
     void walletPassphraseNeeded(bool onDevice);
     void beginCommitTransaction();
     void transactionCommitted(bool status, PendingTransaction *t, const QStringList& txid, const QMap<QString, QString> &txHexMap);
index ff32efb40c6017e03d952fe8066336702b0621ae..b6e0b43017b0d312ee5d4f5d3ac1fdddf50d429a 100644 (file)
@@ -73,10 +73,10 @@ void WalletListenerImpl::onDeviceButtonPressed()
     emit m_wallet->deviceButtonPressed();
 }
 
-void WalletListenerImpl::onDeviceError(const std::string &message)
+void WalletListenerImpl::onDeviceError(const std::string &message, unsigned int error_code)
 {
     qDebug() << __FUNCTION__;
-    emit m_wallet->deviceError(QString::fromStdString(message));
+    emit m_wallet->deviceError(QString::fromStdString(message), error_code);
 }
 
 void WalletListenerImpl::onPassphraseEntered(const QString &passphrase, bool enter_on_device, bool entry_abort)
index a2a60ef190229ee1c3d19587bced672bbd01f789..8050620788341383711238a73778de6ce8bd43ad 100644 (file)
@@ -31,7 +31,7 @@ public:
 
     virtual void onDeviceButtonPressed() override;
 
-    virtual void onDeviceError(const std::string &message) override;
+    virtual void onDeviceError(const std::string &message, unsigned int error_code) override;
 
     virtual void onPassphraseEntered(const QString &passphrase, bool enter_on_device, bool entry_abort) override;
 
index c88f014848483282d49923a19fdfe1e8298054ff..51a5e13e5f8958bb21026330fef10cb23e00cc34 100644 (file)
@@ -43,10 +43,10 @@ public:
         emit m_mgr->deviceButtonPressed();
     }
 
-    void onDeviceError(const std::string &message) override
+    void onDeviceError(const std::string &message, unsigned int error_code) override
     {
         qDebug() << __FUNCTION__;
-        emit m_mgr->deviceError(QString::fromStdString(message));
+        emit m_mgr->deviceError(QString::fromStdString(message), error_code);
     }
 
 private:
index 2a43cfc3863ac4c9d71fcbecfc004d250aa81c6f..1064cf75d89b8c600a5da4f8f8058deb9ca8702f 100644 (file)
@@ -121,7 +121,7 @@ signals:
     void walletPassphraseNeeded(bool onDevice);
     void deviceButtonRequest(quint64 buttonCode);
     void deviceButtonPressed();
-    void deviceError(const QString &message);
+    void deviceError(const QString &message, quint64 errorCode);
     void openAliasResolved(const QString &alias, const QString &address, bool dnssecValid);
 
 private: