]> Nutra Git (v1) - gamesguru/feather.git/commitdiff
MainWindow: remove connectionstatus dialog
authortobtoht <thotbot@protonmail.com>
Tue, 15 Mar 2022 10:12:08 +0000 (11:12 +0100)
committertobtoht <thotbot@protonmail.com>
Tue, 15 Mar 2022 10:12:08 +0000 (11:12 +0100)
src/MainWindow.cpp
src/MainWindow.h

index 52f7b4ae6c4540c7dbb4f5121733d52457d4c8ae..941146894d7628b611aa5a413634bf4918b0024f 100644 (file)
@@ -130,7 +130,9 @@ void MainWindow::initStatusBar() {
     connect(m_statusLabelBalance, &ClickableLabel::clicked, this, &MainWindow::showBalanceDialog);
 
     m_statusBtnConnectionStatusIndicator = new StatusBarButton(icons()->icon("status_disconnected.svg"), "Connection status", this);
-    connect(m_statusBtnConnectionStatusIndicator, &StatusBarButton::clicked, this, &MainWindow::showConnectionStatusDialog);
+    connect(m_statusBtnConnectionStatusIndicator, &StatusBarButton::clicked, [this](){
+        this->onShowSettingsPage(2);
+    });
     this->statusBar()->addPermanentWidget(m_statusBtnConnectionStatusIndicator);
 
     m_statusAccountSwitcher = new StatusBarButton(icons()->icon("change_account.png"), "Account switcher", this);
@@ -749,45 +751,6 @@ void MainWindow::showSeedDialog() {
     dialog.exec();
 }
 
-void MainWindow::showConnectionStatusDialog() {
-    auto status = m_ctx->wallet->connectionStatus();
-    bool synchronized = m_ctx->wallet->isSynchronized();
-
-    QString statusMsg;
-    switch(status){
-        case Wallet::ConnectionStatus_Disconnected:
-            statusMsg = "Wallet is disconnected from node.";
-            break;
-        case Wallet::ConnectionStatus_Connecting: {
-            auto node = m_ctx->nodes->connection();
-            statusMsg = QString("Wallet is connecting to %1").arg(node.toAddress());
-            break;
-        }
-        case Wallet::ConnectionStatus_WrongVersion:
-            statusMsg = "Wallet is connected to incompatible node.";
-            break;
-        case Wallet::ConnectionStatus_Synchronizing:
-        case Wallet::ConnectionStatus_Synchronized: {
-            auto node = m_ctx->nodes->connection();
-            statusMsg = QString("Wallet is connected to %1 ").arg(node.toAddress());
-
-            if (synchronized) {
-                statusMsg += "and synchronized";
-            } else {
-                statusMsg += "and synchronizing";
-            }
-            break;
-        }
-        default:
-            statusMsg = "Unknown connection status (this should never happen).";
-    }
-
-    statusMsg += QString("\n\nTx: %1, Rx: %2").arg(Utils::formatBytes(m_ctx->wallet->getBytesSent()),
-                                                   Utils::formatBytes(m_ctx->wallet->getBytesReceived()));
-
-    QMessageBox::information(this, "Connection Status", statusMsg);
-}
-
 void MainWindow::showPasswordDialog() {
     PasswordChangeDialog dialog{this, m_ctx->wallet};
     dialog.exec();
index 97612b850586b102fc115b55ca2723d20cc9efba..3e2e3b82ad7de12806aaf4a455f43cc217341594 100644 (file)
@@ -153,7 +153,6 @@ private slots:
     // Dialogs
     void showWalletInfoDialog();
     void showSeedDialog();
-    void showConnectionStatusDialog();
     void showPasswordDialog();
     void showKeysDialog();
     void showViewOnlyDialog();