- move the percentage calculation to init_timeout(), use g_format_size() here too
- carry memory/swap used vs total all around
- make the XtmProcessStatusbar swap and memory properties strings instead of float
Based on a diff from Ján Sucan, thanks!
Note to translators: this changes some strings, mostly removing % in format printing
The functions send_signal_to_pid() and set_priority_to_pid() are using
POSIX functions and “should” be safe in task-manager.c. Still keep the
enumeration as a bridge between virtual values and real values, there is
no benefit removing them (wasting minutes) and it won't make the code
look better (or worse).
The functions have been removed from the Linux and BSD implementations.
Switched the get_hostname() get_owner_uid() public in task-manager.c,
the owner uid is needed in the tree view class in order to filter out
user processes from others.
Base signals and priorities are defined inside the task-manager.h file
to be reused as general values inside the interface. The different OS
implementations have to do the conversion from the enumeration to real
values.
The code to update the model has been moved inside the XtmTaskManager
class and this in order to enhance performance. In fact all the rows of
the model were udpdated everytime (150~ processes × 9 columns calls on
gtk_list_store_set per seconds) which represented a big CPU hog. Now
that the model is being updated within the same class that pulls the
processes information it is possible to run low check routines and
update only the rows that have updated information.
Also big surprise, the new tasks weren't added, well they did but not
the right data. The pointer's location was copied instead of the
pointer's content.
This commit is the second of an incremental serie. There will be other
commits with the information about tasks and the support for BSD and
Solaris once things are settled.
The TaskManager class is build with a new source task-manager-linux.c
that provides functions specific to the Linux implementation. It has
functions to read the usage of the memory/swap and the CPU.
Added the TaskManager class to hold system information and tasks.
Currently it provides username and hostname based on POSIX functions.
The Swap is now part of the system information and is being displayed in
the statusbar.