File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -749,6 +749,21 @@ QString boostPathToQString(const fs::path &path)
749749 return QString::fromStdString (path.string ());
750750}
751751
752+ QString NetworkToQString (Network net)
753+ {
754+ switch (net) {
755+ case NET_UNROUTABLE: return QObject::tr (" Unroutable" );
756+ case NET_IPV4: return " IPv4" ;
757+ case NET_IPV6: return " IPv6" ;
758+ case NET_ONION: return " Onion" ;
759+ case NET_I2P: return " I2P" ;
760+ case NET_CJDNS: return " CJDNS" ;
761+ case NET_INTERNAL: return QObject::tr (" Internal" );
762+ case NET_MAX: assert (false );
763+ } // no default case, so the compiler can warn about missing cases
764+ assert (false );
765+ }
766+
752767QString formatDurationStr (int secs)
753768{
754769 QStringList strList;
Original file line number Diff line number Diff line change 77
88#include < amount.h>
99#include < fs.h>
10+ #include < netaddress.h>
1011
1112#include < QEvent>
1213#include < QHeaderView>
@@ -224,6 +225,9 @@ namespace GUIUtil
224225 /* Convert OS specific boost path to QString through UTF-8 */
225226 QString boostPathToQString (const fs::path &path);
226227
228+ /* * Convert enum Network to QString */
229+ QString NetworkToQString (Network net);
230+
227231 /* Convert seconds into a QString with days, hours, mins, secs */
228232 QString formatDurationStr (int secs);
229233
You can’t perform that action at this time.
0 commit comments