ActivityMonitor: use string_for_rate
* Network speed was previously always shown as Kb/s, now it can switch to Mb/s when needed. * Fixes #11053. Signed-off-by: Adrien Destugues <[email protected]>
This commit is contained in:
committed by
Adrien Destugues
parent
2098842047
commit
a15d13d9bb
@@ -12,6 +12,7 @@
|
|||||||
#include <Catalog.h>
|
#include <Catalog.h>
|
||||||
#include <OS.h>
|
#include <OS.h>
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
|
#include <StringForRate.h>
|
||||||
|
|
||||||
#include "SystemInfo.h"
|
#include "SystemInfo.h"
|
||||||
|
|
||||||
@@ -1225,7 +1226,7 @@ void
|
|||||||
NetworkUsageDataSource::Print(BString& text, int64 value) const
|
NetworkUsageDataSource::Print(BString& text, int64 value) const
|
||||||
{
|
{
|
||||||
char buffer[32];
|
char buffer[32];
|
||||||
snprintf(buffer, sizeof(buffer), B_TRANSLATE("%.1f KiB/s"), value / 1024.0);
|
string_for_rate(value, buffer, sizeof(buffer));
|
||||||
|
|
||||||
text = buffer;
|
text = buffer;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
SubDir HAIKU_TOP src apps activitymonitor ;
|
SubDir HAIKU_TOP src apps activitymonitor ;
|
||||||
|
|
||||||
UsePrivateHeaders interface system ;
|
UsePrivateHeaders interface shared system ;
|
||||||
|
|
||||||
Application ActivityMonitor :
|
Application ActivityMonitor :
|
||||||
ActivityMonitor.cpp
|
ActivityMonitor.cpp
|
||||||
|
|||||||
Reference in New Issue
Block a user