aboutsummaryrefslogtreecommitdiff
path: root/src/qt/peertablemodel.cpp
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2021-01-09 20:10:12 +0100
committerJon Atack <jon@atack.com>2021-02-06 22:59:54 +0100
commit151888383a772fd5be626b6ed25af183f0395a41 (patch)
treeb808825bda17521705c62c042927741cd8b7faab /src/qt/peertablemodel.cpp
parent6fc72bd6f030c8b49e8b9f68188413766a239d73 (diff)
gui: add "Type" column to Peers main window
Diffstat (limited to 'src/qt/peertablemodel.cpp')
-rw-r--r--src/qt/peertablemodel.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp
index bad81d894c..5f518a67cd 100644
--- a/src/qt/peertablemodel.cpp
+++ b/src/qt/peertablemodel.cpp
@@ -29,6 +29,8 @@ bool NodeLessThan::operator()(const CNodeCombinedStats &left, const CNodeCombine
return pLeft->nodeid < pRight->nodeid;
case PeerTableModel::Address:
return pLeft->addrName.compare(pRight->addrName) < 0;
+ case PeerTableModel::ConnectionType:
+ return pLeft->m_conn_type < pRight->m_conn_type;
case PeerTableModel::Network:
return pLeft->m_network < pRight->m_network;
case PeerTableModel::Ping:
@@ -163,6 +165,8 @@ QVariant PeerTableModel::data(const QModelIndex &index, int role) const
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 ConnectionType:
+ return GUIUtil::ConnectionTypeToQString(rec->nodeStats.m_conn_type, /* prepend_direction */ false);
case Network:
return GUIUtil::NetworkToQString(rec->nodeStats.m_network);
case Ping:
@@ -176,6 +180,7 @@ QVariant PeerTableModel::data(const QModelIndex &index, int role) const
}
} else if (role == Qt::TextAlignmentRole) {
switch (index.column()) {
+ case ConnectionType:
case Network:
return QVariant(Qt::AlignCenter);
case Ping: