mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +01:00
merge bitcoin-core/gui#317: Add Direction column to Peers Tab
This commit is contained in:
parent
0a5481cf44
commit
70d4e08011
@ -74,8 +74,13 @@ QVariant PeerTableModel::data(const QModelIndex& index, int role) const
|
||||
case Age:
|
||||
return GUIUtil::FormatPeerAge(rec->nodeStats.m_connected);
|
||||
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.m_addr_name);
|
||||
return QString::fromStdString(rec->nodeStats.m_addr_name);
|
||||
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:
|
||||
@ -97,6 +102,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);
|
||||
|
@ -49,6 +49,7 @@ public:
|
||||
NetNodeId = 0,
|
||||
Age,
|
||||
Address,
|
||||
Direction,
|
||||
ConnectionType,
|
||||
Network,
|
||||
Ping,
|
||||
@ -91,6 +92,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"),
|
||||
|
@ -28,6 +28,8 @@ bool PeerTableSortProxy::lessThan(const QModelIndex& left_index, const QModelInd
|
||||
return left_stats.m_connected > right_stats.m_connected;
|
||||
case PeerTableModel::Address:
|
||||
return left_stats.m_addr_name.compare(right_stats.m_addr_name) < 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:
|
||||
|
Loading…
Reference in New Issue
Block a user