From 91b7e23053150f91adb3173946764a1de7dcec8a Mon Sep 17 00:00:00 2001 From: randymcmillan Date: Wed, 2 Dec 2020 11:51:17 -0500 Subject: [PATCH] peers-tab: cleaner presentation more functionality --- src/qt/forms/debugwindow.ui | 671 ++++++++++++++++++++++++++---------- src/qt/guiutil.cpp | 46 ++- src/qt/guiutil.h | 6 + src/qt/peertablemodel.cpp | 30 +- src/qt/peertablemodel.h | 15 +- src/qt/rpcconsole.cpp | 59 +++- src/qt/rpcconsole.h | 12 +- 7 files changed, 623 insertions(+), 216 deletions(-) diff --git a/src/qt/forms/debugwindow.ui b/src/qt/forms/debugwindow.ui index 139c8e161ee..0baa6e18859 100644 --- a/src/qt/forms/debugwindow.ui +++ b/src/qt/forms/debugwindow.ui @@ -6,8 +6,8 @@ 0 0 - 740 - 430 + 777 + 451 @@ -904,9 +904,9 @@ false - + - + 1 0 @@ -920,9 +920,30 @@ + + Select a Node from the List + + + + + + + + + + + + + + + QAbstractScrollArea::AdjustToContents + false + + true + true @@ -975,6 +996,12 @@ + + Banned Peers List + + + QAbstractScrollArea::AdjustToContents + false @@ -988,9 +1015,9 @@ - + - + 0 0 @@ -1001,45 +1028,33 @@ 0 + + Peer Detail + + + Peer Detail + - + - + 0 0 - - - 0 - 32 - - - 10 + 50 + false - - IBeamCursor + + Select a Node from List on Left - - Select a peer to view detailed information. + + QAbstractScrollArea::AdjustToContents - - Qt::AlignHCenter|Qt::AlignTop - - - true - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - true @@ -1048,20 +1063,81 @@ 0 0 - 300 - 426 + 274 + 629 - - - + + + + + + 75 + true + + - Permissions + Sent - - + + + + + 75 + true + + + + Received + + + + + + + + 75 + true + + + + Synced Blocks + + + + + + + + 75 + true + + + + Last Send + + + + + + + + 75 + true + + + + Local IP of Selected Peer + + + Local IP + + + + + IBeamCursor @@ -1072,19 +1148,12 @@ Qt::PlainText - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - Direction - - - - - + + IBeamCursor @@ -1095,19 +1164,28 @@ Qt::PlainText - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - + + + + + 75 + true + + + + The mapped Autonomous System used for diversifying peer selection. + - Version + Mapped AS - - + + IBeamCursor @@ -1118,19 +1196,12 @@ Qt::PlainText - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - User Agent - - - - - + + IBeamCursor @@ -1141,19 +1212,25 @@ Qt::PlainText - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - + + + + + 75 + true + + - Services + Min Ping - - + + IBeamCursor @@ -1164,19 +1241,86 @@ Qt::PlainText - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - + + + + + 75 + true + + + + Node Service Flags + + + B = BLOOM L = NETWORK_LIMITED N = NETWORK W = WITNESS + - Starting Block + Services - - + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 75 + true + + + + Direction + + + + + + + + 75 + true + + + + Last Receive + + + + + + + + 75 + true + + + + Protocol Version + + + Version + + + + + IBeamCursor @@ -1187,19 +1331,12 @@ Qt::PlainText - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Synced Headers + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - + + IBeamCursor @@ -1210,19 +1347,28 @@ Qt::PlainText - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - + + + + + 75 + true + + + + Node ID of Selected Peer + - Synced Blocks + Node ID - - + + IBeamCursor @@ -1233,19 +1379,40 @@ Qt::PlainText - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - + + + + + 50 + false + + + + Selected Node Local IP + + + Selected Node Local IP + + + Selected Node Local IP + - Connection Time + IP:SERVICE + + + true + + + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - + IBeamCursor @@ -1256,22 +1423,31 @@ Qt::PlainText - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - + + + + + 75 + true + + - Last Send + Ping Time - - + + IBeamCursor + + + N/A @@ -1279,19 +1455,47 @@ Qt::PlainText - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + IBeamCursor + + + B = BLOOM L = NETWORK_LIMITED N = NETWORK W = WITNESS + - Last Receive + N/A + + + Qt::PlainText + + + true + + + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - + + IBeamCursor @@ -1302,42 +1506,79 @@ Qt::PlainText - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - + + + + 75 + true + + - Sent + Synced Headers - - - - IBeamCursor + + + + + 50 + false + - - N/A + + Peer Node ID - - Qt::PlainText + + Selected Node ID + + + Selected Node ID + + + ID - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - + + + + + 75 + true + + + + Core Version + - Received + User Agent - - + + + + + 75 + true + + + + Time Offset + + + + + IBeamCursor @@ -1348,19 +1589,12 @@ Qt::PlainText - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Ping Time + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - + + IBeamCursor @@ -1371,22 +1605,41 @@ Qt::PlainText - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - The duration of a currently outstanding ping. + + + + Qt::Horizontal - - Ping Wait + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Detail Section + + + Qt::Horizontal - - + + IBeamCursor @@ -1397,19 +1650,44 @@ Qt::PlainText - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - + + + + Node IP + + + Selected Node IP + + + Selected Node IP + - Min Ping + IP:SERVICE + + + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - + + + + + 75 + true + + + + Connection Time + + + + + IBeamCursor @@ -1420,19 +1698,12 @@ Qt::PlainText - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Time Offset + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - + + IBeamCursor @@ -1443,25 +1714,34 @@ Qt::PlainText - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - + + + + + 75 + true + + - The mapped Autonomous System used for diversifying peer selection. + Node IP of Selected Peer - Mapped AS + Node IP - - + + IBeamCursor + + + N/A @@ -1469,22 +1749,51 @@ Qt::PlainText - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - Qt::Vertical + + + + + 75 + true + - - - 20 - 40 - + + Permissions - + + + + + + + 75 + true + + + + Starting Block + + + + + + + + 75 + true + + + + The duration of a currently outstanding ping. + + + Ping Wait + + diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 70e76f765bf..b49bc5a731f 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -768,23 +768,65 @@ QString formatDurationStr(int secs) return strList.join(" "); } +void sortLocaleAware(QStringList &sList) +{ + std::sort(sList.begin(), sList.end(), [](const QString &s1, const QString &s2){ + return s1.localeAwareCompare(s2) < 0; + }); +} + QString formatServicesStr(quint64 mask) { QStringList strList; for (const auto& flag : serviceFlagsToStr(mask)) { + if (flag == "NETWORK_LIMITED"){ + strList.append(QString::fromStdString("LIMITED")); + } + else + { strList.append(QString::fromStdString(flag)); + } + sortLocaleAware(strList); } if (strList.size()) - return strList.join(" & "); + return strList.join(" "); else return QObject::tr("None"); } +QString shortFormatServicesStr(quint64 mask) +{ + QStringList strList; + + for (const auto& flag : serviceFlagsToStr(mask)) { + if (flag == "NETWORK"){ + strList.append(QString::fromStdString("N")); + } + if (flag == "NETWORK_LIMITED"){ + strList.append(QString::fromStdString("L"));//BLOCKS ONLY + } + if (flag == "BLOOM"){ + strList.append(QString::fromStdString("B")); + } + if (flag == "WITNESS"){ + strList.append(QString::fromStdString("W")); + } + if (flag == "UNKNOWN"){ + strList.append(QString::fromStdString("U")); + } + } + + if (strList.size()) + return strList.join(" "); + else + return QObject::tr(""); +} + QString formatPingTime(int64_t ping_usec) { - return (ping_usec == std::numeric_limits::max() || ping_usec == 0) ? QObject::tr("N/A") : QString(QObject::tr("%1 ms")).arg(QString::number((int)(ping_usec / 1000), 10)); + return (ping_usec == std::numeric_limits::max() || ping_usec == 0) ? QObject::tr(/*silence*/"") : QString(QObject::tr("%1 ms")).arg(QString::number((int)(ping_usec / 1000), 10)); } QString formatTimeOffset(int64_t nTimeOffset) diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index c976b4b4bb0..b45f83e0c69 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -227,9 +227,15 @@ namespace GUIUtil /* Convert seconds into a QString with days, hours, mins, secs */ QString formatDurationStr(int secs); + /* Sort a QStringList */ + void sortLocaleAware(QStringList &sList); + /* Format CNodeStats.nServices bitmask into a user-readable string */ QString formatServicesStr(quint64 mask); + /* Format CNodeStats.nServices bitmask into an abbreviated user-readable string */ + QString shortFormatServicesStr(quint64 mask); + /* Format a CNodeStats.m_ping_usec into a user-readable string or display N/A, if 0*/ QString formatPingTime(int64_t ping_usec); diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp index 5220f8e138d..48e5411fbc6 100644 --- a/src/qt/peertablemodel.cpp +++ b/src/qt/peertablemodel.cpp @@ -27,16 +27,21 @@ bool NodeLessThan::operator()(const CNodeCombinedStats &left, const CNodeCombine { case PeerTableModel::NetNodeId: return pLeft->nodeid < pRight->nodeid; - case PeerTableModel::Address: + case PeerTableModel::NodeService: return pLeft->addrName.compare(pRight->addrName) < 0; - case PeerTableModel::Subversion: - return pLeft->cleanSubVer.compare(pRight->cleanSubVer) < 0; + case PeerTableModel::Direction: + return pLeft->fInbound < pRight->fInbound; case PeerTableModel::Ping: return pLeft->m_min_ping_usec < pRight->m_min_ping_usec; case PeerTableModel::Sent: return pLeft->nSendBytes < pRight->nSendBytes; case PeerTableModel::Received: return pLeft->nRecvBytes < pRight->nRecvBytes; + case PeerTableModel::Subversion: + return pLeft->cleanSubVer.compare(pRight->cleanSubVer) < 0; + case PeerTableModel::Services: + return pLeft->addrName.compare(pRight->addrName) < 0; + //return pLeft->nServices.compare(pRight->nServices) < 0; } return false; @@ -48,8 +53,8 @@ class PeerTablePriv public: /** Local cache of peer information */ QList cachedNodeStats; - /** Column to sort nodes by (default to unsorted) */ - int sortColumn{-1}; + /** Column to sort nodes by (default to NetNodeId) */ + int sortColumn{0}; /** Order (ascending or descending) to sort nodes by */ Qt::SortOrder sortOrder; /** Index of rows by node ID */ @@ -104,7 +109,7 @@ PeerTableModel::PeerTableModel(interfaces::Node& node, QObject* parent) : m_node(node), timer(nullptr) { - columns << tr("NodeId") << tr("Node/Service") << tr("Ping") << tr("Sent") << tr("Received") << tr("User Agent"); + columns << tr("ID ") << tr("I/O") << tr("Node:Service") << tr("Ping") << tr("Sent") << tr("Received") << tr("User Agent") << tr("Services") << tr(/*BUMPER*/""); priv.reset(new PeerTablePriv()); // set up timer for auto refresh @@ -155,17 +160,20 @@ QVariant PeerTableModel::data(const QModelIndex &index, int role) const { case NetNodeId: return (qint64)rec->nodeStats.nodeid; - case Address: - // prepend to peer address down-arrow symbol for inbound connection and up-arrow for outbound connection - return QString(rec->nodeStats.fInbound ? "↓ " : "↑ ") + QString::fromStdString(rec->nodeStats.addrName); - case Subversion: - return QString::fromStdString(rec->nodeStats.cleanSubVer); + case Direction: + return QString(rec->nodeStats.fInbound ? " ↓" : "↑"); //spaces for table column + case NodeService: + return QString::fromStdString(rec->nodeStats.addrName); case Ping: return GUIUtil::formatPingTime(rec->nodeStats.m_min_ping_usec); case Sent: return GUIUtil::formatBytes(rec->nodeStats.nSendBytes); case Received: return GUIUtil::formatBytes(rec->nodeStats.nRecvBytes); + case Subversion: + return QString::fromStdString(rec->nodeStats.cleanSubVer); + case Services: + return GUIUtil::shortFormatServicesStr(rec->nodeStats.nServices); } } else if (role == Qt::TextAlignmentRole) { switch (index.column()) { diff --git a/src/qt/peertablemodel.h b/src/qt/peertablemodel.h index 99de772ac02..7b88a002a7d 100644 --- a/src/qt/peertablemodel.h +++ b/src/qt/peertablemodel.h @@ -58,12 +58,15 @@ class PeerTableModel : public QAbstractTableModel void stopAutoRefresh(); enum ColumnIndex { - NetNodeId = 0, - Address = 1, - Ping = 2, - Sent = 3, - Received = 4, - Subversion = 5 + NetNodeId = 0, + Direction = 1, + NodeService = 2, + Ping = 3, + Sent = 4, + Received = 5, + Subversion = 6, + Services = 7, + Bumper = 8 }; /** @name Methods overridden from QAbstractTableModel diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 236c6e13d5f..557a741bea1 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -490,7 +490,21 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty m_node.rpcSetTimerInterfaceIfUnset(rpcTimerInterface); setTrafficGraphRange(INITIAL_TRAFFIC_GRAPH_MINS); - updateDetailWidget(); + + // debugwindow.ui -> tab_peers -> splitter -> peersWidgetRightPanel -> scrollArea + ui->peersWidgetRightPanel->hide(); + + //detailWidgetRightPanel Header + //ui->peerNodeIDLabel->setText(tr("Node ID:")); + ui->peerNodeID->setText(tr("")); + + //ui->peerNodeIPLabel->setText(tr("Node IP:")); + ui->peerNodeIP->setText(tr("")); + + //ui->peerLocalIPLabel->setText(tr("Local IP:")); + ui->peerLocalIP->setText(tr("")); + //updateDetailWidget(); + consoleFontSize = settings.value(fontSizeSettingsKey, QFont().pointSize()).toInt(); clear(); @@ -584,17 +598,27 @@ void RPCConsole::setClientModel(ClientModel *model, int bestblock_height, int64_ connect(model, &ClientModel::mempoolSizeChanged, this, &RPCConsole::setMempoolSize); - // set up peer table + // set up peerWidgetLeftPanel -> peerWidget ui->peerWidget->setModel(model->getPeerTableModel()); ui->peerWidget->verticalHeader()->hide(); ui->peerWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); ui->peerWidget->setSelectionBehavior(QAbstractItemView::SelectRows); ui->peerWidget->setSelectionMode(QAbstractItemView::ExtendedSelection); ui->peerWidget->setContextMenuPolicy(Qt::CustomContextMenu); - ui->peerWidget->setColumnWidth(PeerTableModel::Address, ADDRESS_COLUMN_WIDTH); - ui->peerWidget->setColumnWidth(PeerTableModel::Subversion, SUBVERSION_COLUMN_WIDTH); + // set peer table column widths + ui->peerWidget->setColumnWidth(PeerTableModel::NetNodeId, ID_COLUMN_WIDTH); + ui->peerWidget->setColumnWidth(PeerTableModel::Direction, DIRECTION_COLUMN_WIDTH); + ui->peerWidget->setColumnWidth(PeerTableModel::NodeService, NODE_SERVICE_COLUMN_WIDTH); ui->peerWidget->setColumnWidth(PeerTableModel::Ping, PING_COLUMN_WIDTH); + ui->peerWidget->setColumnWidth(PeerTableModel::Sent, SENT_COLUMN_WIDTH); + ui->peerWidget->setColumnWidth(PeerTableModel::Received, RECEIVED_COLUMN_WIDTH); + ui->peerWidget->setColumnWidth(PeerTableModel::Subversion, SUBVERSION_COLUMN_WIDTH); //User Agent + ui->peerWidget->setColumnWidth(PeerTableModel::Services, SERVICES_COLUMN_WIDTH); + + ui->peerWidget->setColumnWidth(PeerTableModel::Bumper, 0); ui->peerWidget->horizontalHeader()->setStretchLastSection(true); + ui->peerWidget->horizontalScrollBar()->setStyleSheet("QScrollBar {height:0px;}"); + ui->peerWidget->verticalScrollBar()->setStyleSheet("QScrollBar {width:0px;}"); // create peer table context menu actions QAction* disconnectAction = new QAction(tr("&Disconnect"), this); @@ -662,6 +686,8 @@ void RPCConsole::setClientModel(ClientModel *model, int bestblock_height, int64_ ui->blocksDir->setText(model->blocksDir()); ui->startupTime->setText(model->formatClientStartupTime()); ui->networkName->setText(QString::fromStdString(Params().NetworkIDString())); + ui->scrollArea->horizontalScrollBar()->setStyleSheet("QScrollBar {height:0px;}"); + ui->scrollArea->verticalScrollBar()->setStyleSheet("QScrollBar {width:0px;}"); //Setup autocomplete and attach it QStringList wordList; @@ -1085,17 +1111,22 @@ void RPCConsole::updateDetailWidget() auto selection_model = ui->peerWidget->selectionModel(); if (selection_model) selected_rows = selection_model->selectedRows(); if (!clientModel || !clientModel->getPeerTableModel() || selected_rows.size() != 1) { - ui->detailWidget->hide(); - ui->peerHeading->setText(tr("Select a peer to view detailed information.")); + ui->scrollArea->horizontalScrollBar()->setValue(0); + ui->scrollArea->verticalScrollBar()->setValue(0); + ui->peerWidget->horizontalScrollBar()->setValue(0); return; } const CNodeCombinedStats *stats = clientModel->getPeerTableModel()->getNodeStats(selected_rows.first().row()); // update the detail ui with latest node information - QString peerAddrDetails(QString::fromStdString(stats->nodeStats.addrName) + " "); - peerAddrDetails += tr("(node id: %1)").arg(QString::number(stats->nodeStats.nodeid)); - if (!stats->nodeStats.addrLocal.empty()) - peerAddrDetails += "
" + tr("via %1").arg(QString::fromStdString(stats->nodeStats.addrLocal)); - ui->peerHeading->setText(peerAddrDetails); + QString peerAddrDetails(QString::fromStdString(stats->nodeStats.addrName)); + QString peerAddrLocal(QString::fromStdString(stats->nodeStats.addrLocal)); + QString nodeID(QString::number(stats->nodeStats.nodeid)); + + //peersWidgetRightPanel Header + ui->peerNodeID->setText(nodeID); + ui->peerNodeIP->setText(peerAddrDetails); + ui->peerLocalIP->setText(peerAddrLocal); + //peersWidgetRightPanel Body ui->peerServices->setText(GUIUtil::formatServicesStr(stats->nodeStats.nServices)); ui->peerLastSend->setText(stats->nodeStats.nLastSend ? GUIUtil::formatDurationStr(GetSystemTimeInSeconds() - stats->nodeStats.nLastSend) : tr("never")); ui->peerLastRecv->setText(stats->nodeStats.nLastRecv ? GUIUtil::formatDurationStr(GetSystemTimeInSeconds() - stats->nodeStats.nLastRecv) : tr("never")); @@ -1105,7 +1136,7 @@ void RPCConsole::updateDetailWidget() ui->peerPingTime->setText(GUIUtil::formatPingTime(stats->nodeStats.m_ping_usec)); ui->peerPingWait->setText(GUIUtil::formatPingTime(stats->nodeStats.m_ping_wait_usec)); ui->peerMinPing->setText(GUIUtil::formatPingTime(stats->nodeStats.m_min_ping_usec)); - ui->timeoffset->setText(GUIUtil::formatTimeOffset(stats->nodeStats.nTimeOffset)); + ui->peerTimeoffset->setText(GUIUtil::formatTimeOffset(stats->nodeStats.nTimeOffset)); ui->peerVersion->setText(QString::number(stats->nodeStats.nVersion)); ui->peerSubversion->setText(QString::fromStdString(stats->nodeStats.cleanSubVer)); ui->peerDirection->setText(stats->nodeStats.fInbound ? tr("Inbound") : tr("Outbound")); @@ -1137,7 +1168,7 @@ void RPCConsole::updateDetailWidget() ui->peerCommonHeight->setText(tr("Unknown")); } - ui->detailWidget->show(); + ui->peersWidgetRightPanel->show(); } void RPCConsole::resizeEvent(QResizeEvent *event) @@ -1248,6 +1279,8 @@ void RPCConsole::clearSelectedNode() ui->peerWidget->selectionModel()->clearSelection(); cachedNodeids.clear(); updateDetailWidget(); + ui->peersWidgetRightPanel->hide(); + ui->peerNodeID->setText(tr("Select a peer")); } void RPCConsole::showOrHideBanTableIfRequired() diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index 8fea08ab5cd..eb85824d05b 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -141,9 +141,15 @@ public Q_SLOTS: enum ColumnWidths { - ADDRESS_COLUMN_WIDTH = 200, - SUBVERSION_COLUMN_WIDTH = 150, - PING_COLUMN_WIDTH = 80, + ID_COLUMN_WIDTH = 55, + DIRECTION_COLUMN_WIDTH = 45, + NODE_SERVICE_COLUMN_WIDTH = 150, + PING_COLUMN_WIDTH = 75, + SENT_COLUMN_WIDTH = 75, + RECEIVED_COLUMN_WIDTH = 75, + SUBVERSION_COLUMN_WIDTH = 135, //User Agent + SERVICES_COLUMN_WIDTH = 80, + BANSUBNET_COLUMN_WIDTH = 200, BANTIME_COLUMN_WIDTH = 250