diff options
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/ChangeLog | 16 | ||||
-rw-r--r-- | addressbook/backend/ebook/e-destination.c | 24 | ||||
-rw-r--r-- | addressbook/backend/ebook/e-destination.h | 3 | ||||
-rw-r--r-- | addressbook/gui/contact-list-editor/e-contact-list-editor.c | 4 |
4 files changed, 43 insertions, 4 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index eaa2782ce0..3b05766685 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,19 @@ +2001-08-22 Jon Trowbridge <trow@ximian.com> + + * gui/contact-list-editor/e-contact-list-editor.c (extract_info): + In the GUI, the toggle is labelled "hide addresses", not "show + addresses" -- so we have to reverse the boolean value we read in. + (fill_in_info): Same bug as before: since the GUI reads "hide", we + have to initialize the toggle to '!show_addresses', not + 'show_addresses'. + + * backend/ebook/e-destination.c + (e_destination_list_show_addresses): Added. + (e_destination_xml_encode): Encode the value of + e_destination_list_show_addresses into the XML. + (e_destination_xml_decode): Read and store the "show_addresses" + flag. + 2001-08-22 jacob berkman <jacob@ximian.com> * gui/component/e-address-popup.c (emit_event): emit an event from diff --git a/addressbook/backend/ebook/e-destination.c b/addressbook/backend/ebook/e-destination.c index 25e1caa6ec..076eccf835 100644 --- a/addressbook/backend/ebook/e-destination.c +++ b/addressbook/backend/ebook/e-destination.c @@ -67,6 +67,7 @@ struct _EDestinationPrivate { gboolean wants_html_mail; GList *list_dests; + gboolean show_addresses; gboolean has_been_cardified; gboolean allow_cardify; @@ -750,6 +751,17 @@ e_destination_is_evolution_list (const EDestination *dest) } gboolean +e_destination_list_show_addresses (const EDestination *dest) +{ + g_return_val_if_fail (E_IS_DESTINATION (dest), FALSE); + + if (dest->priv->card != NULL) + return e_card_evolution_list_show_addresses (dest->priv->card); + + return dest->priv->show_addresses; +} + +gboolean e_destination_get_html_mail_pref (const EDestination *dest) { g_return_val_if_fail (dest && E_IS_DESTINATION (dest), FALSE); @@ -1031,6 +1043,8 @@ e_destination_xml_encode (const EDestination *dest) } xmlNewProp (dest_node, "is_list", "yes"); + xmlNewProp (dest_node, "show_addresses", + e_destination_list_show_addresses (dest) ? "yes" : "no"); } str = e_destination_get_book_uri (dest); @@ -1057,7 +1071,7 @@ e_destination_xml_decode (EDestination *dest, xmlNodePtr node) gchar *name = NULL, *email = NULL, *book_uri = NULL, *card_uid = NULL; gint email_num = -1; gboolean html_mail = FALSE; - gboolean is_list = FALSE; + gboolean is_list = FALSE, show_addr = FALSE; gchar *tmp; GList *list_dests = NULL; @@ -1079,6 +1093,12 @@ e_destination_xml_decode (EDestination *dest, xmlNodePtr node) xmlFree (tmp); } + tmp = xmlGetProp (node, "show_addresses"); + if (tmp) { + show_addr = !strcmp (tmp, "yes"); + xmlFree (tmp); + } + node = node->xmlChildrenNode; while (node) { if (!strcmp (node->name, "name")) { @@ -1154,6 +1174,8 @@ e_destination_xml_decode (EDestination *dest, xmlNodePtr node) if (list_dests) dest->priv->list_dests = list_dests; + dest->priv->show_addresses = show_addr; + e_destination_thaw (dest); return TRUE; diff --git a/addressbook/backend/ebook/e-destination.h b/addressbook/backend/ebook/e-destination.h index dc43d9703c..c0ab60d33f 100644 --- a/addressbook/backend/ebook/e-destination.h +++ b/addressbook/backend/ebook/e-destination.h @@ -95,7 +95,8 @@ const gchar *e_destination_get_address (const EDestination *); /* "Jan void e_destination_set_raw (EDestination *, const gchar *free_form_string); const gchar *e_destination_get_textrep (const EDestination *); /* "Jane Smith" or "jane@assbarn.com" */ -gboolean e_destination_is_evolution_list (const EDestination *); +gboolean e_destination_is_evolution_list (const EDestination *); +gboolean e_destination_list_show_addresses (const EDestination *); /* If true, they want HTML mail. */ gboolean e_destination_get_html_mail_pref (const EDestination *); diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c index 3647e01184..49de763015 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c @@ -794,7 +794,7 @@ extract_info(EContactListEditor *editor) gtk_object_set (GTK_OBJECT(card), "list", GINT_TO_POINTER (TRUE), "list_show_addresses", - GINT_TO_POINTER (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(editor->visible_addrs_checkbutton))), + GINT_TO_POINTER (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(editor->visible_addrs_checkbutton))), NULL); gtk_object_get (GTK_OBJECT(card), @@ -846,7 +846,7 @@ fill_in_info(EContactListEditor *editor) g_free (u); } - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(editor->visible_addrs_checkbutton), show_addresses); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(editor->visible_addrs_checkbutton), !show_addresses); e_contact_list_model_remove_all (E_CONTACT_LIST_MODEL (editor->model)); |