r17397 - gnucash/branches/2.2/src/report/report-gnome - [r17365] Bug #542967: Go back to using the name of the report template in the title of report options dialog boxes.

Andreas Köhler andi5 at cvs.gnucash.org
Tue Jul 22 18:35:48 EDT 2008


Author: andi5
Date: 2008-07-22 18:35:47 -0400 (Tue, 22 Jul 2008)
New Revision: 17397
Trac: http://svn.gnucash.org/trac/changeset/17397

Modified:
   gnucash/branches/2.2/src/report/report-gnome/window-report.c
Log:
[r17365] Bug #542967: Go back to using the name of the report template in the title of report options dialog boxes.

Committed by cedayiv.


Modified: gnucash/branches/2.2/src/report/report-gnome/window-report.c
===================================================================
--- gnucash/branches/2.2/src/report/report-gnome/window-report.c	2008-07-22 22:35:36 UTC (rev 17396)
+++ gnucash/branches/2.2/src/report/report-gnome/window-report.c	2008-07-22 22:35:47 UTC (rev 17397)
@@ -122,8 +122,10 @@
 GtkWidget * 
 gnc_report_window_default_params_editor(SCM options, SCM report)
 {
-  SCM get_editor = scm_c_eval_string("gnc:report-editor-widget");
-  SCM get_title  = scm_c_eval_string("gnc:report-type");
+  SCM get_editor        = scm_c_eval_string("gnc:report-editor-widget");
+  SCM get_report_type   = scm_c_eval_string("gnc:report-type");
+  SCM get_template      = scm_c_eval_string("gnc:find-report-template");
+  SCM get_template_name = scm_c_eval_string("gnc:report-template-name");
   SCM ptr;
   
   const gchar *title = NULL;
@@ -144,10 +146,17 @@
     prm->cur_report  = report;
     prm->db          = gnc_option_db_new(prm->scm_options);
 
-    ptr = scm_call_1(get_title, report);
-    if (SCM_STRINGP(ptr)) {
-      title = SCM_STRING_CHARS(ptr);
+    /* Get the title of the report's template. */
+    ptr = scm_call_1(get_report_type, report);
+    if (ptr != SCM_BOOL_F) {
+      ptr = scm_call_1(get_template, ptr);
+      if (ptr != SCM_BOOL_F) {
+        ptr = scm_call_1(get_template_name, ptr);
+        if (SCM_STRINGP(ptr))
+          title = SCM_STRING_CHARS(ptr);
+      }
     }
+
     /* Don't forget to translate the window title */
     prm->win  = gnc_options_dialog_new((gchar*) (title && *title ? _(title) : ""));
     



More information about the gnucash-changes mailing list