- introduced a SystemInfoHandler class used to watch for stuff when polling isn't needed.

- used it to add a count of running apps (not exactly the same as teams).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25012 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol
2008-04-17 22:04:18 +00:00
parent 03aaa278a5
commit 74158bb474
9 changed files with 220 additions and 4 deletions
+48
View File
@@ -21,6 +21,7 @@ const DataSource* kSources[] = {
new PortsDataSource(),
new ThreadsDataSource(),
new TeamsDataSource(),
new RunningAppsDataSource(),
new CPUUsageDataSource(),
new CPUCombinedUsageDataSource(),
new NetworkUsageDataSource(true),
@@ -530,6 +531,53 @@ TeamsDataSource::AdaptiveScale() const
// #pragma mark -
RunningAppsDataSource::RunningAppsDataSource()
{
SystemInfo info;
fMinimum = 0;
fMaximum = info.MaxRunningApps();
fColor = (rgb_color){100, 150, 255};
}
RunningAppsDataSource::~RunningAppsDataSource()
{
}
DataSource*
RunningAppsDataSource::Copy() const
{
return new RunningAppsDataSource(*this);
}
int64
RunningAppsDataSource::NextValue(SystemInfo& info)
{
return info.UsedRunningApps();
}
const char*
RunningAppsDataSource::Label() const
{
return "Running Applications";
}
bool
RunningAppsDataSource::AdaptiveScale() const
{
return true;
}
// #pragma mark -
CPUUsageDataSource::CPUUsageDataSource(int32 cpu)
:
fPreviousActive(0),