diff options
author | infirit <[email protected]> | 2014-12-18 21:30:25 +0100 |
---|---|---|
committer | infirit <[email protected]> | 2014-12-18 21:31:13 +0100 |
commit | 6034caada16eab3b07e090c0f2b29a1a3dd9d105 (patch) | |
tree | 8d7d47e968444258975bdd887821f7694241451d /src/proctable.cpp | |
parent | ad78931540508c4f3d52d938852c47086ce7b03f (diff) | |
download | mate-system-monitor-6034caada16eab3b07e090c0f2b29a1a3dd9d105.tar.bz2 mate-system-monitor-6034caada16eab3b07e090c0f2b29a1a3dd9d105.tar.xz |
Priority column to the process table to show user-friendly nice values
Taken from GSM commit: 6fcbf5aaa65d63dd751c812c3ac05a937b50450d
From: Robert Roth <[email protected]>
Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=131802
Diffstat (limited to 'src/proctable.cpp')
-rw-r--r-- | src/proctable.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/proctable.cpp b/src/proctable.cpp index f77f842..63cd572 100644 --- a/src/proctable.cpp +++ b/src/proctable.cpp @@ -68,7 +68,6 @@ ProcInfo* ProcInfo::find(pid_t pid) - static void set_proctree_reorderable(ProcData *procdata) { @@ -260,6 +259,7 @@ proctable_new (ProcData * const procdata) /* xgettext: combined noun, the function the process is waiting in, see wchan ps(1) */ N_("Waiting Channel"), N_("Control Group"), + N_("Priority"), NULL, "POINTER" }; @@ -290,6 +290,7 @@ proctable_new (ProcData * const procdata) G_TYPE_ULONG, /* Memory */ G_TYPE_STRING, /* wchan */ G_TYPE_STRING, /* Cgroup */ + G_TYPE_STRING, /* Priority */ GDK_TYPE_PIXBUF, /* Icon */ G_TYPE_POINTER, /* ProcInfo */ G_TYPE_STRING /* Sexy tooltip */ @@ -333,7 +334,7 @@ proctable_new (ProcData * const procdata) gtk_tree_view_set_expander_column (GTK_TREE_VIEW (proctree), column); - for (i = COL_USER; i <= COL_CGROUP; i++) { + for (i = COL_USER; i <= COL_PRIORITY; i++) { GtkCellRenderer *cell; GtkTreeViewColumn *col; @@ -388,7 +389,15 @@ proctable_new (ProcData * const procdata) GUINT_TO_POINTER(i), NULL); break; - + case COL_PRIORITY: + gtk_tree_view_column_set_cell_data_func(col, cell, + &procman::priority_cell_data_func, + GUINT_TO_POINTER(COL_NICE), + NULL); + gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(model), i, + procman::priority_compare_func, + GUINT_TO_POINTER(COL_NICE), NULL); + break; default: gtk_tree_view_column_set_attributes(col, cell, "text", i, NULL); break; |