From ad7e9b2471129eca0ce80b35c19b81b8f0a29e58 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Tue, 24 Jul 2001 21:17:26 +0000 Subject: need the EDestination magic here too for when we modify an already shown 2001-07-24 Chris Toshok * 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 --- .../contact-list-editor/e-contact-list-editor.c | 27 ++++++++++++++++++---- .../gui/contact-list-editor/e-contact-list-model.c | 2 +- 2 files changed, 24 insertions(+), 5 deletions(-) (limited to 'addressbook/gui/contact-list-editor') 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 -- cgit