mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Merge bitcoin-core/gui#317: Add Direction column to Peers Tab
6971e790c3gui: add Direction column to peers tab (Jon Atack) Pull request description: Picking up #289 This adds a `Direction column`, making the peers tab the same as the `Direction/Type` row in the peer details and the direction and type columns in our other user-facing peer connections table in `-netinfo`. Users can now sort the peers table by direction. The default sort is set to inbound, then outbound. | Master | PR | | ----------- | ----------- | |  |  | ACKs for top commit: jonatack: Tested ACK6971e790c3ShaMan239: tACK6971e790c3hebasto: ACK6971e790c3, tested on Linux Mint 20.2 (Qt 5.12.8). Tree-SHA512: 9716cdedd435f88245a097fed6d4b2b486104d0dd09df739bdb4f2bfad709cbd9c9a231168cc3326e94fa5fddc77dd68f992f20417d04d94930db9fccdbb7de1
This commit is contained in:
@@ -72,8 +72,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:
|
||||
@@ -94,6 +99,7 @@ QVariant PeerTableModel::data(const QModelIndex& index, int role) const
|
||||
return QVariant(Qt::AlignRight | Qt::AlignVCenter);
|
||||
case Address:
|
||||
return {};
|
||||
case Direction:
|
||||
case ConnectionType:
|
||||
case Network:
|
||||
return QVariant(Qt::AlignCenter);
|
||||
|
||||
Reference in New Issue
Block a user