diff options
Diffstat (limited to 'addressbook/gui/contact-list-editor/e-contact-list-editor.c')
-rw-r--r-- | addressbook/gui/contact-list-editor/e-contact-list-editor.c | 37 |
1 files changed, 37 insertions, 0 deletions
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 c88af3005e..abb08d30f8 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c @@ -97,6 +97,8 @@ enum { ARG_EDITABLE }; +static GSList *all_contact_list_editors = NULL; + GtkType e_contact_list_editor_get_type (void) { @@ -538,6 +540,14 @@ create_ui (EContactListEditor *ce) e_pixmaps_update (ce->uic, pixmaps); } +static void +contact_list_editor_destroy_notify (void *data) +{ + EContactListEditor *ce = E_CONTACT_LIST_EDITOR (data); + + all_contact_list_editors = g_slist_remove (all_contact_list_editors, ce); +} + EContactListEditor * e_contact_list_editor_new (EBook *book, ECard *list_card, @@ -548,6 +558,9 @@ e_contact_list_editor_new (EBook *book, ce = E_CONTACT_LIST_EDITOR (gtk_type_new (E_CONTACT_LIST_EDITOR_TYPE)); + all_contact_list_editors = g_slist_prepend (all_contact_list_editors, ce); + gtk_object_weakref (GTK_OBJECT (ce), contact_list_editor_destroy_notify, ce); + gtk_object_set (GTK_OBJECT (ce), "book", book, "card", list_card, @@ -978,3 +991,27 @@ fill_in_info(EContactListEditor *editor) } } } + + +gboolean +e_contact_list_editor_request_close_all (void) +{ + GSList *p; + GSList *pnext; + gboolean retval; + + retval = TRUE; + for (p = all_contact_list_editors; p != NULL; p = pnext) { + pnext = p->next; + + e_contact_list_editor_raise (E_CONTACT_LIST_EDITOR (p->data)); + if (! prompt_to_save_changes (E_CONTACT_LIST_EDITOR (p->data))) { + retval = FALSE; + break; + } + + close_dialog (E_CONTACT_LIST_EDITOR (p->data)); + } + + return retval; +} |