From 315fea41788c87515239ef8b9d26c7bdbd23d1d1 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Tue, 6 Jun 2000 05:51:46 +0000 Subject: Bind right click on the ETable to "Save to VCard." 2000-06-06 Christopher James Lahey * gui/component/addressbook.c: Bind right click on the ETable to "Save to VCard." svn path=/trunk/; revision=3438 --- addressbook/gui/component/addressbook.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'addressbook/gui') diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c index 779b4bc147..f98ec6eb51 100644 --- a/addressbook/gui/component/addressbook.c +++ b/addressbook/gui/component/addressbook.c @@ -19,6 +19,7 @@ #include #include #include +#include #include "e-minicard-view.h" #include @@ -26,6 +27,7 @@ #include #include "e-contact-editor.h" +#include "e-contact-save-as.h" #include "e-ldap-server-dialog.h" #include @@ -857,6 +859,23 @@ table_double_click(ETable *table, gint row, AddressbookView *view) gnome_dialog_close(GNOME_DIALOG (dlg)); } +static void +save_as (GtkWidget *widget, ECard *card) +{ + e_contact_save_as(_("Save as VCard"), card); +} + +static gint +table_right_click(ETable *table, gint row, gint col, GdkEvent *event, AddressbookView *view) +{ + ECard *card = e_addressbook_model_get_card(E_ADDRESSBOOK_MODEL(view->model), row); + EPopupMenu menu[] = { {"Save as VCard", NULL, GTK_SIGNAL_FUNC(save_as), 0}, {NULL, NULL, NULL, 0} }; + + e_popup_menu_run (menu, (GdkEventButton *)event, 0, card); + + return TRUE; +} + static void create_table_view (AddressbookView *view, char *initial_query) { @@ -906,6 +925,8 @@ create_table_view (AddressbookView *view, char *initial_query) gtk_signal_connect(GTK_OBJECT(view->table), "double_click", GTK_SIGNAL_FUNC(table_double_click), view); + gtk_signal_connect(GTK_OBJECT(view->table), "right_click", + GTK_SIGNAL_FUNC(table_right_click), view); gtk_box_pack_start(GTK_BOX(view->vbox), view->table, TRUE, TRUE, 0); -- cgit v1.2.3