aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/printing/e-contact-print-envelope.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2002-11-07 15:38:30 +0800
committerChris Toshok <toshok@src.gnome.org>2002-11-07 15:38:30 +0800
commitb89320e2f3d0a8c69dd6ecfd33b125481cd837d8 (patch)
tree441c0942eadeccf13e244ab3df496ca7ef5dabc2 /addressbook/printing/e-contact-print-envelope.c
parentb59fb51176c10c48865572b27d697c6cc51358d3 (diff)
downloadgsoc2013-evolution-b89320e2f3d0a8c69dd6ecfd33b125481cd837d8.tar
gsoc2013-evolution-b89320e2f3d0a8c69dd6ecfd33b125481cd837d8.tar.gz
gsoc2013-evolution-b89320e2f3d0a8c69dd6ecfd33b125481cd837d8.tar.bz2
gsoc2013-evolution-b89320e2f3d0a8c69dd6ecfd33b125481cd837d8.tar.lz
gsoc2013-evolution-b89320e2f3d0a8c69dd6ecfd33b125481cd837d8.tar.xz
gsoc2013-evolution-b89320e2f3d0a8c69dd6ecfd33b125481cd837d8.tar.zst
gsoc2013-evolution-b89320e2f3d0a8c69dd6ecfd33b125481cd837d8.zip
port this to gnome2/gnomeprint2.
2002-11-06 Chris Toshok <toshok@ximian.com> * 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
Diffstat (limited to 'addressbook/printing/e-contact-print-envelope.c')
-rw-r--r--addressbook/printing/e-contact-print-envelope.c51
1 files changed, 26 insertions, 25 deletions
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 <config.h>
#include "addressbook/printing/e-contact-print-envelope.h"
#include <glib.h>
-#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
+#include <libgnomeui/gnome-dialog.h>
#include <time.h>
-#include <libgnome/gnome-paper.h>
+#include <libgnomeprintui/gnome-print-dialog.h>
#include <libgnomeprint/gnome-print.h>
-#include <libgnomeprint/gnome-print-dialog.h>
#include <libgnomeprint/gnome-print-master.h>
-#include <libgnomeprint/gnome-print-master-preview.h>
#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;
}