aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorJP Rosevear <jpr@novell.com>2005-01-22 05:04:28 +0800
committerJP Rosevear <jpr@src.gnome.org>2005-01-22 05:04:28 +0800
commitf3eac1734845473695e767e90b16e8166406e940 (patch)
tree607b1cb57ba815dad4df09a455ac444fb986b0d5 /mail
parentf9ef9f29ea4d8080fb0cf45863679ed9061261db (diff)
downloadgsoc2013-evolution-f3eac1734845473695e767e90b16e8166406e940.tar
gsoc2013-evolution-f3eac1734845473695e767e90b16e8166406e940.tar.gz
gsoc2013-evolution-f3eac1734845473695e767e90b16e8166406e940.tar.bz2
gsoc2013-evolution-f3eac1734845473695e767e90b16e8166406e940.tar.lz
gsoc2013-evolution-f3eac1734845473695e767e90b16e8166406e940.tar.xz
gsoc2013-evolution-f3eac1734845473695e767e90b16e8166406e940.tar.zst
gsoc2013-evolution-f3eac1734845473695e767e90b16e8166406e940.zip
Fixes #46404
2005-01-18 JP Rosevear <jpr@novell.com> Fixes #46404 * em-folder-view.c (emfv_print_response): use the config in the print data and free it (em_folder_view_print): load the config from e_print and use the dialog from e_print svn path=/trunk/; revision=28494
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog9
-rw-r--r--mail/em-folder-view.c16
2 files changed, 17 insertions, 8 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index ee6b2466d1..3c33ff61e0 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,12 @@
+2005-01-18 JP Rosevear <jpr@novell.com>
+
+ Fixes #46404
+
+ * em-folder-view.c (emfv_print_response): use the config in the
+ print data and free it
+ (em_folder_view_print): load the config from e_print and use the
+ dialog from e_print
+
2005-01-21 Not Zed <NotZed@Ximian.com>
** See bug #60664.
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c
index bfa4cb783c..0c11d2ca6b 100644
--- a/mail/em-folder-view.c
+++ b/mail/em-folder-view.c
@@ -66,6 +66,7 @@
#include <e-util/e-dialog-utils.h>
#include <e-util/e-icon-factory.h>
+#include <e-util/e-print.h>
#include "em-format-html-display.h"
#include "em-format-html-print.h"
@@ -1847,6 +1848,7 @@ emfv_activate(EMFolderView *emfv, BonoboUIComponent *uic, int act)
struct _print_data {
EMFolderView *emfv;
+ GnomePrintConfig *config;
int preview;
CamelFolder *folder;
char *uid;
@@ -1856,20 +1858,15 @@ static void
emfv_print_response(GtkWidget *w, int resp, struct _print_data *data)
{
EMFormatHTMLPrint *print;
- GnomePrintConfig *config = NULL;
switch (resp) {
case GNOME_PRINT_DIALOG_RESPONSE_PREVIEW:
data->preview = TRUE;
case GNOME_PRINT_DIALOG_RESPONSE_PRINT:
- if (w)
- config = gnome_print_dialog_get_config((GnomePrintDialog *)w);
print = em_format_html_print_new();
em_format_set_session((EMFormat *)print, ((EMFormat *)data->emfv->preview)->session);
- em_format_html_print_message(print, (EMFormatHTML *)data->emfv->preview, config, data->folder, data->uid, data->preview);
+ em_format_html_print_message(print, (EMFormatHTML *)data->emfv->preview, data->config, data->folder, data->uid, data->preview);
g_object_unref(print);
- if (config)
- g_object_unref(config);
break;
}
@@ -1877,6 +1874,8 @@ emfv_print_response(GtkWidget *w, int resp, struct _print_data *data)
gtk_widget_destroy(w);
g_object_unref(data->emfv);
+ e_print_save_config (data->config);
+ g_object_unref(data->config);
camel_object_unref(data->folder);
g_free(data->uid);
g_free(data);
@@ -1899,6 +1898,7 @@ int em_folder_view_print(EMFolderView *emfv, int preview)
data = g_malloc0(sizeof(*data));
data->emfv = emfv;
g_object_ref(emfv);
+ data->config = e_print_load_config ();
data->preview = preview;
data->folder = emfv->folder;
camel_object_ref(data->folder);
@@ -1908,8 +1908,8 @@ int em_folder_view_print(EMFolderView *emfv, int preview)
if (preview) {
emfv_print_response(NULL, GNOME_PRINT_DIALOG_RESPONSE_PREVIEW, data);
} else {
- GtkDialog *dialog = (GtkDialog *)gnome_print_dialog_new(NULL, _("Print Message"), GNOME_PRINT_DIALOG_COPIES);
-
+ GtkDialog *dialog = (GtkDialog *)e_print_get_dialog_with_config (_("Print Message"), GNOME_PRINT_DIALOG_COPIES, data->config);
+
gtk_dialog_set_default_response(dialog, GNOME_PRINT_DIALOG_RESPONSE_PRINT);
e_dialog_set_transient_for ((GtkWindow *) dialog, (GtkWidget *) emfv);
g_signal_connect(dialog, "response", G_CALLBACK(emfv_print_response), data);