mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
Move FunctionBar inside Panel
This commit is contained in:
@ -13,8 +13,13 @@ in the source distribution for its full text.
|
||||
#include "ListItem.h"
|
||||
}*/
|
||||
|
||||
static const char* IOPriorityFunctions[] = {"Set ", "Cancel ", NULL};
|
||||
static const char* IOPriorityKeys[] = {"Enter", "Esc", NULL};
|
||||
static int IOPriorityEvents[] = {13, 27};
|
||||
|
||||
Panel* IOPriorityPanel_new(IOPriority currPrio) {
|
||||
Panel* this = Panel_new(1, 1, 1, 1, true, Class(ListItem));
|
||||
FunctionBar* fuBar = FunctionBar_new(IOPriorityFunctions, IOPriorityKeys, IOPriorityEvents);
|
||||
Panel* this = Panel_new(1, 1, 1, 1, true, Class(ListItem), fuBar);
|
||||
|
||||
Panel_setHeader(this, "IO Priority:");
|
||||
Panel_add(this, (Object*) ListItem_new("None (based on nice)", IOPriority_None));
|
||||
|
@ -46,8 +46,7 @@ static Htop_Reaction Platform_actionSetIOPriority(State* st) {
|
||||
if (!p) return HTOP_OK;
|
||||
IOPriority ioprio = p->ioPriority;
|
||||
Panel* ioprioPanel = IOPriorityPanel_new(ioprio);
|
||||
const char* fuFunctions[] = {"Set ", "Cancel ", NULL};
|
||||
void* set = Action_pickFromVector(st, ioprioPanel, 21, fuFunctions);
|
||||
void* set = Action_pickFromVector(st, ioprioPanel, 21);
|
||||
if (set) {
|
||||
IOPriority ioprio = IOPriorityPanel_getIOPriority(ioprioPanel);
|
||||
bool ok = MainPanel_foreachProcess((MainPanel*)panel, (MainPanel_ForeachProcessFn) LinuxProcess_setIOPriority, (size_t) ioprio, NULL);
|
||||
|
Reference in New Issue
Block a user