gui: add Direction column to peers tab

Co-authored-by: Jarol Rodriguez <jarolrod@tutanota.com>
This commit is contained in:
Jon Atack
2021-04-23 14:57:05 +02:00
committed by Jarol Rodriguez
parent 5c041cb348
commit 6971e790c3
3 changed files with 14 additions and 2 deletions

View File

@@ -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);