File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -777,6 +777,19 @@ QString ConnectionTypeToQString(ConnectionType conn_type)
777777 assert (false );
778778}
779779
780+ QString ConnectionTypeToShortQString (ConnectionType conn_type)
781+ {
782+ switch (conn_type) {
783+ case ConnectionType::INBOUND: return " " ;
784+ case ConnectionType::OUTBOUND_FULL_RELAY: return QObject::tr (" Full Relay" );
785+ case ConnectionType::BLOCK_RELAY: return QObject::tr (" Block Relay" );
786+ case ConnectionType::MANUAL: return QObject::tr (" Manual" );
787+ case ConnectionType::FEELER: return QObject::tr (" Feeler" );
788+ case ConnectionType::ADDR_FETCH: return QObject::tr (" Address Fetch" );
789+ } // no default case, so the compiler can warn about missing cases
790+ assert (false );
791+ }
792+
780793QString formatDurationStr (int secs)
781794{
782795 QStringList strList;
Original file line number Diff line number Diff line change @@ -232,6 +232,9 @@ namespace GUIUtil
232232 /* * Convert enum ConnectionType to QString */
233233 QString ConnectionTypeToQString (ConnectionType conn_type);
234234
235+ /* * Convert enum ConnectionType to short QString (type only, without direction) */
236+ QString ConnectionTypeToShortQString (ConnectionType conn_type);
237+
235238 /* * Convert seconds into a QString with days, hours, mins, secs */
236239 QString formatDurationStr (int secs);
237240
You can’t perform that action at this time.
0 commit comments