diff options
author | Chris Toshok <toshok@ximian.com> | 2001-07-25 05:17:26 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2001-07-25 05:17:26 +0800 |
commit | ad7e9b2471129eca0ce80b35c19b81b8f0a29e58 (patch) | |
tree | 41792266835057472037e1cb8a2f8da2843ce1c8 /addressbook | |
parent | aa25742b3831318c1de39655f3d6e2748262b2db (diff) | |
download | gsoc2013-evolution-ad7e9b2471129eca0ce80b35c19b81b8f0a29e58.tar gsoc2013-evolution-ad7e9b2471129eca0ce80b35c19b81b8f0a29e58.tar.gz gsoc2013-evolution-ad7e9b2471129eca0ce80b35c19b81b8f0a29e58.tar.bz2 gsoc2013-evolution-ad7e9b2471129eca0ce80b35c19b81b8f0a29e58.tar.lz gsoc2013-evolution-ad7e9b2471129eca0ce80b35c19b81b8f0a29e58.tar.xz gsoc2013-evolution-ad7e9b2471129eca0ce80b35c19b81b8f0a29e58.tar.zst gsoc2013-evolution-ad7e9b2471129eca0ce80b35c19b81b8f0a29e58.zip |
need the EDestination magic here too for when we modify an already shown
2001-07-24 Chris Toshok <toshok@ximian.com>
* gui/widgets/e-minicard.c (remodel): need the EDestination magic
here too for when we modify an already shown card.
* gui/contact-list-editor/e-contact-list-model.c: make
parent_class static, just to be anal.
* gui/contact-list-editor/e-contact-list-editor.c
(remove_entry_cb): removing entries changes the list, so flag it.
(table_drag_data_received_cb): restrict cards we add to lists to
be non-list cards.
(extract_info): clear out the email list in the card before we
repopulate it from the contact list model.
(fill_in_info): set the checkbox to active/inactive based on
thecard.
svn path=/trunk/; revision=11356
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/ChangeLog | 17 | ||||
-rw-r--r-- | addressbook/gui/contact-list-editor/e-contact-list-editor.c | 27 | ||||
-rw-r--r-- | addressbook/gui/contact-list-editor/e-contact-list-model.c | 2 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard.c | 11 |
4 files changed, 52 insertions, 5 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 4ac34baebe..fa20d8800a 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,5 +1,22 @@ 2001-07-24 Chris Toshok <toshok@ximian.com> + * gui/widgets/e-minicard.c (remodel): need the EDestination magic + here too for when we modify an already shown card. + + * gui/contact-list-editor/e-contact-list-model.c: make + parent_class static, just to be anal. + + * gui/contact-list-editor/e-contact-list-editor.c + (remove_entry_cb): removing entries changes the list, so flag it. + (table_drag_data_received_cb): restrict cards we add to lists to + be non-list cards. + (extract_info): clear out the email list in the card before we + repopulate it from the contact list model. + (fill_in_info): set the checkbox to active/inactive based on + thecard. + +2001-07-24 Chris Toshok <toshok@ximian.com> + * gui/contact-editor/e-contact-editor.c (wants_html_changed): call widget_changed. (phone_entry_changed): same. 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 bc116c12c5..c6f8cab132 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c @@ -599,6 +599,10 @@ remove_entry_cb (GtkWidget *w, EContactListEditor *editor) { e_table_selected_row_foreach (e_table_scrolled_get_table(E_TABLE_SCROLLED(editor->table)), (EForeachFunc)remove_row, editor); + if (!editor->changed) { + editor->changed = TRUE; + command_state_changed (editor); + } } static void @@ -708,12 +712,15 @@ table_drag_data_received_cb (ETable *table, int row, int col, for (c = card_list; c; c = c->next) { ECard *ecard = c->data; - ECardSimple *simple = e_card_simple_new (ecard); - e_contact_list_model_add_card (E_CONTACT_LIST_MODEL (editor->model), - simple); + if (!e_card_evolution_list (ecard)) { + ECardSimple *simple = e_card_simple_new (ecard); + + e_contact_list_model_add_card (E_CONTACT_LIST_MODEL (editor->model), + simple); - gtk_object_unref (GTK_OBJECT (simple)); + gtk_object_unref (GTK_OBJECT (simple)); + } } g_list_foreach (card_list, (GFunc)gtk_object_unref, NULL); g_list_free (card_list); @@ -746,6 +753,7 @@ extract_info(EContactListEditor *editor) if (card) { int i; EList *email_list; + EIterator *email_iter; char *string = e_utf8_gtk_editable_get_chars(GTK_EDITABLE (editor->list_name_entry), 0, -1); if (string && *string) @@ -767,6 +775,15 @@ extract_info(EContactListEditor *editor) "email", &email_list, NULL); + /* clear the email list */ + email_iter = e_list_get_iterator (email_list); + e_iterator_last (email_iter); + while (e_iterator_is_valid (E_ITERATOR (email_iter))) { + e_iterator_delete (E_ITERATOR (email_iter)); + } + gtk_object_unref (GTK_OBJECT (email_iter)); + + /* then refill it from the contact list model */ for (i = 0; i < e_table_model_row_count (editor->model); i ++) { const EDestination *dest = e_contact_list_model_get_destination (E_CONTACT_LIST_MODEL (editor->model), i); gchar *dest_xml = e_destination_export (dest); @@ -803,6 +820,8 @@ fill_in_info(EContactListEditor *editor) g_free (u); } + 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)); email_iter = e_list_get_iterator (email_list); diff --git a/addressbook/gui/contact-list-editor/e-contact-list-model.c b/addressbook/gui/contact-list-editor/e-contact-list-model.c index eb6f59741b..b2b929eaa3 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-model.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-model.c @@ -4,7 +4,7 @@ #include "e-contact-list-model.h" #define PARENT_TYPE e_table_model_get_type() -ETableModelClass *parent_class; +static ETableModelClass *parent_class; #define COLS 1 diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index 123392df95..6835017a5b 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -774,6 +774,17 @@ remodel( EMinicard *e_minicard ) string = e_card_simple_get(e_minicard->simple, field); if (string && *string) { + /* Magically convert embedded XML into an address. */ + if (!strncmp (string, "<?xml", 4)) { + EDestination *dest = e_destination_import (string); + if (dest != NULL) { + gchar *new_string = g_strdup (e_destination_get_address (dest)); + g_free (string); + string = new_string; + gtk_object_unref (GTK_OBJECT (dest)); + } + } + e_minicard->fields = g_list_append(e_minicard->fields, minicard_field); gtk_object_set(GTK_OBJECT(minicard_field->label), "field", string, |