Quick clean up, update TODO, and display memory less than 1 MB
(Old svn revision: 5187)
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2008-08-02 Mike Massonnet <mmassonnet@xfce.org>
|
||||||
|
|
||||||
|
* Display memory less than 1 MB with two decimals like 0.00 MB
|
||||||
|
* Quick clean up
|
||||||
|
* Update TODO
|
||||||
|
|
||||||
2008-07-31 Mike Massonnet <mmassonnet@xfce.org>
|
2008-07-31 Mike Massonnet <mmassonnet@xfce.org>
|
||||||
|
|
||||||
* Apply patch for BSD support from Landry Breuil
|
* Apply patch for BSD support from Landry Breuil
|
||||||
|
|||||||
6
README
6
README
@@ -2,18 +2,18 @@
|
|||||||
************ xfce4-taskmanager ************
|
************ xfce4-taskmanager ************
|
||||||
*********************************************
|
*********************************************
|
||||||
|
|
||||||
xfce4-taskmanager is a small taskmanager based on the Xfce 4 libraries.
|
xfce4-taskmanager is a small taskmanager for the Xfce 4 desktop.
|
||||||
|
|
||||||
** Retrieving **
|
** Retrieving **
|
||||||
|
|
||||||
The latest version of xfce4-taskmanager can always be obtained from
|
The latest version of xfce4-taskmanager can always be obtained from
|
||||||
http://developer.berlios.de/projects/xfce-goodies/. Please check to
|
http://goodies.xfce.org/releases/xfce4-taskmanager/. Please check to
|
||||||
see if there is a newer version available before reporting bugs.
|
see if there is a newer version available before reporting bugs.
|
||||||
|
|
||||||
** Requirements **
|
** Requirements **
|
||||||
|
|
||||||
xfce4-taskmanager needs the Xfce 4's GUI library libxfcegui4.
|
xfce4-taskmanager needs the Xfce 4's GUI library libxfcegui4.
|
||||||
Xfce's core libraries can be obtained from http://xfce.org/.
|
Xfce's core libraries can be obtained from http://www.xfce.org/.
|
||||||
|
|
||||||
** Building **
|
** Building **
|
||||||
|
|
||||||
|
|||||||
7
TODO
7
TODO
@@ -1,4 +1,9 @@
|
|||||||
+ menu to check the columns to display instead of normal/more info
|
+ drop old gtk_tooltips
|
||||||
|
+ display mem < 0MB (we can't show in KB unless we rewrite the sort function
|
||||||
|
which I think is not worth the effort)
|
||||||
|
+ support multi core (show cpu usage per process)
|
||||||
|
+ move get_cpu_usage() out from functions.c, it is an os-dependant function
|
||||||
|
|
||||||
+ *BSD support with the 'kvm' files
|
+ *BSD support with the 'kvm' files
|
||||||
+ ability to switch to a tree-store
|
+ ability to switch to a tree-store
|
||||||
+ sending custom signals
|
+ sending custom signals
|
||||||
|
|||||||
@@ -2,6 +2,6 @@ xfce4-taskmanager.desktop.in
|
|||||||
src/callbacks.c
|
src/callbacks.c
|
||||||
src/functions.c
|
src/functions.c
|
||||||
src/interface.c
|
src/interface.c
|
||||||
src/taskmanager-linux.c
|
|
||||||
src/taskmanager-bsd.c
|
src/taskmanager-bsd.c
|
||||||
|
src/taskmanager-linux.c
|
||||||
src/main.c
|
src/main.c
|
||||||
|
|||||||
@@ -1,2 +1 @@
|
|||||||
src/menu-positions.c
|
src/menu-positions.c
|
||||||
src/xfce-taskmanager-linux.c
|
|
||||||
|
|||||||
@@ -31,9 +31,19 @@
|
|||||||
#include "functions.h"
|
#include "functions.h"
|
||||||
#include "interface.h"
|
#include "interface.h"
|
||||||
|
|
||||||
|
|
||||||
#include "taskmanager.h"
|
#include "taskmanager.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_SIGNAL_H
|
||||||
|
#include <signal.h>
|
||||||
|
#define SIGNAL_NO 0
|
||||||
|
#define SIGNAL_KILL SIGKILL
|
||||||
|
#define SIGNAL_TERM SIGINT
|
||||||
|
#define SIGNAL_CONT SIGCONT
|
||||||
|
#define SIGNAL_STOP SIGSTOP
|
||||||
|
#else
|
||||||
|
/* FIXME */
|
||||||
|
#endif
|
||||||
|
|
||||||
void on_preferences(GtkButton *button);
|
void on_preferences(GtkButton *button);
|
||||||
void on_information(GtkButton *button);
|
void on_information(GtkButton *button);
|
||||||
void on_show_info_toggled(GtkCheckMenuItem *menuitem, gint uid);
|
void on_show_info_toggled(GtkCheckMenuItem *menuitem, gint uid);
|
||||||
|
|||||||
@@ -20,13 +20,6 @@
|
|||||||
|
|
||||||
#include "interface.h"
|
#include "interface.h"
|
||||||
|
|
||||||
#define GLADE_HOOKUP_OBJECT(component,widget,name) \
|
|
||||||
g_object_set_data_full (G_OBJECT (component), name, \
|
|
||||||
gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref)
|
|
||||||
|
|
||||||
#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \
|
|
||||||
g_object_set_data (G_OBJECT (component), name, widget)
|
|
||||||
|
|
||||||
GtkWidget* create_main_window (void)
|
GtkWidget* create_main_window (void)
|
||||||
{
|
{
|
||||||
GtkWidget *window;
|
GtkWidget *window;
|
||||||
@@ -379,23 +372,29 @@ void show_about_dialog(void)
|
|||||||
NULL };
|
NULL };
|
||||||
|
|
||||||
about_dialog = gtk_about_dialog_new();
|
about_dialog = gtk_about_dialog_new();
|
||||||
gtk_about_dialog_set_name(GTK_ABOUT_DIALOG(about_dialog),
|
gtk_about_dialog_set_version(
|
||||||
PACKAGE_NAME);
|
GTK_ABOUT_DIALOG(about_dialog),
|
||||||
gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(about_dialog),
|
|
||||||
PACKAGE_VERSION);
|
PACKAGE_VERSION);
|
||||||
gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(about_dialog),
|
gtk_about_dialog_set_comments(
|
||||||
|
GTK_ABOUT_DIALOG(about_dialog),
|
||||||
_("Xfce4-Taskmanager is an easy to use taskmanager"));
|
_("Xfce4-Taskmanager is an easy to use taskmanager"));
|
||||||
gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(about_dialog),
|
gtk_about_dialog_set_website(
|
||||||
|
GTK_ABOUT_DIALOG(about_dialog),
|
||||||
"http://goodies.xfce.org/projects/applications/xfce4-taskmanager");
|
"http://goodies.xfce.org/projects/applications/xfce4-taskmanager");
|
||||||
gtk_about_dialog_set_logo_icon_name(GTK_ABOUT_DIALOG(about_dialog),
|
gtk_about_dialog_set_logo_icon_name(
|
||||||
|
GTK_ABOUT_DIALOG(about_dialog),
|
||||||
"xfce-system");
|
"xfce-system");
|
||||||
gtk_about_dialog_set_authors(GTK_ABOUT_DIALOG(about_dialog),
|
gtk_about_dialog_set_authors(
|
||||||
|
GTK_ABOUT_DIALOG(about_dialog),
|
||||||
authors);
|
authors);
|
||||||
gtk_about_dialog_set_translator_credits(GTK_ABOUT_DIALOG(about_dialog),
|
gtk_about_dialog_set_translator_credits(
|
||||||
|
GTK_ABOUT_DIALOG(about_dialog),
|
||||||
_("translator-credits"));
|
_("translator-credits"));
|
||||||
gtk_about_dialog_set_license(GTK_ABOUT_DIALOG(about_dialog),
|
gtk_about_dialog_set_license(
|
||||||
|
GTK_ABOUT_DIALOG(about_dialog),
|
||||||
xfce_get_license_text(XFCE_LICENSE_TEXT_GPL));
|
xfce_get_license_text(XFCE_LICENSE_TEXT_GPL));
|
||||||
gtk_about_dialog_set_copyright(GTK_ABOUT_DIALOG(about_dialog),
|
gtk_about_dialog_set_copyright(
|
||||||
|
GTK_ABOUT_DIALOG(about_dialog),
|
||||||
"Copyright \302\251 2005-2008 Johannes Zellner");
|
"Copyright \302\251 2005-2008 Johannes Zellner");
|
||||||
|
|
||||||
gtk_window_set_icon_name(GTK_WINDOW(about_dialog), GTK_STOCK_ABOUT);
|
gtk_window_set_icon_name(GTK_WINDOW(about_dialog), GTK_STOCK_ABOUT);
|
||||||
@@ -419,19 +418,32 @@ void change_list_store_view(void)
|
|||||||
|
|
||||||
void fill_list_item(gint i, GtkTreeIter *iter)
|
void fill_list_item(gint i, GtkTreeIter *iter)
|
||||||
{
|
{
|
||||||
|
struct task *task;
|
||||||
|
gchar *pid;
|
||||||
|
gchar *ppid;
|
||||||
|
gchar *state;
|
||||||
|
gchar *vsize;
|
||||||
|
gchar *rss;
|
||||||
|
gchar *name;
|
||||||
|
gchar *uname;
|
||||||
|
gchar *time;
|
||||||
|
gchar *prio;
|
||||||
|
|
||||||
if(iter != NULL)
|
if(iter != NULL)
|
||||||
{
|
{
|
||||||
struct task *task = &g_array_index(task_array, struct task, i);
|
task = &g_array_index(task_array, struct task, i);
|
||||||
|
|
||||||
gchar *pid = g_strdup_printf("%i", task->pid);
|
pid = g_strdup_printf("%i", task->pid);
|
||||||
gchar *ppid = g_strdup_printf("%i", task->ppid);
|
ppid = g_strdup_printf("%i", task->ppid);
|
||||||
gchar *state = g_strdup_printf("%s", task->state);
|
state = g_strdup_printf("%s", task->state);
|
||||||
gchar *vsize = g_strdup_printf("%i MB", task->vsize/1024/1024);
|
vsize = g_strdup_printf((task->vsize/1024/1024 > 0) ? "%.0f MB" : "%.2f MB",
|
||||||
gchar *rss = g_strdup_printf("%i MB", task->rss/1024/1024);
|
(gdouble)(task->vsize)/1024/1024);
|
||||||
gchar *name = g_strdup_printf("%s", task->name);
|
rss = g_strdup_printf((task->rss/1024/1024 > 0) ? "%.0f MB" : "%.2f MB",
|
||||||
gchar *uname = g_strdup_printf("%s", task->uname);
|
(gdouble)(task->rss)/1024/1024);
|
||||||
gchar *time = g_strdup_printf("%0d%%", (guint)task->time_percentage);
|
name = g_strdup_printf("%s", task->name);
|
||||||
gchar *prio = g_strdup_printf("%i", task->prio); /* my change */
|
uname = g_strdup_printf("%s", task->uname);
|
||||||
|
time = g_strdup_printf("%0d%%", (guint)task->time_percentage);
|
||||||
|
prio = g_strdup_printf("%i", task->prio); /* my change */
|
||||||
|
|
||||||
gtk_tree_store_set(GTK_TREE_STORE(list_store), iter, COLUMN_NAME, name, -1);
|
gtk_tree_store_set(GTK_TREE_STORE(list_store), iter, COLUMN_NAME, name, -1);
|
||||||
gtk_tree_store_set(GTK_TREE_STORE(list_store), iter, COLUMN_PID, pid, -1);
|
gtk_tree_store_set(GTK_TREE_STORE(list_store), iter, COLUMN_PID, pid, -1);
|
||||||
|
|||||||
@@ -18,9 +18,18 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <dirent.h>
|
||||||
|
#include <pwd.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "taskmanager.h"
|
#include "taskmanager.h"
|
||||||
|
|
||||||
struct task get_task_details(gint pid)
|
static gint pagesize = 0;
|
||||||
|
|
||||||
|
static struct task get_task_details(gint pid)
|
||||||
{
|
{
|
||||||
FILE *task_file;
|
FILE *task_file;
|
||||||
FILE *cmdline_file;
|
FILE *cmdline_file;
|
||||||
@@ -116,7 +125,7 @@ struct task get_task_details(gint pid)
|
|||||||
task.uid = status.st_uid;
|
task.uid = status.st_uid;
|
||||||
passwdp = getpwuid(task.uid);
|
passwdp = getpwuid(task.uid);
|
||||||
if(passwdp != NULL && passwdp->pw_name != NULL)
|
if(passwdp != NULL && passwdp->pw_name != NULL)
|
||||||
g_strlcpy(task.uname, passwdp->pw_name, sizeof task.uname);
|
g_strlcpy(task.uname, passwdp->pw_name, sizeof(task.uname));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,33 +17,14 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef XFCE4_TASKMANAGER_LINUX_H
|
#ifndef TASKMANAGER_H
|
||||||
#define XFCE4_TASKMANAGER_LINUX_H
|
#define TASKMANAGER_H
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <libxfcegui4/libxfcegui4.h>
|
#include <libxfcegui4/libxfcegui4.h>
|
||||||
|
|
||||||
#ifdef __linux
|
|
||||||
#include <dirent.h>
|
|
||||||
#include <pwd.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <signal.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
#define SIGNAL_NO 0
|
|
||||||
#define SIGNAL_KILL SIGKILL
|
|
||||||
#define SIGNAL_TERM SIGINT
|
|
||||||
#define SIGNAL_CONT SIGCONT
|
|
||||||
#define SIGNAL_STOP SIGSTOP
|
|
||||||
|
|
||||||
static gint pagesize = 0;
|
|
||||||
|
|
||||||
struct task get_task_details(gint pid);
|
|
||||||
GArray *get_task_list(void);
|
GArray *get_task_list(void);
|
||||||
gboolean get_system_status(system_status *sys_stat);
|
gboolean get_system_status(system_status *sys_stat);
|
||||||
gboolean get_cpu_usage_from_proc(system_status *sys_stat);
|
gboolean get_cpu_usage_from_proc(system_status *sys_stat);
|
||||||
@@ -51,3 +32,4 @@ void send_signal_to_task(gint task_id, gint signal);
|
|||||||
void set_priority_to_task(gint task_id, gint prio);
|
void set_priority_to_task(gint task_id, gint prio);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user