diff options
Diffstat (limited to 'src/qt/rpcconsole.cpp')
-rw-r--r-- | src/qt/rpcconsole.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index ceaa3ac46b..702ca44395 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -2,9 +2,7 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#if defined(HAVE_CONFIG_H) -#include <config/bitcoin-config.h> -#endif +#include <config/bitcoin-config.h> // IWYU pragma: keep #include <qt/rpcconsole.h> #include <qt/forms/ui_debugwindow.h> @@ -23,6 +21,7 @@ #include <rpc/server.h> #include <util/strencodings.h> #include <util/string.h> +#include <util/time.h> #include <util/threadnames.h> #include <univalue.h> @@ -581,6 +580,8 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty clear(); GUIUtil::handleCloseWindowShortcut(this); + + updateWindowTitle(); } RPCConsole::~RPCConsole() @@ -964,6 +965,7 @@ void RPCConsole::message(int category, const QString &message, bool html) void RPCConsole::updateNetworkState() { + if (!clientModel) return; QString connections = QString::number(clientModel->getNumConnections()) + " ("; connections += tr("In:") + " " + QString::number(clientModel->getNumConnections(CONNECTIONS_IN)) + " / "; connections += tr("Out:") + " " + QString::number(clientModel->getNumConnections(CONNECTIONS_OUT)) + ")"; @@ -1193,7 +1195,6 @@ void RPCConsole::updateDetailWidget() ui->peerBytesRecv->setText(GUIUtil::formatBytes(stats->nodeStats.nRecvBytes)); ui->peerPingTime->setText(GUIUtil::formatPingTime(stats->nodeStats.m_last_ping_time)); ui->peerMinPing->setText(GUIUtil::formatPingTime(stats->nodeStats.m_min_ping_time)); - ui->timeoffset->setText(GUIUtil::formatTimeOffset(stats->nodeStats.nTimeOffset)); if (stats->nodeStats.nVersion) { ui->peerVersion->setText(QString::number(stats->nodeStats.nVersion)); } @@ -1225,6 +1226,7 @@ void RPCConsole::updateDetailWidget() // This check fails for example if the lock was busy and // nodeStateStats couldn't be fetched. if (stats->fNodeStateStatsAvailable) { + ui->timeoffset->setText(GUIUtil::formatTimeOffset(Ticks<std::chrono::seconds>(stats->nodeStateStats.time_offset))); ui->peerServices->setText(GUIUtil::formatServicesStr(stats->nodeStateStats.their_services)); // Sync height is init to -1 if (stats->nodeStateStats.nSyncHeight > -1) { @@ -1387,3 +1389,13 @@ void RPCConsole::updateAlerts(const QString& warnings) this->ui->label_alerts->setVisible(!warnings.isEmpty()); this->ui->label_alerts->setText(warnings); } + +void RPCConsole::updateWindowTitle() +{ + const ChainType chain = Params().GetChainType(); + if (chain == ChainType::MAIN) return; + + const QString chainType = QString::fromStdString(Params().GetChainTypeString()); + const QString title = tr("Node window - [%1]").arg(chainType); + this->setWindowTitle(title); +}
\ No newline at end of file |