mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 11:57:28 -03:00
gui: create GUIUtil::ConnectionTypeToQString utility function
This commit is contained in:
parent
9158d6f341
commit
7e2beab2d2
2 changed files with 18 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -7,17 +7,18 @@
|
|||
|
||||
#include <amount.h>
|
||||
#include <fs.h>
|
||||
#include <net.h>
|
||||
#include <netaddress.h>
|
||||
|
||||
#include <QEvent>
|
||||
#include <QHeaderView>
|
||||
#include <QItemDelegate>
|
||||
#include <QLabel>
|
||||
#include <QMessageBox>
|
||||
#include <QObject>
|
||||
#include <QProgressBar>
|
||||
#include <QString>
|
||||
#include <QTableView>
|
||||
#include <QLabel>
|
||||
|
||||
class QValidatedLineEdit;
|
||||
class SendCoinsRecipient;
|
||||
|
@ -228,6 +229,9 @@ namespace GUIUtil
|
|||
/** Convert enum Network to QString */
|
||||
QString NetworkToQString(Network net);
|
||||
|
||||
/** Convert enum ConnectionType to QString */
|
||||
QString ConnectionTypeToQString(ConnectionType conn_type);
|
||||
|
||||
/** Convert seconds into a QString with days, hours, mins, secs */
|
||||
QString formatDurationStr(int secs);
|
||||
|
||||
|
|
Loading…
Reference in a new issue