From 33efd90a82fbbbfb3f7645a149cfbfed471596fb Mon Sep 17 00:00:00 2001 From: Not Zed Date: Wed, 3 Dec 2003 00:27:52 +0000 Subject: changed to setup the rule part properly, it could never have worked. Bug 2003-12-03 Not Zed * mail-autofilter.c (rule_match_thread): changed to setup the rule part properly, it could never have worked. Bug #51601. * em-popup.c (emp_uri_popup_address_add): implement. * em-folder-view.c (emfv_popup_add_sender): implement. (emfv_add_sender_addressbook): hook up to above func. * em-utils.c (em_utils_add_address): implementation to add an email address to the addressbook. (emu_add_address_cb): callback required for funny api. Bug #51321. svn path=/trunk/; revision=23592 --- mail/em-utils.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'mail/em-utils.c') diff --git a/mail/em-utils.c b/mail/em-utils.c index 6a0712d311..e2da2fa6d3 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -1443,6 +1443,48 @@ em_utils_save_messages (GtkWidget *parent, CamelFolder *folder, GPtrArray *uids) gtk_widget_show((GtkWidget *)filesel); } +/* ********************************************************************** */ + +static void +emu_add_address_cb(BonoboListener *listener, const char *name, const CORBA_any *any, CORBA_Environment *ev, void *data) +{ + char *type = bonobo_event_subtype(name); + + if (!strcmp(type, "Destroy")) + gtk_widget_destroy((GtkWidget *)data); + + g_free(type); +} + +/** + * em_utils_add_address: + * @parent: + * @email: + * + * Add address @email to the addressbook. + **/ +void em_utils_add_address(struct _GtkWidget *parent, const char *email) +{ + GtkWidget *win; + GtkWidget *control; + /*GtkWidget *socket;*/ + + win = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_window_set_title((GtkWindow *)win, _("Add address")); + + control = bonobo_widget_new_control("OAFIID:GNOME_Evolution_Addressbook_AddressPopup:" BASE_VERSION, CORBA_OBJECT_NIL); + bonobo_widget_set_property((BonoboWidget *)control, "email", TC_CORBA_string, email, NULL); + + bonobo_event_source_client_add_listener(bonobo_widget_get_objref((BonoboWidget *)control), emu_add_address_cb, NULL, NULL, win); + + /*socket = find_socket (GTK_CONTAINER (control)); + g_object_weak_ref ((GObject *) socket, (GWeakNotify) gtk_widget_destroy, win);*/ + + gtk_container_add((GtkContainer *)win, control); + gtk_widget_show_all(win); +} + +/* ********************************************************************** */ /* Flag-for-Followup... */ /* tag-editor callback data */ -- cgit