GUI: Peer table: Visualize inbound/outbound state for every row #13537

pull ghost wants to merge 1 commits into bitcoin:master from changing 1 files +2 −1
  1. ghost commented at 4:26 PM on June 25, 2018: none

    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. bildschirmfoto

  2. fanquake added the label GUI on Jun 25, 2018
  3. fanquake added the label P2P on Jun 25, 2018
  4. in src/qt/peertablemodel.cpp:169 in aec4123636 outdated
     165 |          {
     166 |          case NetNodeId:
     167 |              return (qint64)rec->nodeStats.nodeid;
     168 |          case Address:
     169 | -            return QString::fromStdString(rec->nodeStats.addrName);
     170 | +            rec->nodeStats.fInbound ? address_output_prefix = "↓ " : address_output_prefix = "↑ ";
    


    promag commented at 2:29 PM on June 26, 2018:

    Prefer:

    address_output_prefix = rec->nodeStats.fInbound ? "↓ " : "↑ ";
    
  5. in src/qt/peertablemodel.cpp:170 in aec4123636 outdated
     166 |          case NetNodeId:
     167 |              return (qint64)rec->nodeStats.nodeid;
     168 |          case Address:
     169 | -            return QString::fromStdString(rec->nodeStats.addrName);
     170 | +            rec->nodeStats.fInbound ? address_output_prefix = "↓ " : address_output_prefix = "↑ ";
     171 | +            return QString::fromStdString(rec->nodeStats.addrName).prepend(address_output_prefix);
    


    promag commented at 2:33 PM on June 26, 2018:

    Could inline like:

    return QString(rec->nodeStats.fInbound ? "↓ " : "↑ ") + QString::fromStdString(rec->nodeStats.addrName);
    

    and remove declaration above.

  6. promag commented at 2:35 PM on June 26, 2018: member

    Concept ACK.

  7. Show symbol for inbound/outbound in peer table 4132ad3bfa
  8. ghost commented at 5:43 PM on June 26, 2018: none

    @promag Thanks, cleaner and shorter code. Rebased and squashed.

  9. in src/qt/peertablemodel.cpp:166 in 4132ad3bfa
     161 | @@ -162,7 +162,8 @@ QVariant PeerTableModel::data(const QModelIndex &index, int role) const
     162 |          case NetNodeId:
     163 |              return (qint64)rec->nodeStats.nodeid;
     164 |          case Address:
     165 | -            return QString::fromStdString(rec->nodeStats.addrName);
     166 | +            // prepend to peer address down-arrow symbol for inbound connection and up-arrow for outbound connection
     167 | +            return QString(rec->nodeStats.fInbound ? "↓ " : "↑ ") + QString::fromStdString(rec->nodeStats.addrName);
    


    jonasschnelli commented at 7:24 PM on June 26, 2018:

    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?


    unknown commented at 8:44 PM on June 26, 2018:

    Could You define 'older windows version'?


    fanquake commented at 12:25 AM on June 27, 2018:

    Windows 7 or later is what we are currently supporting.


    unknown commented at 3:27 PM on June 29, 2018:

    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?


    laanwj commented at 4:18 PM on June 29, 2018:

    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.

  10. jonasschnelli commented at 7:24 PM on June 26, 2018: contributor

    Nice and small change. Concept ACK

  11. jb55 approved
  12. jb55 commented at 7:45 PM on June 26, 2018: member

    utACK 4132ad3bfa5b5ead3f4a592d819d0097881b4827

  13. jonasschnelli commented at 4:19 PM on June 29, 2018: contributor

    utACK 4132ad3bfa5b5ead3f4a592d819d0097881b4827

  14. laanwj commented at 4:20 PM on June 29, 2018: member

    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.

    Thank you for doing it this way, instead of adding another column. utACK 4132ad3bfa5b5ead3f4a592d819d0097881b4827

  15. fanquake commented at 3:36 AM on July 1, 2018: member

    tACK 4132ad3

    macOS 10.13.5

    master:

    <img width="707" alt="macos-master" src="https://user-images.githubusercontent.com/863730/42130824-576cbdfe-7d22-11e8-995b-627ca4c0c3f8.png">

    4132ad3:

    <img width="712" alt="macos-13537" src="https://user-images.githubusercontent.com/863730/42130826-5d89d4ec-7d22-11e8-91a1-a44c4ab6fa8b.png">

    Windows 10

    4132ad3:

    <img width="804" alt="windows10-13537" src="https://user-images.githubusercontent.com/863730/42130827-6db1c974-7d22-11e8-8d5f-8ca5a11672ef.png">

    The symbol could be a bit hard to make out on Windows, but Windows really needs an overhaul in terms of font/sizing anyways, so I don't think that should block anything here.

  16. jonasschnelli merged this on Jul 1, 2018
  17. jonasschnelli closed this on Jul 1, 2018

  18. jonasschnelli referenced this in commit 10ffca7429 on Jul 1, 2018
  19. unknown deleted the branch on Jul 1, 2018
  20. luke-jr referenced this in commit a6f1df8567 on Jul 30, 2018
  21. PastaPastaPasta referenced this in commit 3cfb84e2a4 on Apr 16, 2020
  22. PastaPastaPasta referenced this in commit 06b43db9c4 on Apr 16, 2020
  23. PastaPastaPasta referenced this in commit 7f3fec572c on Apr 19, 2020
  24. PastaPastaPasta referenced this in commit 36d37fde6b on Apr 20, 2020
  25. PastaPastaPasta referenced this in commit 15f004d762 on May 10, 2020
  26. PastaPastaPasta referenced this in commit f38d1f9053 on May 12, 2020
  27. PastaPastaPasta referenced this in commit 28a62b059a on Jun 9, 2020
  28. PastaPastaPasta referenced this in commit ed4ff10149 on Jun 9, 2020
  29. PastaPastaPasta referenced this in commit 63604237fa on Jun 10, 2020
  30. PastaPastaPasta referenced this in commit edc2b5a85a on Jun 11, 2020
  31. deadalnix referenced this in commit 48a2aad3c2 on Nov 28, 2020
  32. hebasto commented at 10:38 AM on August 8, 2021: member

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

    It is removes an option to sort by address, that is wrong.

  33. gades referenced this in commit 3bc9191c7c on Jan 30, 2022
  34. DrahtBot locked this on Aug 16, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me