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.
<sigh>
I started to rename "Show sytem processes" to "Show all processes"
and included a GtkTreeModelFilter in between the GtkListStore and
GtkTreeView but nooooo... I had to write private code to sort the
columns. In fact the GtkTreeViewColumn class assumes the model to
be sortable but GtkTreeModelFilter is not, although it provides an
accessor function to the underlying model which is.
And not to mention that understanding GtkTreeViewColumn is a task
on its own! Having the code under the hand is the only exit.
</sigh>
The function pid_is_sleeping() is implement by the different OS
implementations and returns TRUE or FALSE. It is used in the tree view
context menu to show either the signal Stop or Continue.
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.
Fix one segfault where some processes like “ls” live very briefly and
those may be catched up but at the time to read the cmdline the process
tree already disappeared. Also terminate the cmdline with \0.
I ran the application on my netbook, which doesn't have /proc/<PID>/comm
files... The code has been updated to read the short command from the
buffer.
The code still uses scanf to parse the stat file, but the process name
is being cleansed so that it never fails. The name is read from the
“comm” file. It is still a truncated version of the name, and will
likely remain for very long like this. There is one solution, but since
the name isn't currently used inside the interface there is no point
wasting time.
On the Linux implementation, when a process name has a space in it the
sscanf function is unable to parse the line properly. This will have to
be changed, but in the meantime ignore such processes and avoid the
segfault, there are going to be Beta releases.
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.
Added a utility function that stores old jiffles inside a hash table in
order to be able to provide usage values of system and user time in
percentage.
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.
The statusbar is created since a separate widget class and has three
different labels (settable through properties) for CPU, memory and
number of processes. This makes it more convenient to change one or
another value and it gives a nicer look.
Changes touching the build:
- Bumped version to 0.5.0.
- Removed dependency on Xfce libs (it only depends on GTK+-2.0.)
- Updated Makefile with new source files.
- Build ChangeLog through a script (remove it from source tree.)
More generally speaking, the interface is build on top of a GtkBuilder
UI definition, with a personal GtkTreeView and a Settings GObject to
update the information shown on the interface on changes. All the code
is being written with GObjects which will make it a lot easier to
separate GUI code and system code.
Check for the lib kstat in the autoconf script.
Build with the correct file for Solaris in the automake script.
Fixed the xfce_err messages and switched to g_snprintf for the command strings.
Updated the TODO file.
Drop the po/LINGUAS file and substitute them directly inside the
configure script instead.
Update the version tag svn=>git and pass the project URL.
Add a module.xml file for cgit.