]> Nutra Git (v2) - gamesguru/feather.git/commitdiff
updateNetworkInfoAction context menu; logger fixes
authorgg <chown_tee@proton.me>
Mon, 12 Jan 2026 22:51:27 +0000 (17:51 -0500)
committergg <chown_tee@proton.me>
Mon, 12 Jan 2026 23:04:52 +0000 (18:04 -0500)
log block/daemon/wallet updates for ref

QPointer<QAction> m_updateNetworkInfoAction;

src/MainWindow.cpp
src/MainWindow.h
src/main.cpp
src/utils/config.cpp

index b45f903f4a45992a9c13c5892f82c7008eab709e..fc1decf830929dee62f4552c92e5b54d0c7edd9d 100644 (file)
@@ -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<QString, QString> &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)));
index da45aab2ccd3b6ba5cd577db046589eef8289e76..174287e7285119253bb4e4227d369bee56b0e334 100644 (file)
@@ -234,6 +234,7 @@ private:
     CoinsWidget *m_coinsWidget = nullptr;
 
     QPointer<QAction> m_clearRecentlyOpenAction;
+    QPointer<QAction> m_updateNetworkInfoAction;
 
     // lower status bar
     QPushButton *m_statusUpdateAvailable;
index 4c4912ac9f82c2be95d3da1beb3a59fa8f120c93..03c9c0a7c2e902883e348b75fcec605f5b618060 100644 (file)
@@ -180,7 +180,7 @@ if (AttachConsole(ATTACH_PARENT_PROCESS)) {
 
     conf()->set(Config::restartRequired, false);
 
-    if (!quiet) {
+    if (!quiet && !conf()->get(Config::disableLogging).toBool()) {
         QList<QPair<QString, QString>> 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;
 }
index 72c94a0157653db27827fd3a9cc872040039de82..67a6efadc026c93c6267f03b420ea32aa254e613 100644 (file)
@@ -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
 }