mirror of https://github.com/xzeldon/htop.git
Enable "All CPUs" option
This commit is contained in:
parent
7d930a21f1
commit
c3d757f606
|
@ -37,7 +37,7 @@ AvailableMetersListBox* AvailableMetersListBox_new(Settings* settings, ListBox*
|
||||||
ListBox_setHeader(super, "Available meters");
|
ListBox_setHeader(super, "Available meters");
|
||||||
for (int i = 1; Meter_types[i]; i++) {
|
for (int i = 1; Meter_types[i]; i++) {
|
||||||
MeterType* type = Meter_types[i];
|
MeterType* type = Meter_types[i];
|
||||||
if (type != &CPUMeter && type != &AllCPUsMeter) {
|
if (type != &CPUMeter) {
|
||||||
ListBox_add(super, (Object*) ListItem_new(type->uiName, i << 16));
|
ListBox_add(super, (Object*) ListItem_new(type->uiName, i << 16));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
5
Meter.c
5
Meter.c
|
@ -219,7 +219,7 @@ inline static void Meter_displayToStringBuffer(Meter* this, char* buffer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Meter_setMode(Meter* this, int modeIndex) {
|
void Meter_setMode(Meter* this, int modeIndex) {
|
||||||
if (modeIndex == this->mode)
|
if (modeIndex > 0 && modeIndex == this->mode)
|
||||||
return;
|
return;
|
||||||
if (!modeIndex)
|
if (!modeIndex)
|
||||||
modeIndex = 1;
|
modeIndex = 1;
|
||||||
|
@ -227,7 +227,7 @@ void Meter_setMode(Meter* this, int modeIndex) {
|
||||||
if (this->type->mode == 0) {
|
if (this->type->mode == 0) {
|
||||||
this->draw = this->type->draw;
|
this->draw = this->type->draw;
|
||||||
} else {
|
} else {
|
||||||
if (modeIndex >= 1) {
|
assert(modeIndex >= 1);
|
||||||
if (this->drawBuffer)
|
if (this->drawBuffer)
|
||||||
free(this->drawBuffer);
|
free(this->drawBuffer);
|
||||||
this->drawBuffer = NULL;
|
this->drawBuffer = NULL;
|
||||||
|
@ -236,7 +236,6 @@ void Meter_setMode(Meter* this, int modeIndex) {
|
||||||
this->draw = mode->draw;
|
this->draw = mode->draw;
|
||||||
this->h = mode->h;
|
this->h = mode->h;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
this->mode = modeIndex;
|
this->mode = modeIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue