diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-08-08 08:22:05 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-08-08 08:22:05 +0800 |
commit | ff41087ad40d0527b53cd0815419978a3df5995c (patch) | |
tree | 37a4495553dffe9d1f85df1614872439dc25ce3f /mail | |
parent | 1bccb5de6901b2775593af20333dffe3dda37220 (diff) | |
download | gsoc2013-evolution-ff41087ad40d0527b53cd0815419978a3df5995c.tar gsoc2013-evolution-ff41087ad40d0527b53cd0815419978a3df5995c.tar.gz gsoc2013-evolution-ff41087ad40d0527b53cd0815419978a3df5995c.tar.bz2 gsoc2013-evolution-ff41087ad40d0527b53cd0815419978a3df5995c.tar.lz gsoc2013-evolution-ff41087ad40d0527b53cd0815419978a3df5995c.tar.xz gsoc2013-evolution-ff41087ad40d0527b53cd0815419978a3df5995c.tar.zst gsoc2013-evolution-ff41087ad40d0527b53cd0815419978a3df5995c.zip |
Hide the app->window. (do_mail_print): Set the parent of the gnome-dialog
2001-08-07 Jeffrey Stedfast <fejj@ximian.com>
* mail-callbacks.c (manage_subscriptions): Hide the app->window.
(do_mail_print): Set the parent of the gnome-dialog to be the
folder-browser so that when evolution is closed, the print dialog
gets destroyed. Should fix bug #4781.
svn path=/trunk/; revision=11757
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 3 | ||||
-rw-r--r-- | mail/mail-callbacks.c | 65 | ||||
-rw-r--r-- | mail/mail-callbacks.h | 3 |
3 files changed, 28 insertions, 43 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 63b46541a0..3365d0bf31 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -6,6 +6,9 @@ 2001-08-07 Jeffrey Stedfast <fejj@ximian.com> * mail-callbacks.c (manage_subscriptions): Hide the app->window. + (do_mail_print): Set the parent of the gnome-dialog to be the + folder-browser so that when evolution is closed, the print dialog + gets destroyed. Should fix bug #4781. * subscribe-dialog.c (subscribe_dialog_new): This should return a GtkWidget not a GtkObject. diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index a3daf4e89e..35d59afb56 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -1794,53 +1794,50 @@ providers_config (BonoboUIComponent *uih, void *user_data, const char *path) * of for you */ static void -do_mail_print (MailDisplay *md, gboolean preview) +do_mail_print (FolderBrowser *fb, gboolean preview) { GnomePrintContext *print_context; GnomePrintMaster *print_master; - GnomePrintDialog *gpd; + GnomePrintDialog *dialog; GnomePrinter *printer = NULL; int copies = 1; int collate = FALSE; - + if (!preview) { - - gpd = GNOME_PRINT_DIALOG (gnome_print_dialog_new (_("Print Message"), - GNOME_PRINT_DIALOG_COPIES)); - gnome_dialog_set_default (GNOME_DIALOG (gpd), GNOME_PRINT_PRINT); - - switch (gnome_dialog_run (GNOME_DIALOG (gpd))) { + dialog = GNOME_PRINT_DIALOG (gnome_print_dialog_new (_("Print Message"), + GNOME_PRINT_DIALOG_COPIES)); + gnome_dialog_set_default (GNOME_DIALOG (dialog), GNOME_PRINT_PRINT); + gnome_dialog_set_parent (GNOME_DIALOG (dialog), GTK_WINDOW (fb)); + + switch (gnome_dialog_run (GNOME_DIALOG (dialog))) { case GNOME_PRINT_PRINT: - break; - + break; case GNOME_PRINT_PREVIEW: preview = TRUE; break; - case -1: return; - default: - gnome_dialog_close (GNOME_DIALOG (gpd)); + gnome_dialog_close (GNOME_DIALOG (dialog)); return; } - - gnome_print_dialog_get_copies (gpd, &copies, &collate); - printer = gnome_print_dialog_get_printer (gpd); - gnome_dialog_close (GNOME_DIALOG (gpd)); + + gnome_print_dialog_get_copies (dialog, &copies, &collate); + printer = gnome_print_dialog_get_printer (dialog); + gnome_dialog_close (GNOME_DIALOG (dialog)); } - + print_master = gnome_print_master_new (); - + /* FIXME: set paper size gnome_print_master_set_paper (print_master, */ - + if (printer) gnome_print_master_set_printer (print_master, printer); gnome_print_master_set_copies (print_master, copies, collate); print_context = gnome_print_master_get_context (print_master); - gtk_html_print (md->html, print_context); + gtk_html_print (fb->mail_display->html, print_context); gnome_print_master_close (print_master); - + if (preview){ gboolean landscape = FALSE; GnomePrintMasterPreview *preview; @@ -1850,7 +1847,7 @@ do_mail_print (MailDisplay *md, gboolean preview) gtk_widget_show (GTK_WIDGET (preview)); } else { int result = gnome_print_master_print (print_master); - + if (result == -1){ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, _("Printing of message failed")); @@ -1860,31 +1857,19 @@ do_mail_print (MailDisplay *md, gboolean preview) } void -mail_print_preview_msg (MailDisplay *md) -{ - do_mail_print (md, TRUE); -} - -void -mail_print_msg (MailDisplay *md) -{ - do_mail_print (md, FALSE); -} - -void print_msg (GtkWidget *button, gpointer user_data) { FolderBrowser *fb = user_data; - - mail_print_msg (fb->mail_display); + + do_mail_print (fb, FALSE); } void print_preview_msg (GtkWidget *button, gpointer user_data) { FolderBrowser *fb = user_data; - - mail_print_preview_msg (fb->mail_display); + + do_mail_print (fb, TRUE); } /******************** Begin Subscription Dialog ***************************/ diff --git a/mail/mail-callbacks.h b/mail/mail-callbacks.h index e37813b03e..42d3004c38 100644 --- a/mail/mail-callbacks.h +++ b/mail/mail-callbacks.h @@ -112,9 +112,6 @@ void composer_postpone_cb (EMsgComposer *composer, gpointer data); void forward_messages (CamelFolder *folder, GPtrArray *uids, gboolean inline); -void mail_print_preview_msg (MailDisplay *md); -void mail_print_msg (MailDisplay *md); - /* CamelStore callbacks */ void folder_created (CamelStore *store, const char *prefix, CamelFolderInfo *fi); void folder_deleted (CamelStore *store, CamelFolderInfo *fi); |