diff options
author | Jon Atack <jon@atack.com> | 2020-12-24 12:35:37 +0100 |
---|---|---|
committer | Jon Atack <jon@atack.com> | 2021-01-08 15:24:31 +0100 |
commit | 7e2beab2d28d8ab039d9554744a11592a7d7dc76 (patch) | |
tree | 5542229036810594b9a47362fee45f687ddc8d60 /src/qt/guiutil.cpp | |
parent | 9158d6f34153dc937e109d0e7486e956a26f20aa (diff) |
gui: create GUIUtil::ConnectionTypeToQString utility function
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; |