aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/print.c
diff options
context:
space:
mode:
authorTobias Mueller <tobiasmue@src.gnome.org>2008-08-22 17:14:29 +0800
committerTobias Mueller <tobiasmue@src.gnome.org>2008-08-22 17:14:29 +0800
commited4bb8a09293f4eb59716f32ec62d3a39e33527a (patch)
tree5f764f3b4969c73395ef11c8e567f8fb8bf474fb /calendar/gui/print.c
parent5af20e807ea6ad2605e584396a3a0d36057f9c65 (diff)
downloadgsoc2013-evolution-ed4bb8a09293f4eb59716f32ec62d3a39e33527a.tar.gz
gsoc2013-evolution-ed4bb8a09293f4eb59716f32ec62d3a39e33527a.tar.zst
gsoc2013-evolution-ed4bb8a09293f4eb59716f32ec62d3a39e33527a.zip
Make it show "Tasks" for printing tasks list and "Calendar" for printing
a calendar. Patch by Rouslan Solomakhin <rouslan@solomakhin.net>. Fixes bug 547822. svn path=/trunk/; revision=36035
Diffstat (limited to 'calendar/gui/print.c')
-rw-r--r--calendar/gui/print.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/calendar/gui/print.c b/calendar/gui/print.c
index 9caf4fbdf9..dd990739e6 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;
+ 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));
+
+ 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 = 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);