summaryrefslogtreecommitdiffstats
path: root/ScreenManager.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@redhat.com>2023-08-22 16:11:05 +1000
committerNathan Scott <nathans@redhat.com>2023-08-30 13:11:57 +1000
commit0f751e991d399769fb8d7800f7c4bccec2ca7f60 (patch)
tree34cd7838f7ebf51049816f9acb6a63cea175af06 /ScreenManager.c
parent68f4f10f012d11bd57bb725fe4113b2af937fc1d (diff)
Introduce Row and Table classes for screens beyond top-processes
This commit refactors the Process and ProcessList structures such they each have a new parent - Row and Table, respectively. These new classes handle screen updates relating to anything that could be represented in tabular format, e.g. cgroups, filesystems, etc, without us having to reimplement the display logic repeatedly for each new entity.
Diffstat (limited to 'ScreenManager.c')
-rw-r--r--ScreenManager.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ScreenManager.c b/ScreenManager.c
index a089eda1..e39c4f06 100644
--- a/ScreenManager.c
+++ b/ScreenManager.c
@@ -133,13 +133,14 @@ static void checkRecalculation(ScreenManager* this, double* oldTime, int* sortTi
*oldTime = newTime;
int oldUidDigits = Process_uidDigits;
if (!this->state->pauseUpdate && (*sortTimeout == 0 || host->settings->ss->treeView)) {
- host->pl->needsSort = true;
+ host->activeTable->needsSort = true;
*sortTimeout = 1;
}
// sample current values for system metrics and processes if not paused
Machine_scan(host);
if (!this->state->pauseUpdate)
- ProcessList_scan(host->pl);
+ Machine_scanTables(host);
+
// always update header, especially to avoid gaps in graph meters
Header_updateData(this->header);
// force redraw if the number of UID digits was changed
@@ -149,7 +150,7 @@ static void checkRecalculation(ScreenManager* this, double* oldTime, int* sortTi
*redraw = true;
}
if (*redraw) {
- ProcessList_rebuildPanel(host->pl);
+ Table_rebuildPanel(host->activeTable);
if (!this->state->hideMeters)
Header_draw(this->header);
}