From: gg Date: Mon, 12 Jan 2026 22:51:27 +0000 (-0500) Subject: updateNetworkInfoAction context menu; logger fixes X-Git-Url: https://git.nutra.tk/v1?a=commitdiff_plain;h=0eb1328ccb749041888d917c036e40f91a2e2cb2;p=gamesguru%2Ffeather.git updateNetworkInfoAction context menu; logger fixes log block/daemon/wallet updates for ref QPointer m_updateNetworkInfoAction; --- diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index b45f903f..fc1decf8 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -214,6 +214,9 @@ void MainWindow::initStatusBar() { QAction *scanTxAction = new QAction(tr("Import Transaction"), this); m_statusLabelStatus->addAction(scanTxAction); + m_updateNetworkInfoAction = new QAction(tr("Update Network Info"), this); + m_statusLabelStatus->addAction(m_updateNetworkInfoAction); + connect(pauseSyncAction, &QAction::toggled, this, [this](bool checked) { qInfo() << "Pause Sync toggled. Checked =" << checked; conf()->set(Config::syncPaused, checked); @@ -646,6 +649,19 @@ void MainWindow::initOffline() { ui->radio_airgapUR->setChecked(true); } + connect(m_updateNetworkInfoAction, &QAction::triggered, this, [this](){ + if (!m_wallet) return; + m_wallet->updateNetworkStatus(); + }); + + connect(m_wallet, &Wallet::heightsRefreshed, this, [this](bool success, quint64 daemonHeight, quint64 targetHeight){ + if (conf()->get(Config::syncPaused).toBool()) { + qInfo() << "Heights refreshed (Paused): Daemon" << daemonHeight << "Target" << targetHeight; + this->setPausedSyncStatus(); + } + }); + + // We do NOT want to start syncing yet here, wait for wallet to be opened // We can't use rich text for radio buttons connect(ui->label_airgapUR, &ClickableLabel::clicked, [this] { ui->radio_airgapUR->setChecked(true); @@ -843,15 +859,28 @@ void MainWindow::onBalanceUpdated(quint64 balance, quint64 spendable) { } void MainWindow::setPausedSyncStatus() { - qInfo() << "setPausedSyncStatus called. Sync paused:" << conf()->get(Config::syncPaused).toBool(); + qWarning() << "setPausedSyncStatus called. Sync paused:" << conf()->get(Config::syncPaused).toBool(); QString tooltip; QString status = Utils::getPausedSyncStatus(m_wallet, m_nodes, &tooltip); + + // Log variables for debugging 149 vs 814k discrepancy + if (m_wallet) { + qWarning() << "Paused Status Calc: WalletHeight:" << m_wallet->blockChainHeight() + << "DaemonHeight:" << m_wallet->daemonBlockChainHeight() + << "TargetHeight:" << m_wallet->daemonBlockChainTargetHeight(); + } + this->setStatusText(status); if (!tooltip.isEmpty()) m_statusLabelStatus->setToolTip(tooltip); } void MainWindow::setStatusText(const QString &text, bool override, int timeout) { + // Log to qWarning as requested for debugging + if (text != m_statusText) { + qWarning() << "Setting status text:" << text; + } + if (override) { m_statusOverrideActive = true; m_statusLabelStatus->setText(text); @@ -961,7 +990,7 @@ void MainWindow::onMultiBroadcast(const QMap &txHexMap) { } void MainWindow::onSyncStatus(quint64 height, quint64 target, bool daemonSync) { - qInfo() << "onSyncStatus: Height" << height << "Target" << target << "DaemonSync" << daemonSync; + qWarning() << "onSyncStatus: Height" << height << "Target" << target << "DaemonSync" << daemonSync; if (height >= (target - 1) && target > 0) { this->updateNetStats(); this->setStatusText(QString("Synchronized (%1)").arg(QLocale().toString(height))); diff --git a/src/MainWindow.h b/src/MainWindow.h index da45aab2..174287e7 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -234,6 +234,7 @@ private: CoinsWidget *m_coinsWidget = nullptr; QPointer m_clearRecentlyOpenAction; + QPointer m_updateNetworkInfoAction; // lower status bar QPushButton *m_statusUpdateAvailable; diff --git a/src/main.cpp b/src/main.cpp index 4c4912ac..03c9c0a7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -180,7 +180,7 @@ if (AttachConsole(ATTACH_PARENT_PROCESS)) { conf()->set(Config::restartRequired, false); - if (!quiet) { + if (!quiet && !conf()->get(Config::disableLogging).toBool()) { QList> info; info.emplace_back("Feather", FEATHER_VERSION); info.emplace_back("Monero", MONERO_VERSION); @@ -189,6 +189,7 @@ if (AttachConsole(ATTACH_PARENT_PROCESS)) { info.emplace_back("SSL", QSslSocket::sslLibraryVersionString()); info.emplace_back("Mode", stagenet ? "Stagenet" : (testnet ? "Testnet" : "Mainnet")); info.emplace_back("Network", conf()->get(Config::syncPaused).toBool() ? "PAUSED" : "ACTIVE"); + info.emplace_back("Config dir", configDir); for (const auto &k: info) { qWarning().nospace().noquote() << QString("%1: %2").arg(k.first, k.second); @@ -220,6 +221,6 @@ if (AttachConsole(ATTACH_PARENT_PROCESS)) { wm->setEventFilter(&filter); int exitCode = Application::exec(); - qDebug() << "Application::exec() returned with exit code:" << exitCode; + qWarning() << "Application::exec() returned with exit code:" << exitCode; return exitCode; } diff --git a/src/utils/config.cpp b/src/utils/config.cpp index 72c94a01..67a6efad 100644 --- a/src/utils/config.cpp +++ b/src/utils/config.cpp @@ -246,9 +246,7 @@ QDir Config::defaultConfigDir() { #elif defined(Q_OS_MACOS) return QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)); #else - QDir path(QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + "/feather"); - qDebug() << "Config path resolved to: " << path.absolutePath(); - return path; + return QDir(QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + "/feather"); #endif }