From 618515cd0beaed45af59994d84592b5d513bd979 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Sat, 11 Nov 2000 21:29:07 +0000 Subject: Link in composer bonobo code. 2000-11-11 Christopher James Lahey * backend/ebook/Makefile.am: Link in composer bonobo code. * backend/ebook/e-card.c, backend/ebook/e-card.h: Added code to send mail to an ECard or send an ECard as a VCard attachment. * contact-editor/e-contact-editor.c: Add verbs to send the contact as a VCard or send mail to the contact. * gui/search/e-addressbook-search-dialog.c: Removed some unused variables. * gui/widgets/e-addressbook-view.c, gui/widgets/e-minicard.c: Added menu items to send the contact as a VCard or send mail to the contact. svn path=/trunk/; revision=6543 --- addressbook/gui/widgets/e-addressbook-view.c | 26 ++++++++++++++++---- addressbook/gui/widgets/e-minicard.c | 36 +++++++++++++++++----------- 2 files changed, 43 insertions(+), 19 deletions(-) (limited to 'addressbook/gui/widgets') diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index 3d081ab14c..d0d6984faf 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -416,6 +416,20 @@ save_as (GtkWidget *widget, CardAndBook *card_and_book) card_and_book_free(card_and_book); } +static void +send_as (GtkWidget *widget, CardAndBook *card_and_book) +{ + e_card_send(card_and_book->card, E_CARD_DISPOSITION_AS_ATTACHMENT); + card_and_book_free(card_and_book); +} + +static void +send_to (GtkWidget *widget, CardAndBook *card_and_book) +{ + e_card_send(card_and_book->card, E_CARD_DISPOSITION_AS_TO); + card_and_book_free(card_and_book); +} + static void print (GtkWidget *widget, CardAndBook *card_and_book) { @@ -451,11 +465,13 @@ table_right_click(ETableScrolled *table, gint row, gint col, GdkEvent *event, EA CardAndBook *card_and_book; EPopupMenu menu[] = { - {"Save as VCard", NULL, GTK_SIGNAL_FUNC(save_as), 0}, - {"Print", NULL, GTK_SIGNAL_FUNC(print), 0}, - {"Print Envelope", NULL, GTK_SIGNAL_FUNC(print_envelope), 0}, - {"Delete", NULL, GTK_SIGNAL_FUNC(delete), 0}, - {NULL, NULL, NULL, 0} + {"Save as VCard", NULL, GTK_SIGNAL_FUNC(save_as), NULL, 0}, + {"Send contact to other", NULL, GTK_SIGNAL_FUNC(send_as), NULL, 0}, + {"Send message to contact", NULL, GTK_SIGNAL_FUNC(send_to), NULL, 0}, + {"Print", NULL, GTK_SIGNAL_FUNC(print), NULL, 0}, + {"Print Envelope", NULL, GTK_SIGNAL_FUNC(print_envelope), NULL, 0}, + {"Delete", NULL, GTK_SIGNAL_FUNC(delete), NULL, 0}, + {NULL, NULL, NULL, NULL, 0} }; card_and_book = g_new(CardAndBook, 1); diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index 4dda2cee1d..6bf1d57c9a 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -338,6 +338,20 @@ save_as (GtkWidget *widget, EMinicard *minicard) e_contact_save_as(_("Save as VCard"), minicard->card); } +static void +send_as (GtkWidget *widget, EMinicard *minicard) +{ + e_card_simple_sync_card(minicard->simple); + e_card_send(minicard->card, E_CARD_DISPOSITION_AS_ATTACHMENT); +} + +static void +send_to (GtkWidget *widget, EMinicard *minicard) +{ + e_card_simple_sync_card(minicard->simple); + e_card_send(minicard->card, E_CARD_DISPOSITION_AS_TO); +} + static void delete (GtkWidget *widget, EMinicard *minicard) { @@ -483,20 +497,14 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) if (event->button.button == 1) { e_canvas_item_grab_focus(item); } else if (event->button.button == 3) { - if (E_IS_MINICARD_VIEW(item->parent)) { - EPopupMenu menu[] = { {"Save as VCard", NULL, GTK_SIGNAL_FUNC(save_as), 0}, - {"Print", NULL, GTK_SIGNAL_FUNC(print), 0}, - {"Print Envelope", NULL, GTK_SIGNAL_FUNC(print_envelope), 0}, - {"Delete", NULL, GTK_SIGNAL_FUNC(delete), 0}, - {NULL, NULL, NULL, 0}}; - e_popup_menu_run (menu, (GdkEventButton *)event, 0, 0, e_minicard); - } else { - EPopupMenu menu[] = { {"Save as VCard", NULL, GTK_SIGNAL_FUNC(save_as), 0}, - {"Print Envelope", NULL, GTK_SIGNAL_FUNC(print_envelope), 0}, - {"Print", NULL, GTK_SIGNAL_FUNC(print), 0}, - {NULL, NULL, NULL, 0}}; - e_popup_menu_run (menu, (GdkEventButton *)event, 0, 0, e_minicard); - } + EPopupMenu menu[] = { {"Save as VCard", NULL, GTK_SIGNAL_FUNC(save_as), NULL, 0}, + {"Send contact to other", NULL, GTK_SIGNAL_FUNC(send_as), NULL, 0}, + {"Send message to contact", NULL, GTK_SIGNAL_FUNC(send_to), NULL, 0}, + {"Print", NULL, GTK_SIGNAL_FUNC(print), NULL, 0}, + {"Print Envelope", NULL, GTK_SIGNAL_FUNC(print_envelope), NULL, 0}, + {"Delete", NULL, GTK_SIGNAL_FUNC(delete), NULL, 1}, + {NULL, NULL, NULL, 0}}; + e_popup_menu_run (menu, (GdkEventButton *)event, 0, E_IS_MINICARD_VIEW(item->parent) ? 0 : 1, e_minicard); } break; -- cgit v1.2.3