summaryrefslogtreecommitdiffstats
path: root/htop.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2015-01-23 03:08:21 -0200
committerHisham Muhammad <hisham@gobolinux.org>2015-01-23 03:08:21 -0200
commitc2108e5a482dfb8760849bb01264ed4bdb9f604f (patch)
tree29bd336760c5ca9cbebed5e4a1e007642064cbc4 /htop.c
parent3383d8e5561dfc6fb2b65e0a194df94ccb5e08af (diff)
Another mega-patch for the refactoring process.
Kinda runs, but functionality from the original main loop is still missing. Patience.
Diffstat (limited to 'htop.c')
-rw-r--r--htop.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/htop.c b/htop.c
index bb948b80..ef3182de 100644
--- a/htop.c
+++ b/htop.c
@@ -188,10 +188,13 @@ int main(int argc, char** argv) {
UsersTable* ut = UsersTable_new();
ProcessList* pl = ProcessList_new(ut, flags.pidWhiteList, flags.userId);
- Header* header = Header_new(pl, 2);
Settings* settings = Settings_new(pl->cpuCount);
pl->settings = settings;
+ Header* header = Header_new(pl, settings, 2);
+
+ Header_populateFromSettings(header);
+
if (flags.delay != -1)
settings->delay = flags.delay;
if (!flags.useColors)
@@ -225,8 +228,8 @@ int main(int argc, char** argv) {
};
MainPanel_setState(panel, &state);
- ScreenManager* scr = ScreenManager_new(0, 0, 0, -1, HORIZONTAL, header, settings, true);
- ScreenManager_add(scr, (Panel*) panel, defaultBar, 0);
+ ScreenManager* scr = ScreenManager_new(0, header->height, 0, -1, HORIZONTAL, header, settings, true);
+ ScreenManager_add(scr, (Panel*) panel, defaultBar, -1);
ProcessList_scan(pl);
millisleep(75);
@@ -265,7 +268,7 @@ int main(int argc, char** argv) {
double newTime = ((double)tv.tv_sec * 10) + ((double)tv.tv_usec / 100000);
bool timeToRecalculate = (newTime - oldTime > settings->delay);
if (newTime < oldTime) timeToRecalculate = true; // clock was adjusted?
- int following = follow ? Action_selectedPid(panel) : -1;
+ int following = follow ? MainPanel_selectedPid((MainPanel*)panel) : -1;
if (timeToRecalculate) {
Header_draw(header);
oldTime = newTime;

© 2014-2024 Faster IT GmbH | imprint | privacy policy