Index: configure.in =================================================================== RCS file: /cvs/gnome/evolution/configure.in,v retrieving revision 1.722 diff -u -r1.722 configure.in --- configure.in 1 Oct 2004 19:39:05 -0000 1.722 +++ configure.in 14 Oct 2004 06:59:38 -0000 @@ -1130,7 +1130,7 @@ dnl --- Flags for the various libraries we build -EVO_SET_COMPILE_FLAGS(CAMEL, glib-2.0 gthread-2.0 gal-2.4 >= $GAL_REQUIRED $mozilla_nss, +EVO_SET_COMPILE_FLAGS(CAMEL, glib-2.0 gthread-2.0 gal-2.4 >= $GAL_REQUIRED $mozilla_nss libebook-$EDS_PACKAGE >= $EDS_REQUIRED, $THREADS_CFLAGS $KRB4_CFLAGS $KRB5_CFLAGS $MANUAL_NSS_CFLAGS $OPENSSL_CFLAGS, $THREADS_LIBS $KRB4_LDFLAGS $KRB5_LDFLAGS $MANUAL_NSS_LIBS $OPENSSL_LDFLAGS) AC_SUBST(CAMEL_CFLAGS) @@ -1161,7 +1161,7 @@ AC_SUBST(E_NAME_CFLAGS) AC_SUBST(E_NAME_LIBS) -EVO_SET_COMPILE_FLAGS(E_UTIL, gthread-2.0 gconf-2.0 libxml-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED libglade-2.0 gal-$GAL_PACKAGE >= $GAL_REQUIRED libgnomeui-2.0 libgnome-2.0 libgnomecanvas-2.0 libedataserver-$EDS_PACKAGE >= $EDS_REQUIRED $mozilla_nspr $mono_package, $THREADS_CFLAGS $MANUAL_NSPR_CFLAGS, $THREADS_LIBS $MANUAL_NSPR_LIBS) +EVO_SET_COMPILE_FLAGS(E_UTIL, gthread-2.0 gconf-2.0 libxml-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED libglade-2.0 gal-$GAL_PACKAGE >= $GAL_REQUIRED libgnomeui-2.0 libgnome-2.0 libgnomecanvas-2.0 libedataserver-$EDS_PACKAGE >= $EDS_REQUIRED libebook-$EDS_PACKAGE >= $EDS_REQUIRED $mozilla_nspr $mono_package libgalago, $THREADS_CFLAGS $MANUAL_NSPR_CFLAGS, $THREADS_LIBS $MANUAL_NSPR_LIBS) AC_SUBST(E_UTIL_CFLAGS) AC_SUBST(E_UTIL_LIBS) @@ -1189,13 +1189,13 @@ dnl --- evolution (shell) flags -EVO_SET_COMPILE_FLAGS(SHELL, libgnome-2.0 libgnomeui-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED gal-$GAL_PACKAGE >= $GAL_REQUIRED libglade-2.0 gnome-vfs-2.0 libgtkhtml-$GTKHTML_PACKAGE >= $GTKHTML_REQUIRED) +EVO_SET_COMPILE_FLAGS(SHELL, libgnome-2.0 libgnomeui-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED gal-$GAL_PACKAGE >= $GAL_REQUIRED libglade-2.0 gnome-vfs-2.0 libgtkhtml-$GTKHTML_PACKAGE >= $GTKHTML_REQUIRED libebook-$EDS_PACKAGE >= $EDS_REQUIRED libgalago-gtk) AC_SUBST(SHELL_CFLAGS) AC_SUBST(SHELL_LIBS) dnl --- evolution-addressbook flags -EVOLUTION_ADDRESSBOOK_DEPS="gconf-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED libglade-2.0 gal-$GAL_PACKAGE >= $GAL_REQUIRED libgnomeui-2.0 libgnome-2.0 libgnomecanvas-2.0 gnome-vfs-2.0 libgnomeprintui-2.2 libgtkhtml-$GTKHTML_PACKAGE >= $GTKHTML_REQUIRED libebook-$EDS_PACKAGE >= $EDS_REQUIRED" +EVOLUTION_ADDRESSBOOK_DEPS="gconf-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED libglade-2.0 gal-$GAL_PACKAGE >= $GAL_REQUIRED libgnomeui-2.0 libgnome-2.0 libgnomecanvas-2.0 gnome-vfs-2.0 libgnomeprintui-2.2 libgtkhtml-$GTKHTML_PACKAGE >= $GTKHTML_REQUIRED libebook-$EDS_PACKAGE >= $EDS_REQUIRED libgalago-gtk" EVO_SET_COMPILE_FLAGS(EVOLUTION_ADDRESSBOOK, $EVOLUTION_ADDRESSBOOK_DEPS) AC_SUBST(EVOLUTION_ADDRESSBOOK_CFLAGS) @@ -1224,7 +1224,7 @@ dnl --- evolution-mail flags -EVO_SET_COMPILE_FLAGS(EVOLUTION_MAIL, libgnome-2.0 libgnomeui-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED gal-$GAL_PACKAGE >= $GAL_REQUIRED libglade-2.0 gnome-vfs-module-2.0 libgnomeprint-2.2 libgnomeprintui-2.2 libgtkhtml-$GTKHTML_PACKAGE >= $GTKHTML_REQUIRED libxml-2.0 bonobo-activation-2.0 gthread-2.0 gconf-2.0 $mozilla_nss libebook-$EDS_PACKAGE >= $EDS_REQUIRED) +EVO_SET_COMPILE_FLAGS(EVOLUTION_MAIL, libgnome-2.0 libgnomeui-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED gal-$GAL_PACKAGE >= $GAL_REQUIRED libglade-2.0 gnome-vfs-module-2.0 libgnomeprint-2.2 libgnomeprintui-2.2 libgtkhtml-$GTKHTML_PACKAGE >= $GTKHTML_REQUIRED libxml-2.0 bonobo-activation-2.0 gthread-2.0 gconf-2.0 $mozilla_nss libebook-$EDS_PACKAGE >= $EDS_REQUIRED libgalago-gtk) AC_SUBST(EVOLUTION_MAIL_CFLAGS) AC_SUBST(EVOLUTION_MAIL_LIBS) Index: addressbook/gui/component/select-names/e-select-names-section.etspec =================================================================== RCS file: /cvs/gnome/evolution/addressbook/gui/component/select-names/e-select-names-section.etspec,v retrieving revision 1.2 diff -u -r1.2 e-select-names-section.etspec --- addressbook/gui/component/select-names/e-select-names-section.etspec 18 Mar 2003 20:42:41 -0000 1.2 +++ addressbook/gui/component/select-names/e-select-names-section.etspec 14 Oct 2004 06:59:38 -0000 @@ -1,7 +1,9 @@ - + + + Index: addressbook/gui/component/select-names/e-select-names-table-model.c =================================================================== RCS file: /cvs/gnome/evolution/addressbook/gui/component/select-names/e-select-names-table-model.c,v retrieving revision 1.24 diff -u -r1.24 e-select-names-table-model.c --- addressbook/gui/component/select-names/e-select-names-table-model.c 25 Aug 2004 15:46:45 -0000 1.24 +++ addressbook/gui/component/select-names/e-select-names-table-model.c 14 Oct 2004 06:59:38 -0000 @@ -13,8 +13,10 @@ #include #include +#include #include #include +#include #include "e-select-names-table-model.h" /* Object argument IDs */ @@ -121,7 +123,8 @@ EContact *contact = dest ? e_destination_get_contact (dest) : NULL; if (contact) { - model->data[i].name = e_contact_get(contact, E_CONTACT_NAME_OR_ORG); + model->data[i].person = e_galago_get_person_from_contact(contact); + model->data[i].name = e_contact_get(contact, E_CONTACT_NAME_OR_ORG); if (model->data[i].name == 0) model->data[i].name = g_strdup(""); model->data[i].email = e_contact_get(contact, E_CONTACT_EMAIL_1); @@ -131,8 +134,9 @@ const gchar *name = e_destination_get_name (dest); const gchar *email = e_destination_get_email (dest); - model->data[i].name = g_strdup (name && *name ? name : email); - model->data[i].email = g_strdup (email); + model->data[i].person = NULL; + model->data[i].name = g_strdup (name && *name ? name : email); + model->data[i].email = g_strdup (email); } } } else { @@ -206,18 +210,29 @@ } switch (col) { case 0: + if (e_select_names_table_model->data[row].person == NULL) { + fill_in_info(e_select_names_table_model); + } + if (e_select_names_table_model->data[row].person != NULL) { + return galago_gdk_pixbuf_new_from_person_with_size( + e_select_names_table_model->data[row].person, + GTK_ICON_SIZE_MENU, TRUE, FALSE); + } + return NULL; + break; + case 1: if (e_select_names_table_model->data[row].name == NULL) { fill_in_info(e_select_names_table_model); } return e_select_names_table_model->data[row].name; break; - case 1: + case 2: if (e_select_names_table_model->data[row].email == NULL) { fill_in_info(e_select_names_table_model); } return e_select_names_table_model->data[row].email; break; - case 2: + case 3: /* underline column*/ return (void*)TRUE; break; Index: addressbook/gui/component/select-names/e-select-names-table-model.h =================================================================== RCS file: /cvs/gnome/evolution/addressbook/gui/component/select-names/e-select-names-table-model.h,v retrieving revision 1.7 diff -u -r1.7 e-select-names-table-model.h --- addressbook/gui/component/select-names/e-select-names-table-model.h 8 Nov 2002 06:20:11 -0000 1.7 +++ addressbook/gui/component/select-names/e-select-names-table-model.h 14 Oct 2004 06:59:38 -0000 @@ -13,6 +13,7 @@ #include #include #include +#include #include "e-select-names-model.h" #define E_TYPE_SELECT_NAMES_TABLE_MODEL (e_select_names_table_model_get_type ()) @@ -22,6 +23,7 @@ #define E_IS_SELECT_NAMES_TABLE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_SELECT_NAMES_TABLE_MODEL)) typedef struct { + GalagoPerson *person; char *name; char *email; } ESelectNamesTableModelData; Index: addressbook/gui/widgets/eab-contact-display.c =================================================================== RCS file: /cvs/gnome/evolution/addressbook/gui/widgets/eab-contact-display.c,v retrieving revision 1.16 diff -u -r1.16 eab-contact-display.c --- addressbook/gui/widgets/eab-contact-display.c 22 Jul 2004 13:18:40 -0000 1.16 +++ addressbook/gui/widgets/eab-contact-display.c 14 Oct 2004 06:59:38 -0000 @@ -34,7 +34,9 @@ #include #include #include +#include #include +#include /*#define HANDLE_MAILTO_INTERNALLY 1*/ @@ -119,6 +121,67 @@ } } +static gboolean +on_object_requested (GtkHTML *html, GtkHTMLEmbedded *ew) +{ + GtkWidget *icon; + char *temp, *im_service = NULL, *c, *username = NULL; + GalagoService *service; + GalagoAccount *account; + + temp = g_strdup (ew->classid); + + if ((c = strchr (temp, ':')) != NULL) { + *c = '\0'; + + if (!strcmp (temp, "presence-icon")) + im_service = c + 1; + } + + if (im_service == NULL) { + g_free (temp); + return FALSE; + } + + if ((c = strchr (im_service, ':')) != NULL) { + *c = '\0'; + username = c + 1; + } + + galago_log(GALAGO_LOG_INFO, "Requesting presence icon for %s on %s\n", + username, im_service); + + service = galago_core_get_service(im_service, FALSE, TRUE); + + if (service == NULL) { + galago_log(GALAGO_LOG_INFO, "Bailing. service == NULL\n"); + g_free(temp); + return FALSE; + } + + account = galago_service_get_account(service, username, TRUE); + + if (account == NULL) { + galago_log(GALAGO_LOG_INFO, "Bailing. account == NULL\n"); + g_free(temp); + return FALSE; + } + + g_free (temp); + + icon = galago_gtk_presence_icon_new(); + galago_gtk_presence_icon_set_size(GALAGO_GTK_PRESENCE_ICON(icon), GTK_ICON_SIZE_MENU); + galago_gtk_presence_icon_set_account(GALAGO_GTK_PRESENCE_ICON(icon), account); + galago_gtk_presence_icon_set_generic(GALAGO_GTK_PRESENCE_ICON(icon), FALSE); + + galago_log(GALAGO_LOG_INFO, "Created presence icon\n"); + + gtk_container_add(GTK_CONTAINER(ew), icon); + gtk_widget_show(icon); + + return TRUE; +} + #if 0 static void render_address (GtkHTMLStream *html_stream, EContact *contact, const char *html_label, EContactField adr_field, EContactField label_field) @@ -223,13 +286,19 @@ } static void -accum_name_value (GString *gstr, const char *label, const char *str, const char *icon, unsigned int html_flags) +accum_name_value (GString *gstr, const char *label, const char *str, const char *icon, const char *im_service, unsigned int html_flags) { char *value = e_text_to_html (str, html_flags); g_string_append_printf (gstr, ""); - if (icon) + + if (im_service) { + g_string_append_printf (gstr, "", im_service, value); + } + else if (icon) { g_string_append_printf (gstr, "", icon); + } + g_string_append_printf (gstr, "%s: %s", label, value); g_free (value); @@ -237,14 +306,14 @@ static void -accum_attribute (GString *gstr, EContact *contact, const char *html_label, EContactField field, const char *icon, unsigned int html_flags) +accum_attribute (GString *gstr, EContact *contact, const char *html_label, EContactField field, const char *icon, const char *im_service, unsigned int html_flags) { const char *str; str = e_contact_get_const (contact, field); if (str && *str) { - accum_name_value (gstr, html_label, str, icon, html_flags); + accum_name_value (gstr, html_label, str, icon, im_service, html_flags); } } @@ -330,12 +399,12 @@ g_string_assign (accum, ""); - accum_attribute (accum, contact, _("AIM"), E_CONTACT_IM_AIM_HOME_1, AIM_ICON, 0); - accum_attribute (accum, contact, _("GroupWise"), E_CONTACT_IM_GROUPWISE_HOME_1, GROUPWISE_ICON, 0); - accum_attribute (accum, contact, _("ICQ"), E_CONTACT_IM_ICQ_HOME_1, ICQ_ICON, 0); - accum_attribute (accum, contact, _("Jabber"), E_CONTACT_IM_JABBER_HOME_1, JABBER_ICON, 0); - accum_attribute (accum, contact, _("MSN"), E_CONTACT_IM_MSN_HOME_1, MSN_ICON, 0); - accum_attribute (accum, contact, _("Yahoo"), E_CONTACT_IM_YAHOO_HOME_1, YAHOO_ICON, 0); + accum_attribute (accum, contact, _("AIM"), E_CONTACT_IM_AIM_HOME_1, AIM_ICON, GALAGO_SERVICE_ID_AIM, 0); + accum_attribute (accum, contact, _("GroupWise"), E_CONTACT_IM_GROUPWISE_HOME_1, GROUPWISE_ICON, GALAGO_SERVICE_ID_GROUPWISE, 0); + accum_attribute (accum, contact, _("ICQ"), E_CONTACT_IM_ICQ_HOME_1, ICQ_ICON, GALAGO_SERVICE_ID_ICQ, 0); + accum_attribute (accum, contact, _("Jabber"), E_CONTACT_IM_JABBER_HOME_1, JABBER_ICON, GALAGO_SERVICE_ID_JABBER, 0); + accum_attribute (accum, contact, _("MSN"), E_CONTACT_IM_MSN_HOME_1, MSN_ICON, GALAGO_SERVICE_ID_MSN, 0); + accum_attribute (accum, contact, _("Yahoo"), E_CONTACT_IM_YAHOO_HOME_1, YAHOO_ICON, GALAGO_SERVICE_ID_YAHOO, 0); if (accum->len > 0) gtk_html_stream_printf (html_stream, accum->str); @@ -344,11 +413,11 @@ g_string_assign (accum, ""); - accum_attribute (accum, contact, _("Organization"), E_CONTACT_ORG, NULL, 0); - accum_attribute (accum, contact, _("Position"), E_CONTACT_TITLE, NULL, 0); - accum_attribute (accum, contact, _("Video Conferencing"), E_CONTACT_VIDEO_URL, VIDEOCONF_ICON, E_TEXT_TO_HTML_CONVERT_URLS); - accum_attribute (accum, contact, _("Phone"), E_CONTACT_PHONE_BUSINESS, NULL, 0); - accum_attribute (accum, contact, _("Fax"), E_CONTACT_PHONE_BUSINESS_FAX, NULL, 0); + accum_attribute (accum, contact, _("Organization"), E_CONTACT_ORG, NULL, NULL, 0); + accum_attribute (accum, contact, _("Position"), E_CONTACT_TITLE, NULL, NULL, 0); + accum_attribute (accum, contact, _("Video Conferencing"), E_CONTACT_VIDEO_URL, VIDEOCONF_ICON, NULL, E_TEXT_TO_HTML_CONVERT_URLS); + accum_attribute (accum, contact, _("Phone"), E_CONTACT_PHONE_BUSINESS, NULL, NULL, 0); + accum_attribute (accum, contact, _("Fax"), E_CONTACT_PHONE_BUSINESS_FAX, NULL, NULL, 0); accum_address (accum, contact, _("Address"), E_CONTACT_ADDRESS_WORK, E_CONTACT_ADDRESS_LABEL_WORK); if (accum->len > 0) { @@ -359,11 +428,11 @@ g_string_assign (accum, ""); - accum_attribute (accum, contact, _("WWW"), E_CONTACT_HOMEPAGE_URL, NULL, E_TEXT_TO_HTML_CONVERT_URLS); - accum_attribute (accum, contact, _("Blog"), E_CONTACT_BLOG_URL, NULL, E_TEXT_TO_HTML_CONVERT_URLS); + accum_attribute (accum, contact, _("WWW"), E_CONTACT_HOMEPAGE_URL, NULL, NULL, E_TEXT_TO_HTML_CONVERT_URLS); + accum_attribute (accum, contact, _("Blog"), E_CONTACT_BLOG_URL, NULL, NULL, E_TEXT_TO_HTML_CONVERT_URLS); - accum_attribute (accum, contact, _("Phone"), E_CONTACT_PHONE_HOME, NULL, 0); - accum_attribute (accum, contact, _("Mobile Phone"), E_CONTACT_PHONE_MOBILE, NULL, 0); + accum_attribute (accum, contact, _("Phone"), E_CONTACT_PHONE_HOME, NULL, NULL, 0); + accum_attribute (accum, contact, _("Mobile Phone"), E_CONTACT_PHONE_MOBILE, NULL, NULL, 0); accum_address (accum, contact, _("Address"), E_CONTACT_ADDRESS_HOME, E_CONTACT_ADDRESS_LABEL_HOME); if (accum->len > 0) { @@ -623,11 +692,11 @@ g_signal_connect (display, "link_clicked", G_CALLBACK (on_link_clicked), display); -#if 0 g_signal_connect (display, "object_requested", G_CALLBACK (on_object_requested), - mail_display); - g_signal_connect (display, "button_press_event", + display); +#if 0 + g_signal_connect (display->priv->html, "button_press_event", G_CALLBACK (html_button_press_event), mail_display); g_signal_connect (display, "motion_notify_event", G_CALLBACK (html_motion_notify_event), mail_display); Index: e-util/Makefile.am =================================================================== RCS file: /cvs/gnome/evolution/e-util/Makefile.am,v retrieving revision 1.119 diff -u -r1.119 Makefile.am --- e-util/Makefile.am 20 Sep 2004 05:59:54 -0000 1.119 +++ e-util/Makefile.am 14 Oct 2004 06:59:46 -0000 @@ -33,6 +33,7 @@ e-event.h \ e-folder-map.h \ e-fsutils.h \ + e-galago.h \ e-gtk-utils.h \ e-gui-utils.h \ e-host-utils.h \ @@ -77,6 +78,7 @@ e-event.c \ e-folder-map.c \ e-fsutils.c \ + e-galago.c \ e-gtk-utils.c \ e-gui-utils.c \ e-host-utils.c \ Index: e-util/e-galago.c =================================================================== RCS file: e-util/e-galago.c diff -N e-util/e-galago.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ e-util/e-galago.c 14 Oct 2004 06:59:46 -0000 @@ -0,0 +1,139 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +/* + * e-galago.c + * + * Copyright (C) 2001 Ximian, Inc. + * + * Developed by Christian Hammond + */ + +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + */ + +#include "e-galago.h" + +static GalagoPerson * +check_accounts(EContact *contact, const char *service_id, + EContactField field) +{ + GalagoService *service; + GList *l; + + service = galago_core_get_service(service_id, FALSE, TRUE); + + for (l = e_contact_get_attributes(contact, field); + l != NULL; + l = l->next) { + + GalagoAccount *account; + EVCardAttribute *attr = (EVCardAttribute *)l->data; + char *username; + + username = e_vcard_attribute_get_value(attr); + + account = galago_service_get_account(service, username, TRUE); + + if (account != NULL) + return galago_account_get_person(account); + } + + return NULL; +} + +#define CHECK_ACCOUNTS(contact, service, field) \ + if ((person = check_accounts((contact), (service), (field))) != NULL) \ + return person; + +GalagoPerson * +e_galago_get_person_from_contact(EContact *contact) +{ + GalagoPerson *person; + + g_return_val_if_fail(contact != NULL, NULL); + g_return_val_if_fail(E_IS_CONTACT(contact), NULL); + + CHECK_ACCOUNTS(contact, "aim", E_CONTACT_IM_AIM); + CHECK_ACCOUNTS(contact, "groupwise", E_CONTACT_IM_GROUPWISE); + CHECK_ACCOUNTS(contact, "jabber", E_CONTACT_IM_JABBER); + CHECK_ACCOUNTS(contact, "yahoo", E_CONTACT_IM_YAHOO); + CHECK_ACCOUNTS(contact, "msn", E_CONTACT_IM_MSN); + CHECK_ACCOUNTS(contact, "icq", E_CONTACT_IM_ICQ); + + return NULL; +} + +GalagoPerson * +e_galago_get_person_from_email(const char *email) +{ + EBookQuery *query; + EBook *book; + GalagoPerson *person = NULL; + gboolean result; + GList *contacts, *l; +#if 0 + char *str; +#endif + + g_return_val_if_fail(email != NULL, NULL); + g_return_val_if_fail(*email != '\0', NULL); + + book = e_book_new_system_addressbook(NULL); + result = e_book_open(book, FALSE, NULL); + + if (!result) { + if (book != NULL) + g_object_unref(book); + + return NULL; + } + +#if 0 + str = g_strdup_printf("(contains \"email\" \"%s\")", email); + query = e_book_query_from_string(str); + g_free(str); +#endif + + query = e_book_query_field_test(E_CONTACT_EMAIL, E_BOOK_QUERY_CONTAINS, + email); + + printf("Getting result\n"); + result = e_book_get_contacts(book, query, &contacts, NULL); + printf("Retrieved result = %d\n", result); + + e_book_query_unref(query); + + if (result) { + for (l = contacts; l != NULL; l = l->next) { + EContact *contact = E_CONTACT(l->data); + + person = e_galago_get_person_from_contact(contact); + + g_object_unref(contact); + + if (person != NULL) + break; + + person = NULL; + } + + g_list_free(contacts); + } + + g_object_unref(book); + + return person; +} Index: e-util/e-galago.h =================================================================== RCS file: e-util/e-galago.h diff -N e-util/e-galago.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ e-util/e-galago.h 14 Oct 2004 06:59:46 -0000 @@ -0,0 +1,37 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +/* + * e-galago.h + * + * Copyright (C) 2004 Ximian, Inc. + * + * Developed by Christian Hammond + */ + +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + */ + +#ifndef __E_GALAGO_H__ +#define __E_GALAGO_H__ + +#include +#include + +GalagoPerson *e_galago_get_person_from_contact(EContact *contact); +GalagoPerson *e_galago_get_person_from_email(const char *email); + +#endif /* __E_GALAGO_H__ */ + Index: mail/em-filter-i18n.h =================================================================== RCS file: /cvs/gnome/evolution/mail/em-filter-i18n.h,v retrieving revision 1.1 diff -u -r1.1 em-filter-i18n.h --- mail/em-filter-i18n.h 17 Jun 2004 07:34:49 -0000 1.1 +++ mail/em-filter-i18n.h 14 Oct 2004 06:59:47 -0000 @@ -4,36 +4,19 @@ char *s = N_("Assign Score"); char *s = N_("Attachments"); char *s = N_("Beep"); -char *s = N_("contains"); char *s = N_("Copy to Folder"); char *s = N_("Date received"); char *s = N_("Date sent"); char *s = N_("Delete"); char *s = N_("Deleted"); -char *s = N_("does not contain"); -char *s = N_("does not end with"); -char *s = N_("does not exist"); -char *s = N_("does not return"); -char *s = N_("does not sound like"); -char *s = N_("does not start with"); char *s = N_("Do Not Exist"); char *s = N_("Draft"); -char *s = N_("ends with"); char *s = N_("Exist"); -char *s = N_("exists"); char *s = N_("Expression"); char *s = N_("Follow Up"); char *s = N_("Important"); -char *s = N_("is"); -char *s = N_("is after"); -char *s = N_("is before"); -char *s = N_("is Flagged"); -char *s = N_("is greater than"); -char *s = N_("is less than"); -char *s = N_("is not"); -char *s = N_("is not Flagged"); -char *s = N_("Junk"); char *s = N_("Junk Test"); +char *s = N_("Junk"); char *s = N_("Label"); char *s = N_("Mailing list"); char *s = N_("Message Body"); @@ -47,19 +30,36 @@ char *s = N_("Recipients"); char *s = N_("Regex Match"); char *s = N_("Replied to"); -char *s = N_("returns"); -char *s = N_("returns greater than"); -char *s = N_("returns less than"); char *s = N_("Run Program"); char *s = N_("Score"); char *s = N_("Sender"); char *s = N_("Set Status"); char *s = N_("Size (kB)"); -char *s = N_("sounds like"); char *s = N_("Source Account"); char *s = N_("Specific header"); -char *s = N_("starts with"); char *s = N_("Status"); char *s = N_("Stop Processing"); char *s = N_("Subject"); char *s = N_("Unset Status"); +char *s = N_("contains"); +char *s = N_("does not contain"); +char *s = N_("does not end with"); +char *s = N_("does not exist"); +char *s = N_("does not return"); +char *s = N_("does not sound like"); +char *s = N_("does not start with"); +char *s = N_("ends with"); +char *s = N_("exists"); +char *s = N_("is Flagged"); +char *s = N_("is after"); +char *s = N_("is before"); +char *s = N_("is greater than"); +char *s = N_("is less than"); +char *s = N_("is not Flagged"); +char *s = N_("is not"); +char *s = N_("is"); +char *s = N_("returns greater than"); +char *s = N_("returns less than"); +char *s = N_("returns"); +char *s = N_("sounds like"); +char *s = N_("starts with"); Index: mail/em-format-html.c =================================================================== RCS file: /cvs/gnome/evolution/mail/em-format-html.c,v retrieving revision 1.66 diff -u -r1.66 em-format-html.c --- mail/em-format-html.c 24 Sep 2004 04:09:10 -0000 1.66 +++ mail/em-format-html.c 14 Oct 2004 06:59:47 -0000 @@ -35,6 +35,7 @@ #include /* for e_utf8_strftime, what about e_time_format_time? */ #include "e-util/e-time-utils.h" #include "e-util/e-icon-factory.h" +#include "e-util/e-galago.h" #include #include @@ -61,6 +62,8 @@ #include +#include + #include "mail-component.h" #include "mail-config.h" #include "mail-mt.h" @@ -557,6 +560,7 @@ return FALSE; pobject = em_format_html_find_pobject(efh, eb->classid); + printf("classid = %s\n", eb->classid); if (pobject) { /* This stops recursion of the part */ e_dlist_remove((EDListNode *)pobject); @@ -1647,6 +1651,42 @@ g_free(value); } +static gboolean +efh_embed_avatar(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject *pobj) +{ + GalagoPerson *person; + const char *c, *puid; + gboolean res = FALSE; + + if ((c = strrchr(pobj->classid, '/')) == NULL) + return FALSE; + + puid = c + 1; + + g_mutex_lock(efh->priv->lock); + + person = galago_core_get_person(puid, FALSE, TRUE); + + if (person != NULL) { + GtkWidget *icon; + + icon = galago_gtk_presence_icon_new(); + galago_gtk_presence_icon_set_size(GALAGO_GTK_PRESENCE_ICON(icon), GTK_ICON_SIZE_DIALOG); + galago_gtk_presence_icon_set_person(GALAGO_GTK_PRESENCE_ICON(icon), person); + galago_gtk_presence_icon_set_generic(GALAGO_GTK_PRESENCE_ICON(icon), TRUE); + galago_gtk_presence_icon_set_use_avatar(GALAGO_GTK_PRESENCE_ICON(icon), TRUE); + + gtk_container_add(GTK_CONTAINER(eb), icon); + gtk_widget_show(icon); + + res = TRUE; + } + + g_mutex_unlock(efh->priv->lock); + + return res; +} + static void efh_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMedium *part) { @@ -1655,6 +1695,7 @@ const char *charset; CamelContentType *ct; struct _camel_header_raw *header; + struct _camel_header_raw *from_header = NULL; int rupert = FALSE; ct = camel_mime_part_get_content_type((CamelMimePart *)part); @@ -1673,6 +1714,10 @@ header = ((CamelMimePart *)part)->headers; while (header) { efh_format_header(emf, stream, part, header, EM_FORMAT_HTML_HEADER_NOCOLUMNS, charset); + if (from_header == NULL && !g_ascii_strcasecmp(header->name, "from")) { + from_header = header; + } + header = header->next; } } else { @@ -1697,6 +1742,11 @@ } else if (!g_ascii_strcasecmp (header->name, h->name)) { efh_format_header(emf, stream, part, header, h->flags, charset); } + + if (from_header == NULL && !g_ascii_strcasecmp(header->name, "from")) { + from_header = header; + } + header = header->next; } h = h->next; @@ -1704,8 +1754,32 @@ } if (!efh->simple_headers) { + GalagoPerson *person; camel_stream_printf(stream, ""); + + printf("from_header = %p\n", from_header); + + if (from_header != NULL) { + struct _camel_header_address *addrs; + + if ((addrs = camel_header_address_decode(from_header->value, emf->charset ? emf->charset : emf->default_charset))) { + + g_mutex_lock(efh->priv->lock); + person = e_galago_get_person_from_email(addrs->v.addr); + g_mutex_unlock(efh->priv->lock); + + if (person != NULL) { + char *classid = g_strdup_printf("galago:///avatar/%s", galago_person_get_id(person)); + camel_stream_printf(stream, "", classid); + + em_format_html_add_pobject(emf, sizeof(EMFormatHTMLPObject), classid, NULL, efh_embed_avatar); + + g_free(classid); + } + } + } + if (rupert && efh->show_rupert) { char *classid; CamelMimePart *iconpart; Index: shell/main.c =================================================================== RCS file: /cvs/gnome/evolution/shell/main.c,v retrieving revision 1.161 diff -u -r1.161 main.c --- shell/main.c 7 Oct 2004 08:21:02 -0000 1.161 +++ shell/main.c 14 Oct 2004 06:59:48 -0000 @@ -81,6 +81,7 @@ #include +#include #include "e-util/e-plugin.h" #ifdef ENABLE_MONO #include "e-util/e-plugin-mono.h" @@ -554,6 +555,10 @@ e_icon_factory_init (); e_passwords_init(); + dbus_g_thread_init(); + + galago_glib_init("evolution", FALSE, NULL); + icon_list = e_icon_factory_get_icon_list ("stock_mail"); if (icon_list) { gtk_window_set_default_icon_list (icon_list); Index: widgets/misc/Makefile.am =================================================================== RCS file: /cvs/gnome/evolution/widgets/misc/Makefile.am,v retrieving revision 1.56 diff -u -r1.56 Makefile.am --- widgets/misc/Makefile.am 13 Aug 2004 02:40:48 -0000 1.56 +++ widgets/misc/Makefile.am 14 Oct 2004 06:59:48 -0000 @@ -116,7 +116,8 @@ test_calendar_LDADD = \ ./libemiscwidgets.la \ $(top_builddir)/e-util/libeutil.la \ - $(GNOME_FULL_LIBS) + $(GNOME_FULL_LIBS) \ + $(E_UTIL_CFLAGS) # test-dateedit @@ -126,7 +127,8 @@ test_dateedit_LDADD = \ ./libemiscwidgets.la \ $(top_builddir)/e-util/libeutil.la \ - $(GNOME_FULL_LIBS) + $(GNOME_FULL_LIBS) \ + $(E_UTIL_CFLAGS) # test-dropdown-button @@ -136,7 +138,8 @@ test_dropdown_button_LDADD = \ ./libemiscwidgets.la \ $(top_builddir)/e-util/libeutil.la \ - $(GNOME_FULL_LIBS) + $(GNOME_FULL_LIBS) \ + $(E_UTIL_CFLAGS) # test-multi-config-dialog @@ -146,7 +149,8 @@ test_multi_config_dialog_LDADD = \ ./libemiscwidgets.la \ $(top_builddir)/e-util/libeutil.la \ - $(GNOME_FULL_LIBS) + $(GNOME_FULL_LIBS) \ + $(E_UTIL_CFLAGS) # test-title-bar @@ -156,7 +160,8 @@ test_title_bar_LDADD = \ ./libemiscwidgets.la \ $(top_builddir)/e-util/libeutil.la \ - $(GNOME_FULL_LIBS) + $(GNOME_FULL_LIBS) \ + $(E_UTIL_CFLAGS) # test-source-selector @@ -166,7 +171,8 @@ test_source_selector_LDADD = \ $(top_builddir)/e-util/libeutil.la \ ./libemiscwidgets.la \ - $(SOURCE_SEL_LIBS) + $(SOURCE_SEL_LIBS) \ + $(E_UTIL_CFLAGS) # test-source-option-menu @@ -177,7 +183,8 @@ test_source_option_menu_LDADD = \ $(top_builddir)/e-util/libeutil.la \ ./libemiscwidgets.la \ - $(SOURCE_SEL_LIBS) + $(SOURCE_SEL_LIBS) \ + $(E_UTIL_CFLAGS) test_error_SOURCES = \ test-error.c @@ -185,7 +192,8 @@ test_error_LDADD = \ $(top_builddir)/e-util/libeutil.la \ ./libemiscwidgets.la \ - $(GNOME_FULL_LIBS) + $(GNOME_FULL_LIBS) \ + $(E_UTIL_CFLAGS) BUILT_SOURCES = $(MARSHAL_GENERATED) $(error_i18n)