aboutsummaryrefslogtreecommitdiff
path: root/src/qt/guiutil.cpp
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2020-12-24 12:35:37 +0100
committerJon Atack <jon@atack.com>2021-01-08 15:24:31 +0100
commit7e2beab2d28d8ab039d9554744a11592a7d7dc76 (patch)
tree5542229036810594b9a47362fee45f687ddc8d60 /src/qt/guiutil.cpp
parent9158d6f34153dc937e109d0e7486e956a26f20aa (diff)
gui: create GUIUtil::ConnectionTypeToQString utility function
Diffstat (limited to 'src/qt/guiutil.cpp')
-rw-r--r--src/qt/guiutil.cpp13
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;