Add longer descriptions to available meters.

This commit is contained in:
Hisham Muhammad 2015-02-03 22:31:44 +01:00
parent f5f29ceeb9
commit 14bd77c5f4
6 changed files with 15 additions and 4 deletions

View File

@ -104,7 +104,8 @@ AvailableMetersPanel* AvailableMetersPanel_new(Settings* settings, Header* heade
for (int i = 1; Platform_meterTypes[i]; i++) {
MeterClass* type = Platform_meterTypes[i];
if (type != &CPUMeter_class) {
Panel_add(super, (Object*) ListItem_new(type->uiName, i << 16));
const char* label = type->description ? type->description : type->uiName;
Panel_add(super, (Object*) ListItem_new(label, i << 16));
}
}
MeterClass* type = &CPUMeter_class;

View File

@ -222,6 +222,7 @@ MeterClass AllCPUsMeter_class = {
.attributes = CPUMeter_attributes,
.name = "AllCPUs",
.uiName = "CPUs (1/1)",
.description = "CPUs (1/1): all CPUs",
.caption = "CPU",
.draw = SingleColCPUsMeter_draw,
.init = AllCPUsMeter_init,
@ -240,6 +241,7 @@ MeterClass AllCPUs2Meter_class = {
.attributes = CPUMeter_attributes,
.name = "AllCPUs2",
.uiName = "CPUs (1&2/2)",
.description = "CPUs (1&2/2): all CPUs in 2 shorter columns",
.caption = "CPU",
.draw = DualColCPUsMeter_draw,
.init = AllCPUsMeter_init,
@ -258,6 +260,7 @@ MeterClass LeftCPUsMeter_class = {
.attributes = CPUMeter_attributes,
.name = "LeftCPUs",
.uiName = "CPUs (1/2)",
.description = "CPUs (1/2): first half of list",
.caption = "CPU",
.draw = SingleColCPUsMeter_draw,
.init = AllCPUsMeter_init,
@ -276,6 +279,7 @@ MeterClass RightCPUsMeter_class = {
.attributes = CPUMeter_attributes,
.name = "RightCPUs",
.uiName = "CPUs (2/2)",
.description = "CPUs (2/2): second half of list",
.caption = "CPU",
.draw = SingleColCPUsMeter_draw,
.init = AllCPUsMeter_init,
@ -293,6 +297,7 @@ MeterClass LeftCPUs2Meter_class = {
.total = 100.0,
.attributes = CPUMeter_attributes,
.name = "LeftCPUs2",
.description = "CPUs (1&2/4): first half in 2 shorter columns",
.uiName = "CPUs (1&2/4)",
.caption = "CPU",
.draw = DualColCPUsMeter_draw,
@ -312,6 +317,7 @@ MeterClass RightCPUs2Meter_class = {
.attributes = CPUMeter_attributes,
.name = "RightCPUs2",
.uiName = "CPUs (3&4/4)",
.description = "CPUs (3&4/4): second half in 2 shorter columns",
.caption = "CPU",
.draw = DualColCPUsMeter_draw,
.init = AllCPUsMeter_init,

View File

@ -65,6 +65,7 @@ MeterClass LoadAverageMeter_class = {
.attributes = LoadAverageMeter_attributes,
.name = "LoadAverage",
.uiName = "Load average",
.description = "Load averages: 15 minutes, 5 minutes, 1 minute",
.caption = "Load average: "
};
@ -80,5 +81,6 @@ MeterClass LoadMeter_class = {
.attributes = LoadMeter_attributes,
.name = "Load",
.uiName = "Load",
.description = "Load: average of ready processes in the last minute",
.caption = "Load: "
};

View File

@ -62,7 +62,7 @@ MeterClass MemoryMeter_class = {
.maxItems = 3,
.total = 100.0,
.attributes = MemoryMeter_attributes,
"Memory",
"Memory",
"Mem"
.name = "Memory",
.uiName = "Memory",
.caption = "Mem"
};

View File

@ -51,6 +51,7 @@ typedef struct MeterClass_ {
const char* name;
const char* uiName;
const char* caption;
const char* description;
const char maxItems;
char curItems;
} MeterClass;

View File

@ -38,6 +38,7 @@ typedef struct MeterClass_ {
const char* name;
const char* uiName;
const char* caption;
const char* description;
const char maxItems;
char curItems;
} MeterClass;