aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-view.c
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@novell.com>2007-01-23 00:41:31 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2007-01-23 00:41:31 +0800
commit2a1d77a838cd309647088f13b81afce46d5ae90e (patch)
tree9f26bb2f33a3b9fa5f24578515939692abe2171f /mail/em-folder-view.c
parent0b9195cb2c24add072671f82d1d1498b78a8b217 (diff)
downloadgsoc2013-evolution-2a1d77a838cd309647088f13b81afce46d5ae90e.tar
gsoc2013-evolution-2a1d77a838cd309647088f13b81afce46d5ae90e.tar.gz
gsoc2013-evolution-2a1d77a838cd309647088f13b81afce46d5ae90e.tar.bz2
gsoc2013-evolution-2a1d77a838cd309647088f13b81afce46d5ae90e.tar.lz
gsoc2013-evolution-2a1d77a838cd309647088f13b81afce46d5ae90e.tar.xz
gsoc2013-evolution-2a1d77a838cd309647088f13b81afce46d5ae90e.tar.zst
gsoc2013-evolution-2a1d77a838cd309647088f13b81afce46d5ae90e.zip
** Committing Ebby Wiselyn's patch for GtkPrint API migration. 2006-01-22
2006-01-22 Srinivasa Ragavan <sragavan@novell.com> ** Committing Ebby Wiselyn's patch for GtkPrint API migration. 2006-01-22 Srinivasa Ragavan <sragavan@novell.com> ** Committing Ebby Wiselyn's patch for GtkPrint API migration. 2006-01-22 Srinivasa Ragavan <sragavan@novell.com> ** Committing Ebby Wiselyn's patch for GtkPrint API migration. 2006-01-22 Srinivasa Ragavan <sragavan@novell.com> ** Committing Ebby Wiselyn's patch for GtkPrint API migration. 2006-01-22 Srinivasa Ragavan <sragavan@novell.com> ** Committing Ebby Wiselyn's patch for GtkPrint API migration. 2006-01-22 Srinivasa Ragavan <sragavan@novell.com> ** Committing Ebby Wiselyn's patch for GtkPrint API migration. 2006-01-22 Srinivasa Ragavan <sragavan@novell.com> ** Committing Ebby Wiselyn's patch for GtkPrint API migration. 2006-01-22 Srinivasa Ragavan <sragavan@novell.com> ** Committing Ebby Wiselyn's patch for GtkPrint API migration. 2006-01-22 Srinivasa Ragavan <sragavan@novell.com> ** Committing Ebby Wiselyn's patch for GtkPrint API migration. 2006-01-22 Srinivasa Ragavan <sragavan@novell.com> ** Committing Ebby Wiselyn's patch for GtkPrint API migration. 2006-01-22 Srinivasa Ragavan <sragavan@novell.com> ** Committing Ebby Wiselyn's patch for GtkPrint API migration. 2006-01-22 Srinivasa Ragavan <sragavan@novell.com> ** Committing Ebby Wiselyn's patch for GtkPrint API migration. 2006-01-22 Srinivasa Ragavan <sragavan@novell.com> ** Committing Ebby Wiselyn's patch for GtkPrint API migration. 2006-01-22 Srinivasa Ragavan <sragavan@novell.com> ** Committing Ebby Wiselyn's patch for GtkPrint API migration. 2006-01-22 Srinivasa Ragavan <sragavan@novell.com> ** Committing Ebby Wiselyn's patch for GtkPrint API migration. 2006-01-22 Srinivasa Ragavan <sragavan@novell.com> ** Committing Ebby Wiselyn's patch for GtkPrint API migration. 2006-01-22 Srinivasa Ragavan <sragavan@novell.com> ** Committing Ebby Wiselyn's patch for GtkPrint API migration. 2006-01-22 Srinivasa Ragavan <sragavan@novell.com> ** Committing Ebby Wiselyn's patch for GtkPrint API migration. 2006-01-22 Srinivasa Ragavan <sragavan@novell.com> ** Committing Ebby Wiselyn's patch for GtkPrint API migration. 2006-01-22 Srinivasa Ragavan <sragavan@novell.com> ** Committing Ebby Wiselyn's patch for GtkPrint API migration. svn path=/trunk/; revision=33134
Diffstat (limited to 'mail/em-folder-view.c')
-rw-r--r--mail/em-folder-view.c62
1 files changed, 35 insertions, 27 deletions
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c
index f7467b409c..a1f24b1c8c 100644
--- a/mail/em-folder-view.c
+++ b/mail/em-folder-view.c
@@ -83,7 +83,7 @@
#include "e-util/e-dialog-utils.h"
#include "e-util/e-icon-factory.h"
#include "e-util/e-print.h"
-#include "e-util/e-profile-event.h"
+#include "e-util/e-profile-event.h"
#include "e-util/e-util-private.h"
#include "filter/filter-rule.h"
@@ -110,6 +110,7 @@
#include "mail-vfolder.h"
#include "mail-component.h"
#include "mail-tools.h"
+#include <gtk/gtkprintunixdialog.h>
#include "evolution-shell-component-utils.h" /* Pixmap stuff, sigh */
@@ -2115,7 +2116,7 @@ emfv_activate(EMFolderView *emfv, BonoboUIComponent *uic, int act)
struct _print_data {
EMFolderView *emfv;
- GnomePrintConfig *config;
+ GtkPrintSettings *settings;
int preview;
CamelFolder *folder;
char *uid;
@@ -2125,28 +2126,32 @@ static void
emfv_print_response(GtkWidget *w, int resp, struct _print_data *data)
{
EMFormatHTMLPrint *print;
-
+ gboolean preview = FALSE;
+
switch (resp) {
- case GNOME_PRINT_DIALOG_RESPONSE_PREVIEW:
- data->preview = TRUE;
- case GNOME_PRINT_DIALOG_RESPONSE_PRINT:
- 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, data->config, data->folder, data->uid, data->preview);
- g_object_unref(print);
- break;
+ case GTK_RESPONSE_APPLY:
+ preview = TRUE;
+ case GTK_RESPONSE_OK:
+ print = em_format_html_print_new ();
+ print->preview = preview;
+ em_format_set_session ((EMFormat *)print, ((EMFormat *)data->emfv->preview)->session);
+ em_format_html_print_message (print,
+ (EMFormatHTML *)data->emfv->preview,
+ data->settings,
+ data->folder,
+ data->uid,
+ data->preview);
+ g_object_unref(print);
+ break;
}
+ g_object_unref (data->emfv);
+ g_object_unref (data->settings);
+ camel_object_unref (data->folder);
+ g_free (data->uid);
+ g_free (data);
+}
- if (w)
- 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);
-}
int em_folder_view_print(EMFolderView *emfv, int preview)
{
@@ -2165,7 +2170,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->settings = e_print_load_config ();
data->preview = preview;
data->folder = emfv->folder;
camel_object_ref(data->folder);
@@ -2173,14 +2178,17 @@ int em_folder_view_print(EMFolderView *emfv, int preview)
message_list_free_uids(emfv->list, uids);
if (preview) {
- emfv_print_response(NULL, GNOME_PRINT_DIALOG_RESPONSE_PREVIEW, data);
+ GtkDialog *dialog = (GtkDialog *)e_print_get_dialog_with_config (_("Print Message"),
+ GNOME_PRINT_DIALOG_COPIES, data->settings);
+ gtk_dialog_set_default_response (dialog, GTK_RESPONSE_APPLY);
+ e_dialog_set_transient_for ((GtkWindow *) dialog, (GtkWidget *) emfv);
+ emfv_print_response(dialog, GTK_RESPONSE_APPLY, data);
} else {
- 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);
+ GtkDialog *dialog = (GtkDialog *)e_print_get_dialog_with_config (_("Print Message"),
+ GNOME_PRINT_DIALOG_COPIES, data->settings);
+ gtk_dialog_set_default_response (dialog, GTK_RESPONSE_OK);
e_dialog_set_transient_for ((GtkWindow *) dialog, (GtkWidget *) emfv);
- g_signal_connect(dialog, "response", G_CALLBACK(emfv_print_response), data);
- gtk_widget_show((GtkWidget *)dialog);
+ emfv_print_response (dialog, GTK_RESPONSE_OK, data);
}
return 0;