mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
gui: add "Type" column to Peers main window
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user