@@ -474,9 +474,9 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
474
474
const QString list{" <ul><li>" + Join (CONNECTION_TYPE_DOC, QString (" </li><li>" )) + " </li></ul>" };
475
475
ui->peerConnectionTypeLabel ->setToolTip (ui->peerConnectionTypeLabel ->toolTip ().arg (list));
476
476
const QString hb_list{" <ul><li>\" "
477
- + tr ( " To " ) + " \" – " + tr (" we selected the peer for high bandwidth relay" ) + " </li><li>\" "
478
- + tr ( " From " ) + " \" – " + tr (" the peer selected us for high bandwidth relay" ) + " </li><li>\" "
479
- + tr ( " No " ) + " \" – " + tr (" no high bandwidth relay selected" ) + " </li></ul>" };
477
+ + tr_to + " \" – " + tr (" we selected the peer for high bandwidth relay" ) + " </li><li>\" "
478
+ + tr_from + " \" – " + tr (" the peer selected us for high bandwidth relay" ) + " </li><li>\" "
479
+ + tr_no + " \" – " + tr (" no high bandwidth relay selected" ) + " </li></ul>" };
480
480
ui->peerHighBandwidthLabel ->setToolTip (ui->peerHighBandwidthLabel ->toolTip ().arg (hb_list));
481
481
ui->dataDir ->setToolTip (ui->dataDir ->toolTip ().arg (QString (nonbreaking_hyphen) + " datadir" ));
482
482
ui->blocksDir ->setToolTip (ui->blocksDir ->toolTip ().arg (QString (nonbreaking_hyphen) + " blocksdir" ));
@@ -619,10 +619,10 @@ void RPCConsole::setClientModel(ClientModel *model, int bestblock_height, int64_
619
619
620
620
// create peer table context menu actions
621
621
QAction* disconnectAction = new QAction (tr (" &Disconnect" ), this );
622
- QAction* banAction1h = new QAction (tr ( " Ban for " ) + " " + tr (" 1 &hour" ), this );
623
- QAction* banAction24h = new QAction (tr ( " Ban for " ) + " " + tr (" 1 &day" ), this );
624
- QAction* banAction7d = new QAction (tr ( " Ban for " ) + " " + tr (" 1 &week" ), this );
625
- QAction* banAction365d = new QAction (tr ( " Ban for " ) + " " + tr (" 1 &year" ), this );
622
+ QAction* banAction1h = new QAction (tr_ban_for + " " + tr (" 1 &hour" ), this );
623
+ QAction* banAction24h = new QAction (tr_ban_for + " " + tr (" 1 &day" ), this );
624
+ QAction* banAction7d = new QAction (tr_ban_for + " " + tr (" 1 &week" ), this );
625
+ QAction* banAction365d = new QAction (tr_ban_for + " " + tr (" 1 &year" ), this );
626
626
627
627
// create peer table context menu
628
628
peersTableContextMenu = new QMenu (this );
@@ -1114,14 +1114,14 @@ void RPCConsole::updateDetailWidget()
1114
1114
peerAddrDetails += " <br />" + tr (" via %1" ).arg (QString::fromStdString (stats->nodeStats .addrLocal ));
1115
1115
ui->peerHeading ->setText (peerAddrDetails);
1116
1116
ui->peerServices ->setText (GUIUtil::formatServicesStr (stats->nodeStats .nServices ));
1117
- ui->peerRelayTxes ->setText (stats->nodeStats .fRelayTxes ? tr ( " Yes " ) : tr ( " No " ) );
1117
+ ui->peerRelayTxes ->setText (stats->nodeStats .fRelayTxes ? tr_yes : tr_no );
1118
1118
QString bip152_hb_settings;
1119
- if (stats->nodeStats .m_bip152_highbandwidth_to ) bip152_hb_settings = tr ( " To " ) ;
1120
- if (stats->nodeStats .m_bip152_highbandwidth_from ) bip152_hb_settings += (bip152_hb_settings.isEmpty () ? tr ( " From " ) : QLatin1String (" /" ) + tr ( " From " ) );
1121
- if (bip152_hb_settings.isEmpty ()) bip152_hb_settings = tr ( " No " ) ;
1119
+ if (stats->nodeStats .m_bip152_highbandwidth_to ) bip152_hb_settings = tr_to ;
1120
+ if (stats->nodeStats .m_bip152_highbandwidth_from ) bip152_hb_settings += (bip152_hb_settings.isEmpty () ? tr_from : QLatin1String (" /" ) + tr_from );
1121
+ if (bip152_hb_settings.isEmpty ()) bip152_hb_settings = tr_no ;
1122
1122
ui->peerHighBandwidth ->setText (bip152_hb_settings);
1123
- ui->peerLastSend ->setText (stats->nodeStats .nLastSend ? GUIUtil::formatDurationStr (GetSystemTimeInSeconds () - stats->nodeStats .nLastSend ) : tr ( " never " ) );
1124
- ui->peerLastRecv ->setText (stats->nodeStats .nLastRecv ? GUIUtil::formatDurationStr (GetSystemTimeInSeconds () - stats->nodeStats .nLastRecv ) : tr ( " never " ) );
1123
+ ui->peerLastSend ->setText (stats->nodeStats .nLastSend ? GUIUtil::formatDurationStr (GetSystemTimeInSeconds () - stats->nodeStats .nLastSend ) : tr_never );
1124
+ ui->peerLastRecv ->setText (stats->nodeStats .nLastRecv ? GUIUtil::formatDurationStr (GetSystemTimeInSeconds () - stats->nodeStats .nLastRecv ) : tr_never );
1125
1125
ui->peerBytesSent ->setText (GUIUtil::formatBytes (stats->nodeStats .nSendBytes ));
1126
1126
ui->peerBytesRecv ->setText (GUIUtil::formatBytes (stats->nodeStats .nRecvBytes ));
1127
1127
ui->peerConnTime ->setText (GUIUtil::formatDurationStr (GetSystemTimeInSeconds () - stats->nodeStats .nTimeConnected ));
@@ -1133,31 +1133,31 @@ void RPCConsole::updateDetailWidget()
1133
1133
ui->peerConnectionType ->setText (GUIUtil::ConnectionTypeToQString (stats->nodeStats .m_conn_type , /* prepend_direction */ true ));
1134
1134
ui->peerNetwork ->setText (GUIUtil::NetworkToQString (stats->nodeStats .m_network ));
1135
1135
if (stats->nodeStats .m_permissionFlags == PF_NONE) {
1136
- ui->peerPermissions ->setText (tr ( " N/A " ) );
1136
+ ui->peerPermissions ->setText (tr_na );
1137
1137
} else {
1138
1138
QStringList permissions;
1139
1139
for (const auto & permission : NetPermissions::ToStrings (stats->nodeStats .m_permissionFlags )) {
1140
1140
permissions.append (QString::fromStdString (permission));
1141
1141
}
1142
1142
ui->peerPermissions ->setText (permissions.join (" & " ));
1143
1143
}
1144
- ui->peerMappedAS ->setText (stats->nodeStats .m_mapped_as != 0 ? QString::number (stats->nodeStats .m_mapped_as ) : tr ( " N/A " ) );
1144
+ ui->peerMappedAS ->setText (stats->nodeStats .m_mapped_as != 0 ? QString::number (stats->nodeStats .m_mapped_as ) : tr_na );
1145
1145
1146
1146
// This check fails for example if the lock was busy and
1147
1147
// nodeStateStats couldn't be fetched.
1148
1148
if (stats->fNodeStateStatsAvailable ) {
1149
1149
// Sync height is init to -1
1150
- if (stats->nodeStateStats .nSyncHeight > -1 )
1150
+ if (stats->nodeStateStats .nSyncHeight > -1 ) {
1151
1151
ui->peerSyncHeight ->setText (QString (" %1" ).arg (stats->nodeStateStats .nSyncHeight ));
1152
- else
1153
- ui->peerSyncHeight ->setText (tr ( " Unknown " ) );
1154
-
1152
+ } else {
1153
+ ui->peerSyncHeight ->setText (tr_unknown );
1154
+ }
1155
1155
// Common height is init to -1
1156
- if (stats->nodeStateStats .nCommonHeight > -1 )
1156
+ if (stats->nodeStateStats .nCommonHeight > -1 ) {
1157
1157
ui->peerCommonHeight ->setText (QString (" %1" ).arg (stats->nodeStateStats .nCommonHeight ));
1158
- else
1159
- ui->peerCommonHeight ->setText (tr ( " Unknown " ) );
1160
-
1158
+ } else {
1159
+ ui->peerCommonHeight ->setText (tr_unknown );
1160
+ }
1161
1161
ui->peerHeight ->setText (QString::number (stats->nodeStateStats .m_starting_height ));
1162
1162
ui->peerPingWait ->setText (GUIUtil::formatPingTime (stats->nodeStateStats .m_ping_wait_usec ));
1163
1163
}
0 commit comments