diff options
Diffstat (limited to 'addressbook/gui')
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-editor.c | 32 | ||||
-rw-r--r-- | addressbook/gui/search/e-addressbook-search-dialog.c | 4 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-view.c | 26 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard.c | 36 |
4 files changed, 75 insertions, 23 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index c4e8ed8640..9e1afacb7b 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -662,6 +662,36 @@ file_save_as_cb (GtkWidget *widget, gpointer data) e_contact_save_as("Save as VCard", card); } +static void +file_send_as_cb (GtkWidget *widget, gpointer data) +{ + EContactEditor *ce; + ECard *card; + + ce = E_CONTACT_EDITOR (data); + + extract_info (ce); + e_card_simple_sync_card (ce->simple); + + card = ce->card; + e_card_send(card, E_CARD_DISPOSITION_AS_ATTACHMENT); +} + +static void +file_send_to_cb (GtkWidget *widget, gpointer data) +{ + EContactEditor *ce; + ECard *card; + + ce = E_CONTACT_EDITOR (data); + + extract_info (ce); + e_card_simple_sync_card (ce->simple); + + card = ce->card; + e_card_send(card, E_CARD_DISPOSITION_AS_TO); +} + gboolean e_contact_editor_confirm_delete(GtkWindow *parent) { @@ -744,6 +774,8 @@ BonoboUIVerb verbs [] = { BONOBO_UI_UNSAFE_VERB ("ContactEditorSave", file_save_cb), BONOBO_UI_UNSAFE_VERB ("ContactEditorSaveAs", file_save_as_cb), BONOBO_UI_UNSAFE_VERB ("ContactEditorSaveClose", tb_save_and_close_cb), + BONOBO_UI_UNSAFE_VERB ("ContactEditorSendAs", file_send_as_cb), + BONOBO_UI_UNSAFE_VERB ("ContactEditorSendTo", file_send_to_cb), BONOBO_UI_UNSAFE_VERB ("ContactEditorDelete", delete_cb), BONOBO_UI_UNSAFE_VERB ("ContactEditorPrint", print_cb), BONOBO_UI_UNSAFE_VERB ("ContactEditorPrintEnvelope", print_envelope_cb), diff --git a/addressbook/gui/search/e-addressbook-search-dialog.c b/addressbook/gui/search/e-addressbook-search-dialog.c index 60f92cfff4..c1cce6301a 100644 --- a/addressbook/gui/search/e-addressbook-search-dialog.c +++ b/addressbook/gui/search/e-addressbook-search-dialog.c @@ -72,12 +72,8 @@ static void e_addressbook_search_dialog_class_init (EAddressbookSearchDialogClass *klass) { GtkObjectClass *object_class; - GtkWidgetClass *widget_class; - ECanvasClass *canvas_class; object_class = (GtkObjectClass*) klass; - widget_class = GTK_WIDGET_CLASS (klass); - canvas_class = E_CANVAS_CLASS (klass); parent_class = gtk_type_class (PARENT_TYPE); 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 @@ -417,6 +417,20 @@ save_as (GtkWidget *widget, CardAndBook *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) { gtk_widget_show(e_contact_print_card_dialog_new(card_and_book->card)); @@ -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 @@ -339,6 +339,20 @@ save_as (GtkWidget *widget, EMinicard *minicard) } 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) { EBook *book; @@ -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; |