aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/widgets
diff options
context:
space:
mode:
authorSushma Rai <rsushma@src.gnome.org>2006-08-07 16:24:35 +0800
committerSushma Rai <rsushma@src.gnome.org>2006-08-07 16:24:35 +0800
commitfa8b494f312cbcfa6306d5a6628757befc348346 (patch)
treef67a4e529da94c24559c3b0574f8e050f510b15d /addressbook/gui/widgets
parent3bb8860c1ef3b758a1f1516c3eb34221ebf27105 (diff)
downloadgsoc2013-evolution-fa8b494f312cbcfa6306d5a6628757befc348346.tar
gsoc2013-evolution-fa8b494f312cbcfa6306d5a6628757befc348346.tar.gz
gsoc2013-evolution-fa8b494f312cbcfa6306d5a6628757befc348346.tar.bz2
gsoc2013-evolution-fa8b494f312cbcfa6306d5a6628757befc348346.tar.lz
gsoc2013-evolution-fa8b494f312cbcfa6306d5a6628757befc348346.tar.xz
gsoc2013-evolution-fa8b494f312cbcfa6306d5a6628757befc348346.tar.zst
gsoc2013-evolution-fa8b494f312cbcfa6306d5a6628757befc348346.zip
Added a callback to handle contact deletion error and corresponding error
strings. Fixes #260403. svn path=/trunk/; revision=32483
Diffstat (limited to 'addressbook/gui/widgets')
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index 66df83b9eb..5023d2a3c5 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -1891,6 +1891,25 @@ eab_view_print_preview(EABView *view)
#endif
}
+/* callback function to handle removal of contacts for
+ * which a user doesnt have write permission
+ */
+static void delete_contacts_cb (EBook *book, EBookStatus status, gpointer closure)
+{
+ switch(status) {
+ case E_BOOK_ERROR_OK :
+ case E_BOOK_ERROR_CANCELLED :
+ break;
+ case E_BOOK_ERROR_PERMISSION_DENIED :
+ e_error_run (NULL, "addressbook:contact-delete-error-perm", NULL);
+ break;
+ default :
+ /* Unknown error */
+ e_error_run (NULL, "addressbook:generic-error", _("Failed to delete contact"), _("Other error"), NULL);
+ break;
+ }
+}
+
void
eab_view_delete_selection(EABView *view, gboolean is_delete)
{
@@ -1929,10 +1948,9 @@ eab_view_delete_selection(EABView *view, gboolean is_delete)
}
/* Remove the cards all at once. */
- /* XXX no callback specified... ugh */
e_book_async_remove_contacts (view->book,
ids,
- NULL,
+ delete_contacts_cb,
NULL);
g_list_free (ids);
@@ -1941,10 +1959,9 @@ eab_view_delete_selection(EABView *view, gboolean is_delete)
for (l=list;l;l=g_list_next(l)) {
contact = l->data;
/* Remove the card. */
- /* XXX no callback specified... ugh */
e_book_async_remove_contact (view->book,
contact,
- NULL,
+ delete_contacts_cb,
NULL);
}
}