From 653cfffc0e00dfb59b36813c1b45c53d3f773c65 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Tue, 21 Oct 2003 18:49:34 +0000 Subject: Merge new-ui-branch to the trunk. svn path=/trunk/; revision=22965 --- addressbook/printing/e-contact-print-envelope.c | 31 +++++++++++-------------- 1 file changed, 13 insertions(+), 18 deletions(-) (limited to 'addressbook/printing/e-contact-print-envelope.c') diff --git a/addressbook/printing/e-contact-print-envelope.c b/addressbook/printing/e-contact-print-envelope.c index 93916744da..c7bd68163f 100644 --- a/addressbook/printing/e-contact-print-envelope.c +++ b/addressbook/printing/e-contact-print-envelope.c @@ -29,8 +29,6 @@ #include #include #include -#include "addressbook/backend/ebook/e-card.h" -#include "addressbook/backend/ebook/e-card-simple.h" #define ENVELOPE_HEIGHT (72.0 * 4.0) #define ENVELOPE_WIDTH (72.0 * 9.5) @@ -131,9 +129,8 @@ e_contact_print_envelope_close(GnomeDialog *dialog, gpointer data) } static void -ecpe_print(GnomePrintContext *pc, ECard *ecard, gboolean as_return) +ecpe_print(GnomePrintContext *pc, EContact *contact, gboolean as_return) { - ECardSimple *card = e_card_simple_new(ecard); char *address; EcpeLine *linelist; double x; @@ -144,7 +141,7 @@ ecpe_print(GnomePrintContext *pc, ECard *ecard, gboolean as_return) gnome_print_rotate(pc, 90); gnome_print_translate(pc, 72.0 * 11.0 - ENVELOPE_WIDTH, -72.0 * 8.5 + (72.0 * 8.5 - ENVELOPE_HEIGHT) / 2); - address = e_card_simple_get(card, E_CARD_SIMPLE_FIELD_ADDRESS_BUSINESS); + address = e_contact_get(contact, E_CONTACT_ADDRESS_LABEL_WORK); linelist = ecpe_break(address); if (as_return) font = gnome_font_find ("Sans", 9); @@ -166,8 +163,6 @@ ecpe_print(GnomePrintContext *pc, ECard *ecard, gboolean as_return) gnome_print_showpage(pc); gnome_print_context_close(pc); - - g_object_unref(card); } static void @@ -176,10 +171,10 @@ e_contact_print_envelope_button(GnomeDialog *dialog, gint button, gpointer data) GnomePrintJob *master; GnomePrintContext *pc; GnomePrintConfig *config; - ECard *card = NULL; + EContact *contact = NULL; GtkWidget *preview; - card = g_object_get_data(G_OBJECT(dialog), "card"); + contact = g_object_get_data(G_OBJECT(dialog), "contact"); switch( button ) { case GNOME_PRINT_DIALOG_RESPONSE_PRINT: @@ -187,7 +182,7 @@ e_contact_print_envelope_button(GnomeDialog *dialog, gint button, gpointer data) master = gnome_print_job_new (config); pc = gnome_print_job_get_context( master ); - ecpe_print(pc, card, FALSE); + ecpe_print(pc, contact, FALSE); gnome_print_job_print(master); gnome_dialog_close(dialog); @@ -197,27 +192,27 @@ e_contact_print_envelope_button(GnomeDialog *dialog, gint button, gpointer data) master = gnome_print_job_new (config); pc = gnome_print_job_get_context( master ); - ecpe_print(pc, card, FALSE); + ecpe_print(pc, contact, FALSE); preview = GTK_WIDGET(gnome_print_job_preview_new(master, "Print Preview")); gtk_widget_show_all(preview); break; case GNOME_PRINT_DIALOG_RESPONSE_CANCEL: - g_object_unref(card); + g_object_unref(contact); gnome_dialog_close(dialog); break; } } GtkWidget * -e_contact_print_envelope_dialog_new(ECard *card) +e_contact_print_envelope_dialog_new(EContact *contact) { GtkWidget *dialog; dialog = gnome_print_dialog_new(NULL, _("Print envelope"), GNOME_PRINT_DIALOG_COPIES); - card = e_card_duplicate(card); - g_object_set_data(G_OBJECT(dialog), "card", card); + contact = e_contact_duplicate(contact); + g_object_set_data(G_OBJECT(dialog), "contact", contact); g_signal_connect(dialog, "clicked", G_CALLBACK(e_contact_print_envelope_button), NULL); g_signal_connect(dialog, @@ -230,15 +225,15 @@ GtkWidget * e_contact_print_envelope_list_dialog_new(GList *list) { GtkWidget *dialog; - ECard *card; + EContact *contact; if (list == NULL) return NULL; dialog = gnome_print_dialog_new(NULL, _("Print envelope"), GNOME_PRINT_DIALOG_COPIES); - card = e_card_duplicate(list->data); - g_object_set_data(G_OBJECT(dialog), "card", card); + contact = e_contact_duplicate(list->data); + g_object_set_data(G_OBJECT(dialog), "contact", contact); g_signal_connect(dialog, "clicked", G_CALLBACK(e_contact_print_envelope_button), NULL); g_signal_connect(dialog, -- cgit