gnumeric r16958 - trunk/src/dialogs



Author: guelzow
Date: Sun Nov  9 09:33:05 2008
New Revision: 16958
URL: http://svn.gnome.org/viewvc/gnumeric?rev=16958&view=rev

Log:
2008-11-09  Andreas J. Guelzow <aguelzow pyrshep ca>

	(cb_dialog_function_select_cat_selection_changed): include category name
	  in lists if they are not category specific
	(dialog_function_select_init): add category column to functiojn store
	



Modified:
   trunk/src/dialogs/ChangeLog
   trunk/src/dialogs/dialog-function-select.c

Modified: trunk/src/dialogs/dialog-function-select.c
==============================================================================
--- trunk/src/dialogs/dialog-function-select.c	(original)
+++ trunk/src/dialogs/dialog-function-select.c	Sun Nov  9 09:33:05 2008
@@ -79,6 +79,7 @@
 enum {
 	FUN_NAME,
 	FUNCTION,
+	FUNCTION_CAT,
 	NUM_COLUMNS
 };
 
@@ -676,6 +677,7 @@
 	GnmFuncGroup const * cat;
 	GSList *funcs = NULL, *ptr;
 	GnmFunc const *func;
+	gboolean cat_specific = FALSE;
 
 	gtk_list_store_clear (state->model_f);
 
@@ -694,11 +696,12 @@
 
 				funcs = g_slist_sort (funcs,
 						      dialog_function_select_by_name);
-			} else 
+			} else {
 				/* Show category cat */
 				funcs = g_slist_sort (g_slist_copy (cat->functions),
 						      dialog_function_select_by_name);
-
+				cat_specific = TRUE;
+			}
 		} else
 			/* Show recent functions */
 			funcs = state->recent_funcs;
@@ -709,6 +712,8 @@
 				gtk_list_store_append (state->model_f, &iter);
 				gtk_list_store_set (state->model_f, &iter,
 						    FUN_NAME, gnm_func_get_name (func),
+						    FUNCTION_CAT, 
+						    cat_specific ? "" : _(func->fn_group->display_name->str),
 						    FUNCTION, func,
 						    -1);
 			}
@@ -759,7 +764,7 @@
 
 	/* Set-up second treeview */
 	scrolled = glade_xml_get_widget (state->gui, "scrolled_list");
-	state->model_f = gtk_list_store_new (NUM_COLMNS, G_TYPE_STRING, G_TYPE_POINTER);
+	state->model_f = gtk_list_store_new (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_STRING);
 	state->treeview_f = GTK_TREE_VIEW (
 		gtk_tree_view_new_with_model (GTK_TREE_MODEL (state->model_f)));
 	selection = gtk_tree_view_get_selection (state->treeview_f);
@@ -773,6 +778,11 @@
 							   "text", FUN_NAME, NULL);
 	gtk_tree_view_column_set_sort_column_id (column, FUN_NAME);
 	gtk_tree_view_append_column (state->treeview_f, column);
+	column = gtk_tree_view_column_new_with_attributes (_("Name"),
+							   gtk_cell_renderer_text_new (),
+							   "text", FUNCTION_CAT, NULL);
+	gtk_tree_view_column_set_sort_column_id (column, FUN_NAME);
+	gtk_tree_view_append_column (state->treeview_f, column);
 
 	gtk_tree_view_set_headers_visible (state->treeview_f, FALSE);
 	gtk_container_add (GTK_CONTAINER (scrolled), GTK_WIDGET (state->treeview_f));



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