From 4c06d16120fb6686c08c74192d62efa2b5d89a24 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Sat, 27 Oct 2001 21:13:23 +0000 Subject: Set book_uri when cardification occurs. 2001-10-27 Christopher James Lahey * backend/ebook/e-destination.c (name_and_email_simple_query_cb, nickname_simple_query_cb): Set book_uri when cardification occurs. svn path=/trunk/; revision=14230 --- addressbook/ChangeLog | 8 ++++++- addressbook/backend/ebook/e-destination.c | 37 +++++++++++++++++++++---------- 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index d756e3deea..cc5f58faa6 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,8 +1,14 @@ +2001-10-27 Christopher James Lahey + + * backend/ebook/e-destination.c (name_and_email_simple_query_cb, + nickname_simple_query_cb): Set book_uri when cardification occurs. + 2001-10-27 Christopher James Lahey * gui/component/select-names/e-select-names.c (e_select_names_add_section): Turned off use_ellipsis (it breaks - emulate_label_resize) and on emulate_label_resize. + emulate_label_resize) and on emulate_label_resize. Fixes Ximian + bug #13693. 2001-10-27 Jon Trowbridge diff --git a/addressbook/backend/ebook/e-destination.c b/addressbook/backend/ebook/e-destination.c index 5cd6d24379..20365491a3 100644 --- a/addressbook/backend/ebook/e-destination.c +++ b/addressbook/backend/ebook/e-destination.c @@ -67,20 +67,23 @@ struct _EDestinationPrivate { gchar *addr; gchar *textrep; - gboolean html_mail_override; - gboolean wants_html_mail; - GList *list_dests; - gboolean show_addresses; - gboolean has_been_cardified; - gboolean allow_cardify; - gboolean cannot_cardify; + guint html_mail_override : 1; + guint wants_html_mail : 1; + + guint show_addresses : 1; + + guint has_been_cardified : 1; + guint allow_cardify : 1; + guint cannot_cardify : 1; guint pending_cardification; + + guint pending_change : 1; + EBook *cardify_book; gint freeze_count; - gboolean pending_change; }; static void e_destination_clear_card (EDestination *); @@ -588,11 +591,8 @@ e_destination_use_card (EDestination *dest, EDestinationCardCallback cb, gpointe g_return_if_fail (dest && E_IS_DESTINATION (dest)); if (dest->priv->card != NULL) { - - if (cb) { + if (cb) cb (dest, dest->priv->card, closure); - } - } else if (dest->priv->book_uri != NULL && dest->priv->card_uid != NULL) { UseCard *uc = g_new (UseCard, 1); @@ -602,6 +602,9 @@ e_destination_use_card (EDestination *dest, EDestinationCardCallback cb, gpointe uc->cb = cb; uc->closure = closure; e_card_load_uri (dest->priv->book_uri, dest->priv->card_uid, use_card_cb, uc); + } else { + if (cb) + cb (dest, NULL, closure); } } @@ -941,8 +944,13 @@ name_and_email_simple_query_cb (EBook *book, EBookSimpleQueryStatus status, cons } if (email_num >= 0) { + const char *book_uri; + + book_uri = e_book_get_uri (book); + dest->priv->has_been_cardified = TRUE; e_destination_set_card (dest, card, email_num); + e_destination_set_book_uri (dest, book_uri); gtk_signal_emit (GTK_OBJECT (dest), e_destination_signals[CARDIFIED]); } } @@ -963,8 +971,13 @@ nickname_simple_query_cb (EBook *book, EBookSimpleQueryStatus status, const GLis if (status == E_BOOK_SIMPLE_QUERY_STATUS_SUCCESS) { if (g_list_length ((GList *) cards) == 1) { + const char *book_uri; + + book_uri = e_book_get_uri (book); + dest->priv->has_been_cardified = TRUE; e_destination_set_card (dest, E_CARD (cards->data), 0); /* Uses primary e-mail by default. */ + e_destination_set_book_uri (dest, book_uri); gtk_signal_emit (GTK_OBJECT (dest), e_destination_signals[CARDIFIED]); gtk_object_unref (GTK_OBJECT (dest)); /* drop the reference held by the query */ -- cgit v1.2.3