aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
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
parent5af20e807ea6ad2605e584396a3a0d36057f9c65 (diff)
downloadgsoc2013-evolution-ed4bb8a09293f4eb59716f32ec62d3a39e33527a.tar
gsoc2013-evolution-ed4bb8a09293f4eb59716f32ec62d3a39e33527a.tar.gz
gsoc2013-evolution-ed4bb8a09293f4eb59716f32ec62d3a39e33527a.tar.bz2
gsoc2013-evolution-ed4bb8a09293f4eb59716f32ec62d3a39e33527a.tar.lz
gsoc2013-evolution-ed4bb8a09293f4eb59716f32ec62d3a39e33527a.tar.xz
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')
-rw-r--r--calendar/ChangeLog9
-rw-r--r--calendar/gui/print.c24
2 files changed, 27 insertions, 6 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 8d1deed13d..630ae57896 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,12 @@
+2008-08-22 Tobias Mueller <tobiasmue@svn.gnome.org>
+
+ * gui/print.c (print_table_draw_page):
+ Make it show "Tasks" for printing tasks list and "Calendar" for
+ printing a calendar. Patch by
+ Rouslan Solomakhin <rouslan@solomakhin.net>
+
+ ** Fixes bug 547822
+
2008-08-18 Milan Crha <mcrha@redhat.com>
** Part of fix for bug #462242
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);