r16886 - gnucash/trunk/src/report/report-gnome - fix multi-column report to use report guid.

Andrew Sackville-West andrewsw at cvs.gnucash.org
Thu Jan 24 00:24:09 EST 2008


Author: andrewsw
Date: 2008-01-24 00:24:09 -0500 (Thu, 24 Jan 2008)
New Revision: 16886
Trac: http://svn.gnucash.org/trac/changeset/16886

Modified:
   gnucash/trunk/src/report/report-gnome/dialog-column-view.c
   gnucash/trunk/src/report/report-gnome/report-gnome.scm
Log:
fix multi-column report to use report guid.

It's a bit of a hack because we still refer to sub-reports by name,
but the list of names gets built from the list of registered reports
so that's safe, given no duplicate names. Sorting of the list of
available reports isn't quite right, but it's a start.


Modified: gnucash/trunk/src/report/report-gnome/dialog-column-view.c
===================================================================
--- gnucash/trunk/src/report/report-gnome/dialog-column-view.c	2008-01-23 22:54:59 UTC (rev 16885)
+++ gnucash/trunk/src/report/report-gnome/dialog-column-view.c	2008-01-24 05:24:09 UTC (rev 16886)
@@ -107,7 +107,7 @@
 update_display_lists(gnc_column_view_edit * view)
 {
   SCM   get_names = scm_c_eval_string("gnc:all-report-template-names");
-  SCM   template_menu_name = scm_c_eval_string("gnc:report-template-menu-name/name");
+  SCM   template_menu_name = scm_c_eval_string("gnc:report-template-menu-name/report-guid");
   SCM   report_menu_name = scm_c_eval_string("gnc:report-menu-name");
   SCM   names = scm_call_0(get_names);
   SCM   contents = 
@@ -122,6 +122,7 @@
   GtkTreePath *path;
   GtkTreeSelection *tree_selection;
 
+
   /* Update the list of available reports (left selection box). */
   row = view->available_selected;
 
@@ -139,17 +140,19 @@
 
   store = GTK_LIST_STORE(gtk_tree_view_get_model(view->available));
   gtk_list_store_clear(store);
+
   if(SCM_LISTP(names)) {
     for(i = 0; !SCM_NULLP(names); names = SCM_CDR(names), i++) {
       if (SCM_EQUALP (SCM_CAR(names), selection))
         row = i;
-      name = SCM_STRING_CHARS(scm_call_1(template_menu_name, SCM_CAR(names)));
+      name = SCM_STRING_CHARS(scm_call_2(template_menu_name, SCM_CAR(names), SCM_BOOL_F));
       gtk_list_store_append(store, &iter);
       gtk_list_store_set(store, &iter,
 			 AVAILABLE_COL_NAME, name,
 			 AVAILABLE_COL_ROW, i,
 			 -1);
     }
+
   }
   
   tree_selection = gtk_tree_view_get_selection(view->available);
@@ -339,6 +342,7 @@
     /* Build the 'available' view */
     store = gtk_list_store_new (NUM_AVAILABLE_COLS, G_TYPE_STRING, G_TYPE_INT);
     gtk_tree_view_set_model(r->available, GTK_TREE_MODEL(store));
+    gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(store),AVAILABLE_COL_NAME,GTK_SORT_ASCENDING);
     g_object_unref(store);
 
     renderer = gtk_cell_renderer_text_new();

Modified: gnucash/trunk/src/report/report-gnome/report-gnome.scm
===================================================================
--- gnucash/trunk/src/report/report-gnome/report-gnome.scm	2008-01-23 22:54:59 UTC (rev 16885)
+++ gnucash/trunk/src/report/report-gnome/report-gnome.scm	2008-01-24 05:24:09 UTC (rev 16886)
@@ -26,7 +26,7 @@
 ;; returns a function that takes a list: (options, report),
 ;; and returns a widget
 (define (gnc:report-options-editor report) 
-  (if (equal? (gnc:report-type report) "Multicolumn View")
+  (if (equal? (gnc:report-type report) "d8ba4a2e89e8479ca9f6eccdeb164588")
       gnc-column-view-edit-options
       gnc-report-window-default-params-editor))
 



More information about the gnucash-changes mailing list