From f37b77fc49393ee3ee0f3a873e6a79cff329b5a1 Mon Sep 17 00:00:00 2001 From: gg Date: Tue, 13 Jan 2026 00:37:43 -0500 Subject: [PATCH] disable context menu conditioanlly; conceal sus $0.00 bal --- src/MainWindow.cpp | 15 +++++++++++++-- src/WindowManager.cpp | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 848c2cf3..018a0932 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -159,8 +159,13 @@ void MainWindow::initStatusBar() { m_statusLabelBalance->setText("Balance: 0 XMR"); m_statusLabelBalance->setTextInteractionFlags(Qt::TextSelectableByMouse); m_statusLabelBalance->setCursor(Qt::PointingHandCursor); + m_statusLabelBalance->setCursor(Qt::PointingHandCursor); + m_statusLabelBalance->setContextMenuPolicy(Qt::ActionsContextMenu); this->statusBar()->addPermanentWidget(m_statusLabelBalance); - connect(m_statusLabelBalance, &ClickableLabel::clicked, this, &MainWindow::showBalanceDialog); + + QAction *showBalanceAction = new QAction(tr("Show details"), this); + connect(showBalanceAction, &QAction::triggered, this, &MainWindow::showBalanceDialog); + m_statusLabelBalance->addAction(showBalanceAction); m_statusBtnConnectionStatusIndicator = new StatusBarButton(icons()->icon("status_disconnected.svg"), "Connection status", this); connect(m_statusBtnConnectionStatusIndicator, &StatusBarButton::clicked, [this](){ @@ -235,6 +240,7 @@ void MainWindow::initStatusBar() { m_statusLabelStatus->addAction(scanTxAction); m_updateNetworkInfoAction = new QAction(tr("Update Network Info"), this); + m_updateNetworkInfoAction->setEnabled(!pauseSyncAction->isChecked()); m_statusLabelStatus->addAction(m_updateNetworkInfoAction); connect(pauseSyncAction, &QAction::toggled, this, [this](bool checked) { @@ -243,6 +249,7 @@ void MainWindow::initStatusBar() { m_actionDisconnectNodeOnPause->setEnabled(checked); m_actionDisconnectWebSocketOnPause->setEnabled(checked); + m_updateNetworkInfoAction->setEnabled(!checked); if (m_wallet) { if (checked) { @@ -887,7 +894,11 @@ void MainWindow::onBalanceUpdated(quint64 balance, quint64 spendable) { if (conf()->get(Config::balanceShowFiat).toBool() && !hide) { QString fiatCurrency = conf()->get(Config::preferredFiatCurrency).toString(); double balanceFiatAmount = appData()->prices.convert("XMR", fiatCurrency, balance / constants::cdiv); - balance_str += QString(" (%1)").arg(Utils::amountToCurrencyString(balanceFiatAmount, fiatCurrency)); + if (balance > 0 && balanceFiatAmount == 0.0) { + balance_str += " (---)"; + } else { + balance_str += QString(" (%1)").arg(Utils::amountToCurrencyString(balanceFiatAmount, fiatCurrency)); + } } m_statusLabelBalance->setToolTip("Click for details"); diff --git a/src/WindowManager.cpp b/src/WindowManager.cpp index 7587b17a..b15cd315 100644 --- a/src/WindowManager.cpp +++ b/src/WindowManager.cpp @@ -737,7 +737,7 @@ void WindowManager::onProxySettingsChanged() { getNetworkSocks5()->setProxy(proxy); } - qWarning() << "Proxy: " << proxy.hostName() << " " << proxy.port(); + qInfo() << "Proxy: " << proxy.hostName() << " " << proxy.port(); // Switch websocket to new proxy and update URL websocketNotifier()->websocketClient->stop(); -- 2.52.0