aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--addressbook/ChangeLog11
-rw-r--r--addressbook/addressbook.error.xml5
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c25
3 files changed, 37 insertions, 4 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 83a5b49cd8..e1e101633e 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,14 @@
+2006-08-07 Sushma Rai <rsushma@novell.com>
+
+ * gui/widgets/e-addressbook-view.c (eab_view_delete_selection): Added a
+ callback function to handle the contact deletion error.
+ (delete_contacts_cb): Added new, a callback function.
+
+ * addressbook.error.xml: Added a error code contact-delete-error-perm
+ and corresponding error string. Fixes #260403
+
+ Original patch was submitted by "Vandana Shenoy .B"
+
2006-07-25 Johnny Jacob <jjohnny@novell.com>
* gui/widgets/e-addressbook-view.c: (search_activated),
diff --git a/addressbook/addressbook.error.xml b/addressbook/addressbook.error.xml
index e5052416af..446e51c05b 100644
--- a/addressbook/addressbook.error.xml
+++ b/addressbook/addressbook.error.xml
@@ -108,4 +108,9 @@
<_secondary>Currently you can access only GroupWise System Address Book from Evolution. Please use some other GroupWise mail client once, to get your GroupWise Frequent Contacts and Groupwise Personal Contacts folders.</_secondary>
</error>
+ <error id="contact-delete-error-perm" type="warning">
+ <_primary>Failed to delete contact</_primary>
+ <_secondary>Permission Denied.</_secondary>
+ </error>
+
</error-list>
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);
}
}