mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Merge bitcoin-core/gui#543: peers-tab: add connection duration column to tableview
51708c4516gui: peersWidget - ResizeToContents Age and IP/Netmask columns (randymcmillan)209301a442gui: add Age column to peers tab (randymcmillan)127de22c5fgui: add FormatPeerAge() utility helper (Jon Atack) Pull request description: This change adds an "Age" column to the peers table view, which displays the duration of each peer's connection. ACKs for top commit: jonatack: re-ACK51708c4516Jamewood: > re-ACK51708c4shaavan: reACK51708c4516hebasto: ACK51708c4516, I have reviewed the code and it looks OK, I agree it can be merged. Tree-SHA512: 27323f7080ec0d3fcdbf1b190fba1cd2d7406840ab6607c221cf8af950db9134e22721cc5a88f4fc4f390d8b05e98bc4b7521661a31fadad9e2c6c6390e71788
This commit is contained in:
@@ -71,6 +71,8 @@ QVariant PeerTableModel::data(const QModelIndex& index, int role) const
|
||||
switch (column) {
|
||||
case NetNodeId:
|
||||
return (qint64)rec->nodeStats.nodeid;
|
||||
case Age:
|
||||
return GUIUtil::FormatPeerAge(rec->nodeStats.m_connected);
|
||||
case Address:
|
||||
return QString::fromStdString(rec->nodeStats.m_addr_name);
|
||||
case Direction:
|
||||
@@ -96,6 +98,7 @@ QVariant PeerTableModel::data(const QModelIndex& index, int role) const
|
||||
} else if (role == Qt::TextAlignmentRole) {
|
||||
switch (column) {
|
||||
case NetNodeId:
|
||||
case Age:
|
||||
return QVariant(Qt::AlignRight | Qt::AlignVCenter);
|
||||
case Address:
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user