[PATCH] gnomecard sort preference saving




This patch makes gnomecard remember which column you sorted by last.

--- list.c.old	Sun Jan  9 04:10:58 2000
+++ list.c	Sun Jan  9 04:10:42 2000
@@ -136,6 +136,8 @@
     hdr = (ColumnHeader *)l->data;
     gnomecard_sort_card_list(hdr->coltype);
 
+    gnome_config_set_string("GnomeCard/CardDisplay/sort", hdr->colname);
+
     /* this is a hack - need function to just rebuid list    */
     /* and maintain current selection in list w/o me knowing */
     /* about it here                                         */

--- gnomecard.c.old	Sun Jan  9 04:10:19 2000
+++ gnomecard.c	Sun Jan  9 04:09:55 2000
@@ -702,6 +702,7 @@
 	GtkWidget *scrollwin;
         GnomeAppBar *appbar;
 	GtkWidget *canvas, *hbox;
+	gchar *sortcolumn;
 	gint ncol, i, x, y;
 
 	/* hard coded column headers */
@@ -815,9 +816,15 @@
 	menu_prev = gomenu[1].widget;
 	menu_next = gomenu[2].widget;
 	menu_last = gomenu[3].widget;
-
-	gnomecard_sort_col = COLTYPE_CARDNAME;
 	
+	sortcolumn = gnome_config_get_string("GnomeCard/CardDisplay/sort");
+	if (sortcolumn) {
+	  gnomecard_sort_col = getColumnTypeFromName(sortcolumn);
+	} else {
+	  gnomecard_sort_col = COLTYPE_CARDNAME;
+	}
+	g_free(sortcolumn);
+	  	
 	gnomecard_init_defaults();
 	gnomecard_set_changed(FALSE);


-- 
Colin Walters <levanti@verbum.org>
http://web.verbum.org/levanti
(1024D/C207843A) A580 5AA1 0887 2032 7EFB  19F4 9776 6282 C207 843A



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]