diff options
author | Dan Winship <danw@src.gnome.org> | 2000-07-01 05:33:54 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2000-07-01 05:33:54 +0800 |
commit | 8a2058e527f0d8311c05cec4f4487468cd167d14 (patch) | |
tree | 33166cdc0a76e013fe0237383392613df6f015c6 /mail | |
parent | a640827879982297ad569419b88d5ec88e551fd0 (diff) | |
download | gsoc2013-evolution-8a2058e527f0d8311c05cec4f4487468cd167d14.tar gsoc2013-evolution-8a2058e527f0d8311c05cec4f4487468cd167d14.tar.gz gsoc2013-evolution-8a2058e527f0d8311c05cec4f4487468cd167d14.tar.bz2 gsoc2013-evolution-8a2058e527f0d8311c05cec4f4487468cd167d14.tar.lz gsoc2013-evolution-8a2058e527f0d8311c05cec4f4487468cd167d14.tar.xz gsoc2013-evolution-8a2058e527f0d8311c05cec4f4487468cd167d14.tar.zst gsoc2013-evolution-8a2058e527f0d8311c05cec4f4487468cd167d14.zip |
Use gnome-print to do a print preview.
* mail-ops.c (print_msg): Use gnome-print to do a print preview.
* folder-browser-factory.c: Hook up "Print" button.
svn path=/trunk/; revision=3835
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 4 | ||||
-rw-r--r-- | mail/folder-browser-factory.c | 2 | ||||
-rw-r--r-- | mail/mail-ops.c | 21 | ||||
-rw-r--r-- | mail/mail.h | 1 |
4 files changed, 27 insertions, 1 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 1313c25481..7da0ca383d 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,9 @@ 2000-06-30 Dan Winship <danw@helixcode.com> + * mail-ops.c (print_msg): Use gnome-print to do a print preview. + + * folder-browser-factory.c: Hook up "Print" button. + * message-list.c (message_list_foreach): New function, a wrapper around e_table_selected_row_foreach, which calls the callback function with UIDs rather than row numbers. diff --git a/mail/folder-browser-factory.c b/mail/folder-browser-factory.c index 4ffabc6e75..74c50ca52f 100644 --- a/mail/folder-browser-factory.c +++ b/mail/folder-browser-factory.c @@ -46,7 +46,7 @@ static GnomeUIInfo gnome_toolbar [] = { GNOMEUIINFO_ITEM_STOCK (N_("Refile"), N_("Move message to a new folder"), refile_msg, GNOME_STOCK_PIXMAP_MAIL_SND), - GNOMEUIINFO_ITEM_STOCK (N_("Print"), N_("Print the selected message"), random_cb, GNOME_STOCK_PIXMAP_PRINT), + GNOMEUIINFO_ITEM_STOCK (N_("Print"), N_("Print the selected message"), print_msg, GNOME_STOCK_PIXMAP_PRINT), GNOMEUIINFO_ITEM_STOCK (N_("Delete"), N_("Delete this message"), delete_msg, GNOME_STOCK_PIXMAP_TRASH), diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 169566cd99..27ad27a51c 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -26,6 +26,8 @@ #include <config.h> #include <errno.h> #include <gnome.h> +#include <libgnomeprint/gnome-print-master.h> +#include <libgnomeprint/gnome-print-master-preview.h> #include "mail.h" #include "mail-threads.h" #include "folder-browser.h" @@ -884,3 +886,22 @@ providers_config (BonoboUIHandler *uih, void *user_data, const char *path) gtk_widget_show (pc); } +void +print_msg (GtkWidget *button, gpointer user_data) +{ + FolderBrowser *fb = user_data; + GnomePrintMaster *print_master; + GnomePrintContext *print_context; + GtkWidget *preview; + + print_master = gnome_print_master_new (); + + print_context = gnome_print_master_get_context (print_master); + gtk_html_print (fb->mail_display->html, print_context); + + preview = GTK_WIDGET (gnome_print_master_preview_new ( + print_master, "Mail Print Preview")); + gtk_widget_show (preview); + + gtk_object_unref (GTK_OBJECT (print_master)); +} diff --git a/mail/mail.h b/mail/mail.h index 4f006776ee..38412d972b 100644 --- a/mail/mail.h +++ b/mail/mail.h @@ -58,6 +58,7 @@ void reply_to_sender (GtkWidget *button, gpointer user_data); void reply_to_all (GtkWidget *button, gpointer user_data); void delete_msg (GtkWidget *button, gpointer user_data); void refile_msg (GtkWidget *button, gpointer user_data); +void print_msg (GtkWidget *button, gpointer user_data); void expunge_folder (BonoboUIHandler *uih, void *user_data, const char *path); void filter_edit (BonoboUIHandler *uih, void *user_data, const char *path); |