[Goodies-commits] r4755 - xfce4-taskmanager/trunk/src

Mike Massonnet mmassonnet at xfce.org
Fri May 9 14:22:54 CEST 2008


Author: mmassonnet
Date: 2008-05-09 12:22:54 +0000 (Fri, 09 May 2008)
New Revision: 4755

Modified:
   xfce4-taskmanager/trunk/src/functions.c
   xfce4-taskmanager/trunk/src/interface.c
   xfce4-taskmanager/trunk/src/types.h
Log:
Save sort column/type in config


Modified: xfce4-taskmanager/trunk/src/functions.c
===================================================================
--- xfce4-taskmanager/trunk/src/functions.c	2008-05-09 12:22:49 UTC (rev 4754)
+++ xfce4-taskmanager/trunk/src/functions.c	2008-05-09 12:22:54 UTC (rev 4755)
@@ -196,6 +196,9 @@
 	show_other_tasks = xfce_rc_read_bool_entry(rc_file, "show_other_tasks", FALSE);
 	show_cached_as_free = xfce_rc_read_bool_entry(rc_file, "show_cached_as_free", TRUE);
 
+	sort_column = xfce_rc_read_int_entry(rc_file, "sort_column", COLUMN_PID);
+	sort_type = xfce_rc_read_int_entry(rc_file, "sort_type", GTK_SORT_ASCENDING);
+
 	full_view = xfce_rc_read_bool_entry(rc_file, "full_view", FALSE);
 
 	win_width = xfce_rc_read_int_entry(rc_file, "win_width", 500);
@@ -215,6 +218,10 @@
 	xfce_rc_write_bool_entry(rc_file, "show_other_tasks", show_other_tasks);
 	xfce_rc_write_bool_entry(rc_file, "show_cached_as_free", show_cached_as_free);
 
+	gtk_tree_sortable_get_sort_column_id(GTK_TREE_SORTABLE(list_store), &sort_column, &sort_type);
+	xfce_rc_write_int_entry(rc_file, "sort_column", sort_column);
+	xfce_rc_write_int_entry(rc_file, "sort_type", sort_type);
+
 	xfce_rc_write_bool_entry(rc_file, "full_view", full_view);
 
 	gtk_window_get_size(GTK_WINDOW (main_window), (gint *) &win_width, (gint *) &win_height);

Modified: xfce4-taskmanager/trunk/src/interface.c
===================================================================
--- xfce4-taskmanager/trunk/src/interface.c	2008-05-09 12:22:49 UTC (rev 4754)
+++ xfce4-taskmanager/trunk/src/interface.c	2008-05-09 12:22:54 UTC (rev 4755)
@@ -87,7 +87,7 @@
 
 	gtk_tree_view_set_model(GTK_TREE_VIEW(treeview), GTK_TREE_MODEL(list_store));
 
-	gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(list_store), 1, GTK_SORT_ASCENDING);
+	gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(list_store), sort_column, sort_type);
 
 	bbox1 = gtk_hbutton_box_new();
 	gtk_box_pack_start(GTK_BOX(vbox1), bbox1, FALSE, TRUE, 0);

Modified: xfce4-taskmanager/trunk/src/types.h
===================================================================
--- xfce4-taskmanager/trunk/src/types.h	2008-05-09 12:22:49 UTC (rev 4754)
+++ xfce4-taskmanager/trunk/src/types.h	2008-05-09 12:22:54 UTC (rev 4755)
@@ -71,6 +71,9 @@
 
 gboolean show_cached_as_free; /* Show memory used Cache as free memory */
 
+guint sort_column;
+guint sort_type;
+
 gboolean full_view;
 
 guint win_width;




More information about the Goodies-commits mailing list