From 253a6aa024ed8911b430033962af9f238d766250 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 15 Mar 2022 11:12:08 +0100 Subject: [PATCH] MainWindow: remove connectionstatus dialog --- src/MainWindow.cpp | 43 +++---------------------------------------- src/MainWindow.h | 1 - 2 files changed, 3 insertions(+), 41 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 52f7b4a..9411468 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -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(); diff --git a/src/MainWindow.h b/src/MainWindow.h index 97612b8..3e2e3b8 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -153,7 +153,6 @@ private slots: // Dialogs void showWalletInfoDialog(); void showSeedDialog(); - void showConnectionStatusDialog(); void showPasswordDialog(); void showKeysDialog(); void showViewOnlyDialog();