mirror of https://github.com/xzeldon/htop.git
Add longer descriptions to available meters.
This commit is contained in:
parent
f5f29ceeb9
commit
14bd77c5f4
|
@ -104,7 +104,8 @@ AvailableMetersPanel* AvailableMetersPanel_new(Settings* settings, Header* heade
|
||||||
for (int i = 1; Platform_meterTypes[i]; i++) {
|
for (int i = 1; Platform_meterTypes[i]; i++) {
|
||||||
MeterClass* type = Platform_meterTypes[i];
|
MeterClass* type = Platform_meterTypes[i];
|
||||||
if (type != &CPUMeter_class) {
|
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;
|
MeterClass* type = &CPUMeter_class;
|
||||||
|
|
|
@ -222,6 +222,7 @@ MeterClass AllCPUsMeter_class = {
|
||||||
.attributes = CPUMeter_attributes,
|
.attributes = CPUMeter_attributes,
|
||||||
.name = "AllCPUs",
|
.name = "AllCPUs",
|
||||||
.uiName = "CPUs (1/1)",
|
.uiName = "CPUs (1/1)",
|
||||||
|
.description = "CPUs (1/1): all CPUs",
|
||||||
.caption = "CPU",
|
.caption = "CPU",
|
||||||
.draw = SingleColCPUsMeter_draw,
|
.draw = SingleColCPUsMeter_draw,
|
||||||
.init = AllCPUsMeter_init,
|
.init = AllCPUsMeter_init,
|
||||||
|
@ -240,6 +241,7 @@ MeterClass AllCPUs2Meter_class = {
|
||||||
.attributes = CPUMeter_attributes,
|
.attributes = CPUMeter_attributes,
|
||||||
.name = "AllCPUs2",
|
.name = "AllCPUs2",
|
||||||
.uiName = "CPUs (1&2/2)",
|
.uiName = "CPUs (1&2/2)",
|
||||||
|
.description = "CPUs (1&2/2): all CPUs in 2 shorter columns",
|
||||||
.caption = "CPU",
|
.caption = "CPU",
|
||||||
.draw = DualColCPUsMeter_draw,
|
.draw = DualColCPUsMeter_draw,
|
||||||
.init = AllCPUsMeter_init,
|
.init = AllCPUsMeter_init,
|
||||||
|
@ -258,6 +260,7 @@ MeterClass LeftCPUsMeter_class = {
|
||||||
.attributes = CPUMeter_attributes,
|
.attributes = CPUMeter_attributes,
|
||||||
.name = "LeftCPUs",
|
.name = "LeftCPUs",
|
||||||
.uiName = "CPUs (1/2)",
|
.uiName = "CPUs (1/2)",
|
||||||
|
.description = "CPUs (1/2): first half of list",
|
||||||
.caption = "CPU",
|
.caption = "CPU",
|
||||||
.draw = SingleColCPUsMeter_draw,
|
.draw = SingleColCPUsMeter_draw,
|
||||||
.init = AllCPUsMeter_init,
|
.init = AllCPUsMeter_init,
|
||||||
|
@ -276,6 +279,7 @@ MeterClass RightCPUsMeter_class = {
|
||||||
.attributes = CPUMeter_attributes,
|
.attributes = CPUMeter_attributes,
|
||||||
.name = "RightCPUs",
|
.name = "RightCPUs",
|
||||||
.uiName = "CPUs (2/2)",
|
.uiName = "CPUs (2/2)",
|
||||||
|
.description = "CPUs (2/2): second half of list",
|
||||||
.caption = "CPU",
|
.caption = "CPU",
|
||||||
.draw = SingleColCPUsMeter_draw,
|
.draw = SingleColCPUsMeter_draw,
|
||||||
.init = AllCPUsMeter_init,
|
.init = AllCPUsMeter_init,
|
||||||
|
@ -293,6 +297,7 @@ MeterClass LeftCPUs2Meter_class = {
|
||||||
.total = 100.0,
|
.total = 100.0,
|
||||||
.attributes = CPUMeter_attributes,
|
.attributes = CPUMeter_attributes,
|
||||||
.name = "LeftCPUs2",
|
.name = "LeftCPUs2",
|
||||||
|
.description = "CPUs (1&2/4): first half in 2 shorter columns",
|
||||||
.uiName = "CPUs (1&2/4)",
|
.uiName = "CPUs (1&2/4)",
|
||||||
.caption = "CPU",
|
.caption = "CPU",
|
||||||
.draw = DualColCPUsMeter_draw,
|
.draw = DualColCPUsMeter_draw,
|
||||||
|
@ -312,6 +317,7 @@ MeterClass RightCPUs2Meter_class = {
|
||||||
.attributes = CPUMeter_attributes,
|
.attributes = CPUMeter_attributes,
|
||||||
.name = "RightCPUs2",
|
.name = "RightCPUs2",
|
||||||
.uiName = "CPUs (3&4/4)",
|
.uiName = "CPUs (3&4/4)",
|
||||||
|
.description = "CPUs (3&4/4): second half in 2 shorter columns",
|
||||||
.caption = "CPU",
|
.caption = "CPU",
|
||||||
.draw = DualColCPUsMeter_draw,
|
.draw = DualColCPUsMeter_draw,
|
||||||
.init = AllCPUsMeter_init,
|
.init = AllCPUsMeter_init,
|
||||||
|
|
|
@ -65,6 +65,7 @@ MeterClass LoadAverageMeter_class = {
|
||||||
.attributes = LoadAverageMeter_attributes,
|
.attributes = LoadAverageMeter_attributes,
|
||||||
.name = "LoadAverage",
|
.name = "LoadAverage",
|
||||||
.uiName = "Load average",
|
.uiName = "Load average",
|
||||||
|
.description = "Load averages: 15 minutes, 5 minutes, 1 minute",
|
||||||
.caption = "Load average: "
|
.caption = "Load average: "
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -80,5 +81,6 @@ MeterClass LoadMeter_class = {
|
||||||
.attributes = LoadMeter_attributes,
|
.attributes = LoadMeter_attributes,
|
||||||
.name = "Load",
|
.name = "Load",
|
||||||
.uiName = "Load",
|
.uiName = "Load",
|
||||||
|
.description = "Load: average of ready processes in the last minute",
|
||||||
.caption = "Load: "
|
.caption = "Load: "
|
||||||
};
|
};
|
||||||
|
|
|
@ -62,7 +62,7 @@ MeterClass MemoryMeter_class = {
|
||||||
.maxItems = 3,
|
.maxItems = 3,
|
||||||
.total = 100.0,
|
.total = 100.0,
|
||||||
.attributes = MemoryMeter_attributes,
|
.attributes = MemoryMeter_attributes,
|
||||||
"Memory",
|
.name = "Memory",
|
||||||
"Memory",
|
.uiName = "Memory",
|
||||||
"Mem"
|
.caption = "Mem"
|
||||||
};
|
};
|
||||||
|
|
1
Meter.c
1
Meter.c
|
@ -51,6 +51,7 @@ typedef struct MeterClass_ {
|
||||||
const char* name;
|
const char* name;
|
||||||
const char* uiName;
|
const char* uiName;
|
||||||
const char* caption;
|
const char* caption;
|
||||||
|
const char* description;
|
||||||
const char maxItems;
|
const char maxItems;
|
||||||
char curItems;
|
char curItems;
|
||||||
} MeterClass;
|
} MeterClass;
|
||||||
|
|
1
Meter.h
1
Meter.h
|
@ -38,6 +38,7 @@ typedef struct MeterClass_ {
|
||||||
const char* name;
|
const char* name;
|
||||||
const char* uiName;
|
const char* uiName;
|
||||||
const char* caption;
|
const char* caption;
|
||||||
|
const char* description;
|
||||||
const char maxItems;
|
const char maxItems;
|
||||||
char curItems;
|
char curItems;
|
||||||
} MeterClass;
|
} MeterClass;
|
||||||
|
|
Loading…
Reference in New Issue