RPCConsole::updateDetailWidget: convert strings to translated strings

and in the touched lines:

- replace 2 occurrences of `== ""` with `isEmpty()`

- replace an unneeded `+=` with `=`
pull/21383/head
Jon Atack 4 years ago
parent e49117470b
commit 0f035c12fb
No known key found for this signature in database
GPG Key ID: 4F5721B3D0E3921D

@ -1114,11 +1114,11 @@ void RPCConsole::updateDetailWidget()
peerAddrDetails += "<br />" + tr("via %1").arg(QString::fromStdString(stats->nodeStats.addrLocal)); peerAddrDetails += "<br />" + tr("via %1").arg(QString::fromStdString(stats->nodeStats.addrLocal));
ui->peerHeading->setText(peerAddrDetails); ui->peerHeading->setText(peerAddrDetails);
ui->peerServices->setText(GUIUtil::formatServicesStr(stats->nodeStats.nServices)); ui->peerServices->setText(GUIUtil::formatServicesStr(stats->nodeStats.nServices));
ui->peerRelayTxes->setText(stats->nodeStats.fRelayTxes ? "Yes" : "No"); ui->peerRelayTxes->setText(stats->nodeStats.fRelayTxes ? tr("Yes") : tr("No"));
QString bip152_hb_settings; QString bip152_hb_settings;
if (stats->nodeStats.m_bip152_highbandwidth_to) bip152_hb_settings += "To"; if (stats->nodeStats.m_bip152_highbandwidth_to) bip152_hb_settings = tr("To");
if (stats->nodeStats.m_bip152_highbandwidth_from) bip152_hb_settings += (bip152_hb_settings == "" ? "From" : "/From"); if (stats->nodeStats.m_bip152_highbandwidth_from) bip152_hb_settings += (bip152_hb_settings.isEmpty() ? tr("From") : QLatin1Char('/') + tr("From"));
if (bip152_hb_settings == "") bip152_hb_settings = "No"; if (bip152_hb_settings.isEmpty()) bip152_hb_settings = tr("No");
ui->peerHighBandwidth->setText(bip152_hb_settings); ui->peerHighBandwidth->setText(bip152_hb_settings);
const int64_t time_now{GetSystemTimeInSeconds()}; const int64_t time_now{GetSystemTimeInSeconds()};
ui->peerConnTime->setText(GUIUtil::formatDurationStr(time_now - stats->nodeStats.nTimeConnected)); ui->peerConnTime->setText(GUIUtil::formatDurationStr(time_now - stats->nodeStats.nTimeConnected));

Loading…
Cancel
Save