aboutsummaryrefslogtreecommitdiff
path: root/src/qt/guiutil.cpp
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2020-12-24 11:01:07 +0100
committerJon Atack <jon@atack.com>2020-12-27 14:29:24 +0100
commit0d5613f9ded846aa20a95c757672e9560c664c4c (patch)
treea127c20f1c30cd730902b947d82549c6193a2815 /src/qt/guiutil.cpp
parentaf9103cc792e17f35249f1d4cb30f0d6958ceb75 (diff)
gui: create GUIUtil::NetworkToQString() utility function
Diffstat (limited to 'src/qt/guiutil.cpp')
-rw-r--r--src/qt/guiutil.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp
index 53ffb27f50..88249c4e2e 100644
--- a/src/qt/guiutil.cpp
+++ b/src/qt/guiutil.cpp
@@ -749,6 +749,21 @@ QString boostPathToQString(const fs::path &path)
return QString::fromStdString(path.string());
}
+QString NetworkToQString(Network net)
+{
+ switch (net) {
+ case NET_UNROUTABLE: return QObject::tr("Unroutable");
+ case NET_IPV4: return "IPv4";
+ case NET_IPV6: return "IPv6";
+ case NET_ONION: return "Onion";
+ case NET_I2P: return "I2P";
+ case NET_CJDNS: return "CJDNS";
+ case NET_INTERNAL: return QObject::tr("Internal");
+ case NET_MAX: assert(false);
+ } // no default case, so the compiler can warn about missing cases
+ assert(false);
+}
+
QString formatDurationStr(int secs)
{
QStringList strList;