Drop references to 'Process' in generic screen code

Prepare the way for making screen tabs more generalised,
able to cater to entities other than processes.

'actionTogglePauseProcessUpdate' -> 'actionTogglePauseUpdate'
'pauseProcessUpdate' -> 'pauseUpdate'
'hideProcessSelection' -> 'hideSelection'
'hideProcessSelection' -> 'hideSelection'

Signed-off-by: Sohaib Mohamed <sohaib.amhmd@gmail.com>
portage
Nathan Scott 3 years ago
parent 8a8df71f6f
commit e4ebe18b67
  1. 6
      Action.c
  2. 6
      Action.h
  3. 4
      CommandLine.c
  4. 6
      MainPanel.c
  5. 6
      ScreenManager.c

@ -568,8 +568,8 @@ static Htop_Reaction actionRedraw(ATTR_UNUSED State* st) {
return HTOP_REFRESH | HTOP_REDRAW_BAR;
}
static Htop_Reaction actionTogglePauseProcessUpdate(State* st) {
st->pauseProcessUpdate = !st->pauseProcessUpdate;
static Htop_Reaction actionTogglePauseUpdate(State* st) {
st->pauseUpdate = !st->pauseUpdate;
return HTOP_REFRESH | HTOP_REDRAW_BAR;
}
@ -836,7 +836,7 @@ void Action_setBindings(Htop_Action* keys) {
#ifdef SCHEDULER_SUPPORT
keys['Y'] = actionSetSchedPolicy;
#endif
keys['Z'] = actionTogglePauseProcessUpdate;
keys['Z'] = actionTogglePauseUpdate;
keys['['] = actionLowerPriority;
keys['\014'] = actionRedraw; // Ctrl+L
keys['\177'] = actionCollapseIntoParent;

@ -41,13 +41,13 @@ typedef struct State_ {
ProcessList* pl;
struct MainPanel_* mainPanel;
Header* header;
bool pauseProcessUpdate;
bool hideProcessSelection;
bool pauseUpdate;
bool hideSelection;
bool hideMeters;
} State;
static inline bool State_hideFunctionBar(const State* st) {
return st->settings->hideFunctionBar == 2 || (st->settings->hideFunctionBar == 1 && st->hideProcessSelection);
return st->settings->hideFunctionBar == 2 || (st->settings->hideFunctionBar == 1 && st->hideSelection);
}
typedef Htop_Reaction (*Htop_Action)(State* st);

@ -372,8 +372,8 @@ int CommandLine_run(int argc, char** argv) {
.pl = pl,
.mainPanel = panel,
.header = header,
.pauseProcessUpdate = false,
.hideProcessSelection = false,
.pauseUpdate = false,
.hideSelection = false,
.hideMeters = false,
};

@ -70,7 +70,7 @@ static HandlerResult MainPanel_eventHandler(Panel* super, int ch) {
needReset = false;
#endif
if (needReset)
this->state->hideProcessSelection = false;
this->state->hideSelection = false;
Settings* settings = this->state->settings;
ScreenSettings* ss = settings->ss;
@ -107,7 +107,7 @@ static HandlerResult MainPanel_eventHandler(Panel* super, int ch) {
}
result = HANDLED;
} else if (ch == 27) {
this->state->hideProcessSelection = true;
this->state->hideSelection = true;
return HANDLED;
} else if (ch != ERR && ch > 0 && ch < KEY_MAX && this->keys[ch]) {
reaction |= (this->keys[ch])(this->state);
@ -190,7 +190,7 @@ static void MainPanel_drawFunctionBar(Panel* super, bool hideFunctionBar) {
return;
IncSet_drawBar(this->inc, CRT_colors[FUNCTION_BAR]);
if (this->state->pauseProcessUpdate) {
if (this->state->pauseUpdate) {
FunctionBar_append("PAUSED", CRT_colors[PAUSED]);
}
}

@ -131,12 +131,12 @@ static void checkRecalculation(ScreenManager* this, double* oldTime, int* sortTi
if (*rescan) {
*oldTime = newTime;
int oldUidDigits = Process_uidDigits;
if (!this->state->pauseProcessUpdate && (*sortTimeout == 0 || this->settings->ss->treeView)) {
if (!this->state->pauseUpdate && (*sortTimeout == 0 || this->settings->ss->treeView)) {
pl->needsSort = true;
*sortTimeout = 1;
}
// scan processes first - some header values are calculated there
ProcessList_scan(pl, this->state->pauseProcessUpdate);
ProcessList_scan(pl, this->state->pauseUpdate);
// always update header, especially to avoid gaps in graph meters
Header_updateData(this->header);
// force redraw if the number of UID digits was changed
@ -206,7 +206,7 @@ static void ScreenManager_drawPanels(ScreenManager* this, int focus, bool force_
Panel_draw(panel,
force_redraw,
i == focus,
panel != (Panel*)this->state->mainPanel || !this->state->hideProcessSelection,
panel != (Panel*)this->state->mainPanel || !this->state->hideSelection,
State_hideFunctionBar(this->state));
mvvline(panel->y, panel->x + panel->w, ' ', panel->h + (State_hideFunctionBar(this->state) ? 1 : 0));
}

Loading…
Cancel
Save