From b89320e2f3d0a8c69dd6ecfd33b125481cd837d8 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Thu, 7 Nov 2002 07:38:30 +0000 Subject: port this to gnome2/gnomeprint2. 2002-11-06 Chris Toshok * printing/e-contact-print-envelope.c: port this to gnome2/gnomeprint2. * printing/e-contact-print-style-editor.c: same. * printing/e-contact-print.c: same. * printing/test-contact-print-style-editor.c: same. * printing/test-print.c: same. * printing/e-contact-print.glade: libglade-convert to libglade-2. * printing/Makefile.am (contact_print_test_LDADD) (contact_print_style_editor_test_LDADD): remove libcamel.la from these for the time being to get things linking. svn path=/trunk/; revision=18628 --- addressbook/printing/e-contact-print-envelope.c | 51 +++++++++++++------------ 1 file changed, 26 insertions(+), 25 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 2f65afa81b..ba57f75ae2 100644 --- a/addressbook/printing/e-contact-print-envelope.c +++ b/addressbook/printing/e-contact-print-envelope.c @@ -22,14 +22,12 @@ #include #include "addressbook/printing/e-contact-print-envelope.h" #include -#include #include +#include #include -#include +#include #include -#include #include -#include #include "addressbook/backend/ebook/e-card.h" #include "addressbook/backend/ebook/e-card-simple.h" @@ -148,9 +146,9 @@ ecpe_print(GnomePrintContext *pc, ECard *ecard, gboolean as_return) address = e_card_simple_get(card, E_CARD_SIMPLE_FIELD_ADDRESS_BUSINESS); linelist = ecpe_break(address); if (as_return) - font = gnome_font_new("Helvetica", 9); + font = gnome_font_find ("Helvetica", 9); else - font = gnome_font_new("Helvetica", 12); + font = gnome_font_find ("Helvetica", 12); ecpe_linelist_dimensions(font, address, linelist, NULL, &y); if (as_return) { x = 36; @@ -160,7 +158,7 @@ ecpe_print(GnomePrintContext *pc, ECard *ecard, gboolean as_return) y = (ENVELOPE_HEIGHT - y) / 2; } ecpe_linelist_print(pc, font, address, linelist, x, y); - gtk_object_unref(GTK_OBJECT(font)); + g_object_unref(font); g_free(linelist); g_free(address); @@ -168,7 +166,7 @@ ecpe_print(GnomePrintContext *pc, ECard *ecard, gboolean as_return) gnome_print_showpage(pc); gnome_print_context_close(pc); - gtk_object_unref(GTK_OBJECT(card)); + g_object_unref(card); } static void @@ -176,14 +174,16 @@ e_contact_print_envelope_button(GnomeDialog *dialog, gint button, gpointer data) { GnomePrintMaster *master; GnomePrintContext *pc; + GnomePrintConfig *config; ECard *card = NULL; GtkWidget *preview; - card = gtk_object_get_data(GTK_OBJECT(dialog), "card"); + card = g_object_get_data(G_OBJECT(dialog), "card"); switch( button ) { - case GNOME_PRINT_PRINT: - master = gnome_print_master_new_from_dialog( GNOME_PRINT_DIALOG(dialog) ); + case GNOME_PRINT_DIALOG_RESPONSE_PRINT: + config = gnome_print_dialog_get_config (GNOME_PRINT_DIALOG (dialog)); + master = gnome_print_master_new_from_config (config); pc = gnome_print_master_get_context( master ); ecpe_print(pc, card, FALSE); @@ -191,8 +191,9 @@ e_contact_print_envelope_button(GnomeDialog *dialog, gint button, gpointer data) gnome_print_master_print(master); gnome_dialog_close(dialog); break; - case GNOME_PRINT_PREVIEW: - master = gnome_print_master_new_from_dialog( GNOME_PRINT_DIALOG(dialog) ); + case GNOME_PRINT_DIALOG_RESPONSE_PREVIEW: + config = gnome_print_dialog_get_config (GNOME_PRINT_DIALOG (dialog)); + master = gnome_print_master_new_from_config (config); pc = gnome_print_master_get_context( master ); ecpe_print(pc, card, FALSE); @@ -200,8 +201,8 @@ e_contact_print_envelope_button(GnomeDialog *dialog, gint button, gpointer data) preview = GTK_WIDGET(gnome_print_master_preview_new(master, "Print Preview")); gtk_widget_show_all(preview); break; - case GNOME_PRINT_CANCEL: - gtk_object_unref(GTK_OBJECT(card)); + case GNOME_PRINT_DIALOG_RESPONSE_CANCEL: + g_object_unref(card); gnome_dialog_close(dialog); break; } @@ -215,11 +216,11 @@ e_contact_print_envelope_dialog_new(ECard *card) dialog = gnome_print_dialog_new(_("Print envelope"), GNOME_PRINT_DIALOG_COPIES); card = e_card_duplicate(card); - gtk_object_set_data(GTK_OBJECT(dialog), "card", card); - gtk_signal_connect(GTK_OBJECT(dialog), - "clicked", GTK_SIGNAL_FUNC(e_contact_print_envelope_button), NULL); - gtk_signal_connect(GTK_OBJECT(dialog), - "close", GTK_SIGNAL_FUNC(e_contact_print_envelope_close), NULL); + g_object_set_data(G_OBJECT(dialog), "card", card); + g_signal_connect(dialog, + "clicked", G_CALLBACK(e_contact_print_envelope_button), NULL); + g_signal_connect(dialog, + "close", G_CALLBACK(e_contact_print_envelope_close), NULL); return dialog; } @@ -236,10 +237,10 @@ e_contact_print_envelope_list_dialog_new(GList *list) dialog = gnome_print_dialog_new(_("Print envelope"), GNOME_PRINT_DIALOG_COPIES); card = e_card_duplicate(list->data); - gtk_object_set_data(GTK_OBJECT(dialog), "card", card); - gtk_signal_connect(GTK_OBJECT(dialog), - "clicked", GTK_SIGNAL_FUNC(e_contact_print_envelope_button), NULL); - gtk_signal_connect(GTK_OBJECT(dialog), - "close", GTK_SIGNAL_FUNC(e_contact_print_envelope_close), NULL); + g_object_set_data(G_OBJECT(dialog), "card", card); + g_signal_connect(dialog, + "clicked", G_CALLBACK(e_contact_print_envelope_button), NULL); + g_signal_connect(dialog, + "close", G_CALLBACK(e_contact_print_envelope_close), NULL); return dialog; } -- cgit v1.2.3