MainWindow: remove connectionstatus dialog

This commit is contained in:
tobtoht 2022-03-15 11:12:08 +01:00
parent 6eb0a05752
commit 253a6aa024
No known key found for this signature in database
GPG key ID: 1CADD27F41F45C3C
2 changed files with 3 additions and 41 deletions

View 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();

View file

@ -153,7 +153,6 @@ private slots:
// Dialogs
void showWalletInfoDialog();
void showSeedDialog();
void showConnectionStatusDialog();
void showPasswordDialog();
void showKeysDialog();
void showViewOnlyDialog();