diff options
author | Jon Atack <jon@atack.com> | 2021-04-23 14:57:05 +0200 |
---|---|---|
committer | Jarol Rodriguez <jarolrod@tutanota.com> | 2021-05-26 17:35:11 -0400 |
commit | 6971e790c32253ecddb6108e796afd3892ced7fe (patch) | |
tree | 348a43bffd422522f350b616ad91770a007e1404 | |
parent | 5c041cb348e667672c8b5ed504dba05adf60783b (diff) | |
download | bitcoin-6971e790c32253ecddb6108e796afd3892ced7fe.tar.xz |
gui: add Direction column to peers tab
Co-authored-by: Jarol Rodriguez <jarolrod@tutanota.com>
-rw-r--r-- | src/qt/peertablemodel.cpp | 10 | ||||
-rw-r--r-- | src/qt/peertablemodel.h | 4 | ||||
-rw-r--r-- | src/qt/peertablesortproxy.cpp | 2 |
3 files changed, 14 insertions, 2 deletions
diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp index 11441481bb..1df02b7a93 100644 --- a/src/qt/peertablemodel.cpp +++ b/src/qt/peertablemodel.cpp @@ -113,8 +113,13 @@ 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::fromStdString((rec->nodeStats.fInbound ? "↓ " : "↑ ") + rec->nodeStats.addrName); + return QString::fromStdString(rec->nodeStats.addrName); + case Direction: + return QString(rec->nodeStats.fInbound ? + //: An Inbound Connection from a Peer. + tr("Inbound") : + //: An Outbound Connection to a Peer. + tr("Outbound")); case ConnectionType: return GUIUtil::ConnectionTypeToQString(rec->nodeStats.m_conn_type, /* prepend_direction */ false); case Network: @@ -134,6 +139,7 @@ QVariant PeerTableModel::data(const QModelIndex &index, int role) const case NetNodeId: case Address: return {}; + case Direction: case ConnectionType: case Network: return QVariant(Qt::AlignCenter); diff --git a/src/qt/peertablemodel.h b/src/qt/peertablemodel.h index 3d195342f1..f08f315324 100644 --- a/src/qt/peertablemodel.h +++ b/src/qt/peertablemodel.h @@ -47,6 +47,7 @@ public: enum ColumnIndex { NetNodeId = 0, Address, + Direction, ConnectionType, Network, Ping, @@ -81,6 +82,9 @@ private: /*: Title of Peers Table column which contains the IP/Onion/I2P address of the connected peer. */ tr("Address"), + /*: Title of Peers Table column which indicates the direction + the peer connection was initiated from. */ + tr("Direction"), /*: Title of Peers Table column which describes the type of peer connection. The "type" describes why the connection exists. */ tr("Type"), diff --git a/src/qt/peertablesortproxy.cpp b/src/qt/peertablesortproxy.cpp index 78932da8d4..f92eef48f1 100644 --- a/src/qt/peertablesortproxy.cpp +++ b/src/qt/peertablesortproxy.cpp @@ -26,6 +26,8 @@ bool PeerTableSortProxy::lessThan(const QModelIndex& left_index, const QModelInd return left_stats.nodeid < right_stats.nodeid; case PeerTableModel::Address: return left_stats.addrName.compare(right_stats.addrName) < 0; + case PeerTableModel::Direction: + return left_stats.fInbound > right_stats.fInbound; // default sort Inbound, then Outbound case PeerTableModel::ConnectionType: return left_stats.m_conn_type < right_stats.m_conn_type; case PeerTableModel::Network: |