diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-01-10 10:42:21 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-01-10 10:42:50 +0100 |
commit | 094402430925ec5aac6edbbf52d74f10c665da43 (patch) | |
tree | 76d648e13938a0547e441ebc93ab9eb062d118b3 /src/qt/guiutil.cpp | |
parent | 555fc0789d2191b7a323265bdc9b74d5938093ea (diff) | |
parent | 06ba9b300866f33e21512af9d7d2891ee1501bf4 (diff) |
Merge bitcoin-core/gui#163: Peer details: replace Direction with Connection Type
06ba9b300866f33e21512af9d7d2891ee1501bf4 rpc: move getpeerinfo connection_type help to correct place (Jon Atack)
c95fe6e38f542f9fe8ddb1522b5ff1cac17db4bf gui: improve connection type tooltip (Hennadii Stepanov)
2c19ba2e1d26e2077da8b469f44588c20af87e23 gui: replace Direction with Connection Type in peer details (Jon Atack)
7e2beab2d28d8ab039d9554744a11592a7d7dc76 gui: create GUIUtil::ConnectionTypeToQString utility function (Jon Atack)
Pull request description:

Closes #159.
ACKs for top commit:
hebasto:
re-ACK 06ba9b300866f33e21512af9d7d2891ee1501bf4, the tooltip content is organized as unordered list.
jarolrod:
re-ACK 06ba9b300866f33e21512af9d7d2891ee1501bf4
Tree-SHA512: 24f46494ceb42ed308e4a4f2a543dbc4f4e6409a6f738c145a9f16e175bf69d411cbc944a4fd969f1829d57644dfbc194182fa8d4e9e6bce82acbeca8c673748
Diffstat (limited to 'src/qt/guiutil.cpp')
-rw-r--r-- | src/qt/guiutil.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 8205b0506c..430ecd322f 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -764,6 +764,19 @@ QString NetworkToQString(Network net) assert(false); } +QString ConnectionTypeToQString(ConnectionType conn_type) +{ + switch (conn_type) { + case ConnectionType::INBOUND: return QObject::tr("Inbound"); + case ConnectionType::OUTBOUND_FULL_RELAY: return QObject::tr("Outbound Full Relay"); + case ConnectionType::BLOCK_RELAY: return QObject::tr("Outbound Block Relay"); + case ConnectionType::MANUAL: return QObject::tr("Outbound Manual"); + case ConnectionType::FEELER: return QObject::tr("Outbound Feeler"); + case ConnectionType::ADDR_FETCH: return QObject::tr("Outbound Address Fetch"); + } // no default case, so the compiler can warn about missing cases + assert(false); +} + QString formatDurationStr(int secs) { QStringList strList; |