diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2022-04-13 00:54:47 +0200 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2022-04-13 01:11:55 +0200 |
commit | 0f46e73c740e98854f3c4cce27071e7e2b6ebdc3 (patch) | |
tree | e627970332242a3e90b35500ebb59a5a7b7b4d09 /src/qt/peertablemodel.cpp | |
parent | 2b5a741e98f186e50d9fbe1ceadcc8b8c91547f7 (diff) | |
parent | 51708c4516cb9d52e84dc8850d93f556dda1a75b (diff) | |
download | bitcoin-0f46e73c740e98854f3c4cce27071e7e2b6ebdc3.tar.xz |
Merge bitcoin-core/gui#543: peers-tab: add connection duration column to tableview
51708c4516cb9d52e84dc8850d93f556dda1a75b gui: peersWidget - ResizeToContents Age and IP/Netmask columns (randymcmillan)
209301a442512579d57f79c82417dc7c496248b6 gui: add Age column to peers tab (randymcmillan)
127de22c5fb396e1670d2a911faf7a9adc9241e2 gui: 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-ACK 51708c4516cb9d52e84dc8850d93f556dda1a75b
Jamewood:
> re-ACK 51708c4
shaavan:
reACK 51708c4516cb9d52e84dc8850d93f556dda1a75b
hebasto:
ACK 51708c4516cb9d52e84dc8850d93f556dda1a75b, I have reviewed the code and it looks OK, I agree it can be merged.
Tree-SHA512: 27323f7080ec0d3fcdbf1b190fba1cd2d7406840ab6607c221cf8af950db9134e22721cc5a88f4fc4f390d8b05e98bc4b7521661a31fadad9e2c6c6390e71788
Diffstat (limited to 'src/qt/peertablemodel.cpp')
-rw-r--r-- | src/qt/peertablemodel.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp index 563bca76e5..41c389d9cc 100644 --- a/src/qt/peertablemodel.cpp +++ b/src/qt/peertablemodel.cpp @@ -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 {}; |