-
Notifications
You must be signed in to change notification settings - Fork 37.7k
GUI: Peer table: Visualize inbound/outbound state for every row #13537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK.
src/qt/peertablemodel.cpp
Outdated
switch(index.column()) | ||
{ | ||
case NetNodeId: | ||
return (qint64)rec->nodeStats.nodeid; | ||
case Address: | ||
return QString::fromStdString(rec->nodeStats.addrName); | ||
rec->nodeStats.fInbound ? address_output_prefix = "↓ " : address_output_prefix = "↑ "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer:
address_output_prefix = rec->nodeStats.fInbound ? "↓ " : "↑ ";
src/qt/peertablemodel.cpp
Outdated
switch(index.column()) | ||
{ | ||
case NetNodeId: | ||
return (qint64)rec->nodeStats.nodeid; | ||
case Address: | ||
return QString::fromStdString(rec->nodeStats.addrName); | ||
rec->nodeStats.fInbound ? address_output_prefix = "↓ " : address_output_prefix = "↑ "; | ||
return QString::fromStdString(rec->nodeStats.addrName).prepend(address_output_prefix); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could inline like:
return QString(rec->nodeStats.fInbound ? "↓ " : "↑ ") + QString::fromStdString(rec->nodeStats.addrName);
and remove declaration above.
@promag Thanks, cleaner and shorter code. Rebased and squashed. |
@@ -162,7 +162,8 @@ QVariant PeerTableModel::data(const QModelIndex &index, int role) const | |||
case NetNodeId: | |||
return (qint64)rec->nodeStats.nodeid; | |||
case Address: | |||
return QString::fromStdString(rec->nodeStats.addrName); | |||
// 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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does those unicode char (86 93 and 86 91) work on all supported platforms (especially older windows version)?
Would using an Icon make more sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could You define 'older windows version'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windows 7 or later is what we are currently supporting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can not test for Windows, since I do not have any Windows. Maybe someone with Windows testing capabilities can apply this one-liner and check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These characters have been in unicode since time immemorial [Unicode 1.1.0 (June, 1993], I wouldn't be afraid of them not being supported.
Nice and small change. Concept ACK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 4132ad3
utACK 4132ad3 |
Thank you for doing it this way, instead of adding another column. |
…very row 4132ad3 Show symbol for inbound/outbound in peer table (wodry) Pull request description: Fixes #13483 The address in the network peer table is prefixed with an up-arrow symbolizing an outbound connection, or an down-array symbolizing an inbound connection. See screenshot. The user has an easy visual confirmation about the connection direction state. I really like it :) Impact to columns sorting is grouping by inbound/outbound first, which in my opinion is an advantage, too.  Tree-SHA512: d355f679d34c3006743c06750be5f36a083c1a8376da8f5f35045fcd9df964153409946fdde5007734f23bd692c91355962dc42df31122cdcf88e4affce8bc0e
Github-Pull: bitcoin#13537 Rebased-From: 4132ad3
…e for every row 4132ad3 Show symbol for inbound/outbound in peer table (wodry) Pull request description: Fixes bitcoin#13483 The address in the network peer table is prefixed with an up-arrow symbolizing an outbound connection, or an down-array symbolizing an inbound connection. See screenshot. The user has an easy visual confirmation about the connection direction state. I really like it :) Impact to columns sorting is grouping by inbound/outbound first, which in my opinion is an advantage, too.  Tree-SHA512: d355f679d34c3006743c06750be5f36a083c1a8376da8f5f35045fcd9df964153409946fdde5007734f23bd692c91355962dc42df31122cdcf88e4affce8bc0e
…e for every row 4132ad3 Show symbol for inbound/outbound in peer table (wodry) Pull request description: Fixes bitcoin#13483 The address in the network peer table is prefixed with an up-arrow symbolizing an outbound connection, or an down-array symbolizing an inbound connection. See screenshot. The user has an easy visual confirmation about the connection direction state. I really like it :) Impact to columns sorting is grouping by inbound/outbound first, which in my opinion is an advantage, too.  Tree-SHA512: d355f679d34c3006743c06750be5f36a083c1a8376da8f5f35045fcd9df964153409946fdde5007734f23bd692c91355962dc42df31122cdcf88e4affce8bc0e
…e for every row 4132ad3 Show symbol for inbound/outbound in peer table (wodry) Pull request description: Fixes bitcoin#13483 The address in the network peer table is prefixed with an up-arrow symbolizing an outbound connection, or an down-array symbolizing an inbound connection. See screenshot. The user has an easy visual confirmation about the connection direction state. I really like it :) Impact to columns sorting is grouping by inbound/outbound first, which in my opinion is an advantage, too.  Tree-SHA512: d355f679d34c3006743c06750be5f36a083c1a8376da8f5f35045fcd9df964153409946fdde5007734f23bd692c91355962dc42df31122cdcf88e4affce8bc0e
…e for every row 4132ad3 Show symbol for inbound/outbound in peer table (wodry) Pull request description: Fixes bitcoin#13483 The address in the network peer table is prefixed with an up-arrow symbolizing an outbound connection, or an down-array symbolizing an inbound connection. See screenshot. The user has an easy visual confirmation about the connection direction state. I really like it :) Impact to columns sorting is grouping by inbound/outbound first, which in my opinion is an advantage, too.  Tree-SHA512: d355f679d34c3006743c06750be5f36a083c1a8376da8f5f35045fcd9df964153409946fdde5007734f23bd692c91355962dc42df31122cdcf88e4affce8bc0e
…e for every row 4132ad3 Show symbol for inbound/outbound in peer table (wodry) Pull request description: Fixes bitcoin#13483 The address in the network peer table is prefixed with an up-arrow symbolizing an outbound connection, or an down-array symbolizing an inbound connection. See screenshot. The user has an easy visual confirmation about the connection direction state. I really like it :) Impact to columns sorting is grouping by inbound/outbound first, which in my opinion is an advantage, too.  Tree-SHA512: d355f679d34c3006743c06750be5f36a083c1a8376da8f5f35045fcd9df964153409946fdde5007734f23bd692c91355962dc42df31122cdcf88e4affce8bc0e
…e for every row 4132ad3 Show symbol for inbound/outbound in peer table (wodry) Pull request description: Fixes bitcoin#13483 The address in the network peer table is prefixed with an up-arrow symbolizing an outbound connection, or an down-array symbolizing an inbound connection. See screenshot. The user has an easy visual confirmation about the connection direction state. I really like it :) Impact to columns sorting is grouping by inbound/outbound first, which in my opinion is an advantage, too.  Tree-SHA512: d355f679d34c3006743c06750be5f36a083c1a8376da8f5f35045fcd9df964153409946fdde5007734f23bd692c91355962dc42df31122cdcf88e4affce8bc0e
…e for every row 4132ad3 Show symbol for inbound/outbound in peer table (wodry) Pull request description: Fixes bitcoin#13483 The address in the network peer table is prefixed with an up-arrow symbolizing an outbound connection, or an down-array symbolizing an inbound connection. See screenshot. The user has an easy visual confirmation about the connection direction state. I really like it :) Impact to columns sorting is grouping by inbound/outbound first, which in my opinion is an advantage, too.  Tree-SHA512: d355f679d34c3006743c06750be5f36a083c1a8376da8f5f35045fcd9df964153409946fdde5007734f23bd692c91355962dc42df31122cdcf88e4affce8bc0e
…e for every row 4132ad3 Show symbol for inbound/outbound in peer table (wodry) Pull request description: Fixes bitcoin#13483 The address in the network peer table is prefixed with an up-arrow symbolizing an outbound connection, or an down-array symbolizing an inbound connection. See screenshot. The user has an easy visual confirmation about the connection direction state. I really like it :) Impact to columns sorting is grouping by inbound/outbound first, which in my opinion is an advantage, too.  Tree-SHA512: d355f679d34c3006743c06750be5f36a083c1a8376da8f5f35045fcd9df964153409946fdde5007734f23bd692c91355962dc42df31122cdcf88e4affce8bc0e
…e for every row 4132ad3 Show symbol for inbound/outbound in peer table (wodry) Pull request description: Fixes bitcoin#13483 The address in the network peer table is prefixed with an up-arrow symbolizing an outbound connection, or an down-array symbolizing an inbound connection. See screenshot. The user has an easy visual confirmation about the connection direction state. I really like it :) Impact to columns sorting is grouping by inbound/outbound first, which in my opinion is an advantage, too.  Tree-SHA512: d355f679d34c3006743c06750be5f36a083c1a8376da8f5f35045fcd9df964153409946fdde5007734f23bd692c91355962dc42df31122cdcf88e4affce8bc0e
…e for every row 4132ad3 Show symbol for inbound/outbound in peer table (wodry) Pull request description: Fixes bitcoin#13483 The address in the network peer table is prefixed with an up-arrow symbolizing an outbound connection, or an down-array symbolizing an inbound connection. See screenshot. The user has an easy visual confirmation about the connection direction state. I really like it :) Impact to columns sorting is grouping by inbound/outbound first, which in my opinion is an advantage, too.  Tree-SHA512: d355f679d34c3006743c06750be5f36a083c1a8376da8f5f35045fcd9df964153409946fdde5007734f23bd692c91355962dc42df31122cdcf88e4affce8bc0e
…r every row Summary: 4132ad3 Show symbol for inbound/outbound in peer table (wodry) Pull request description: Fixes #13483 The address in the network peer table is prefixed with an up-arrow symbolizing an outbound connection, or an down-array symbolizing an inbound connection. See screenshot. The user has an easy visual confirmation about the connection direction state. I really like it :) Impact to columns sorting is grouping by inbound/outbound first, which in my opinion is an advantage, too.  --- Backport of Core [[bitcoin/bitcoin#13537 | PR13537]] Test Plan: ninja all ./qt/bitcoin-qt -testnet enter "Peers" window and look for arrows Reviewers: #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Subscribers: deadalnix Differential Revision: https://reviews.bitcoinabc.org/D8543
It is removes an option to sort by address, that is wrong. |
…e for every row 4132ad3 Show symbol for inbound/outbound in peer table (wodry) Pull request description: Fixes bitcoin#13483 The address in the network peer table is prefixed with an up-arrow symbolizing an outbound connection, or an down-array symbolizing an inbound connection. See screenshot. The user has an easy visual confirmation about the connection direction state. I really like it :) Impact to columns sorting is grouping by inbound/outbound first, which in my opinion is an advantage, too.  Tree-SHA512: d355f679d34c3006743c06750be5f36a083c1a8376da8f5f35045fcd9df964153409946fdde5007734f23bd692c91355962dc42df31122cdcf88e4affce8bc0e
Fixes #13483
The address in the network peer table is prefixed with an up-arrow symbolizing an outbound connection, or an down-array symbolizing an inbound connection. See screenshot.
The user has an easy visual confirmation about the connection direction state. I really like it :)

Impact to columns sorting is grouping by inbound/outbound first, which in my opinion is an advantage, too.