@@ -935,18 +935,6 @@ void RPCConsole::on_sldGraphRange_valueChanged(int value)
935
935
setTrafficGraphRange (mins);
936
936
}
937
937
938
- QString RPCConsole::FormatBytes (quint64 bytes)
939
- {
940
- if (bytes < 1024 )
941
- return QString (tr (" %1 B" )).arg (bytes);
942
- if (bytes < 1024 * 1024 )
943
- return QString (tr (" %1 KB" )).arg (bytes / 1024 );
944
- if (bytes < 1024 * 1024 * 1024 )
945
- return QString (tr (" %1 MB" )).arg (bytes / 1024 / 1024 );
946
-
947
- return QString (tr (" %1 GB" )).arg (bytes / 1024 / 1024 / 1024 );
948
- }
949
-
950
938
void RPCConsole::setTrafficGraphRange (int mins)
951
939
{
952
940
ui->trafficGraph ->setGraphRangeMins (mins);
@@ -955,8 +943,8 @@ void RPCConsole::setTrafficGraphRange(int mins)
955
943
956
944
void RPCConsole::updateTrafficStats (quint64 totalBytesIn, quint64 totalBytesOut)
957
945
{
958
- ui->lblBytesIn ->setText (FormatBytes (totalBytesIn));
959
- ui->lblBytesOut ->setText (FormatBytes (totalBytesOut));
946
+ ui->lblBytesIn ->setText (GUIUtil::formatBytes (totalBytesIn));
947
+ ui->lblBytesOut ->setText (GUIUtil::formatBytes (totalBytesOut));
960
948
}
961
949
962
950
void RPCConsole::peerSelected (const QItemSelection &selected, const QItemSelection &deselected)
@@ -1050,8 +1038,8 @@ void RPCConsole::updateNodeDetail(const CNodeCombinedStats *stats)
1050
1038
ui->peerServices ->setText (GUIUtil::formatServicesStr (stats->nodeStats .nServices ));
1051
1039
ui->peerLastSend ->setText (stats->nodeStats .nLastSend ? GUIUtil::formatDurationStr (GetSystemTimeInSeconds () - stats->nodeStats .nLastSend ) : tr (" never" ));
1052
1040
ui->peerLastRecv ->setText (stats->nodeStats .nLastRecv ? GUIUtil::formatDurationStr (GetSystemTimeInSeconds () - stats->nodeStats .nLastRecv ) : tr (" never" ));
1053
- ui->peerBytesSent ->setText (FormatBytes (stats->nodeStats .nSendBytes ));
1054
- ui->peerBytesRecv ->setText (FormatBytes (stats->nodeStats .nRecvBytes ));
1041
+ ui->peerBytesSent ->setText (GUIUtil::formatBytes (stats->nodeStats .nSendBytes ));
1042
+ ui->peerBytesRecv ->setText (GUIUtil::formatBytes (stats->nodeStats .nRecvBytes ));
1055
1043
ui->peerConnTime ->setText (GUIUtil::formatDurationStr (GetSystemTimeInSeconds () - stats->nodeStats .nTimeConnected ));
1056
1044
ui->peerPingTime ->setText (GUIUtil::formatPingTime (stats->nodeStats .dPingTime ));
1057
1045
ui->peerPingWait ->setText (GUIUtil::formatPingTime (stats->nodeStats .dPingWait ));
0 commit comments