From 54b0b2121cb06e2cd0483a7adf8c4aac86308daf Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Tue, 23 May 2000 11:03:09 +0000 Subject: Added e-contact-editor-save-as.c and e-contact-editor-save-as.h. 2000-05-23 Christopher James Lahey * contact-editor/Makefile.am: Added e-contact-editor-save-as.c and e-contact-editor-save-as.h. * contact-editor/e-contact-save-as.c, contact-editor/e-contact-save-as.h: New files that display a save as dialog and then save the given card to that file. * gui/minicard/e-minicard.c: Call e_contact_save_as in a right click menu. svn path=/trunk/; revision=3182 --- addressbook/gui/widgets/e-minicard.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'addressbook/gui/widgets') diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index 0089adb5dd..7831b3152d 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -29,7 +29,9 @@ #include #include #include +#include #include "e-contact-editor.h" +#include "e-contact-save-as.h" #include "e-minicard-view.h" static void e_minicard_init (EMinicard *card); @@ -314,6 +316,13 @@ card_changed_cb (EBook* book, EBookStatus status, gpointer user_data) g_print ("%s: %s(): a card was changed with status %d\n", __FILE__, __FUNCTION__, status); } +static void +save_as (GtkWidget *widget, EMinicard *minicard) +{ + e_card_simple_sync_card(minicard->simple); + e_contact_save_as(_("Save as VCard"), minicard->card); +} + static gboolean e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) { @@ -367,6 +376,9 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) case GDK_BUTTON_PRESS: if (event->button.button == 1) { e_canvas_item_grab_focus(item); + } else if (event->button.button == 3) { + EPopupMenu menu[] = { {"Save as VCard", NULL, GTK_SIGNAL_FUNC(save_as), 0}, {NULL, NULL, NULL, 0} }; + e_popup_menu_run (menu, (GdkEventButton *)event, 0, e_minicard); } break; case GDK_2BUTTON_PRESS: -- cgit v1.2.3