diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2008-09-11 23:34:29 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2008-09-11 23:34:29 +0800 |
commit | c0a255eb90769638d57ae4122932f75c46e4e531 (patch) | |
tree | 5213694107a246763c25c0a089553dd7c8708b32 /calendar/gui/print.c | |
parent | 4c8aa5982c0132716f473873d0e1d7601df14607 (diff) | |
download | gsoc2013-evolution-c0a255eb90769638d57ae4122932f75c46e4e531.tar.gz gsoc2013-evolution-c0a255eb90769638d57ae4122932f75c46e4e531.tar.zst gsoc2013-evolution-c0a255eb90769638d57ae4122932f75c46e4e531.zip |
Merge revisions 36016:36303 from trunk.
svn path=/branches/kill-bonobo/; revision=36307
Diffstat (limited to 'calendar/gui/print.c')
-rw-r--r-- | calendar/gui/print.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/calendar/gui/print.c b/calendar/gui/print.c index 9caf4fbdf9..e68ec84a84 100644 --- a/calendar/gui/print.c +++ b/calendar/gui/print.c @@ -2744,11 +2744,16 @@ print_title (GtkPrintContext *context, const gchar *text, gdouble page_width) pango_font_description_free (desc); } +struct print_opts { + EPrintable *printable; + const gchar *print_header; +}; + static void print_table_draw_page (GtkPrintOperation *operation, GtkPrintContext *context, gint page_nr, - EPrintable *printable) + struct print_opts *opts) { GtkPageSetup *setup; gdouble width; @@ -2759,13 +2764,15 @@ print_table_draw_page (GtkPrintOperation *operation, do { /* TODO Allow the user to customize the title. */ - print_title (context, _("Upcoming Appointments"), width); + print_title (context, opts->print_header, width); - if (e_printable_data_left (printable)) + if (e_printable_data_left (opts->printable)) e_printable_print_page ( - printable, context, width, 24, TRUE); + opts->printable, context, width, 24, TRUE); - } while (e_printable_data_left (printable)); + } while (e_printable_data_left (opts->printable)); + + g_free (opts); } void @@ -2774,6 +2781,7 @@ print_table (ETable *table, const gchar *dialog_title, { GtkPrintOperation *operation; EPrintable *printable; + struct print_opts *opts; printable = e_table_get_printable (table); g_object_ref_sink (printable); @@ -2782,9 +2790,13 @@ print_table (ETable *table, const gchar *dialog_title, operation = e_print_operation_new (); gtk_print_operation_set_n_pages (operation, 1); + opts = g_malloc (sizeof (struct print_opts)); + opts->printable = printable; + opts->print_header = print_header; + g_signal_connect ( operation, "draw_page", - G_CALLBACK (print_table_draw_page), printable); + G_CALLBACK (print_table_draw_page), opts); gtk_print_operation_run (operation, action, NULL, NULL); |