GNOME Bugzilla – Bug 657974
support undoing delete
Last modified: 2011-09-02 16:55:15 UTC
I want to add undo of delete operations in gnome-contacts, as its a pretty destructive operation. I can do so by making a copy of the folks data, but then i I restore the contact I will not get back any data on the backend that is not accessible by folks. So, ideally this kind of operation should get some help on the backend side. Do you think this is possible?
(In reply to comment #0) > I want to add undo of delete operations in gnome-contacts, as its a pretty > destructive operation. I can do so by making a copy of the folks data, but then > i I restore the contact I will not get back any data on the backend that is not > accessible by folks. So, ideally this kind of operation should get some help on > the backend side. > > Do you think this is possible? Original answer (see the bottom of the comment for a different answer which involves folks people doing less work): Not for 3.2 (if I may be so bold). It definitely can't be supported cleanly by some backends, such as Telepathy, since if you delete an IM contact, the person on the other end will have to agree to re-adding you for the deletion to be undone. It could be supported cleanly on trivial backends like key-file. I guess it could be supported cleanly on backends like eds and Tracker if, before deleting the persona, folks grabbed all the information it could (even stuff it couldn't understand) about that persona. For example, for eds it could export a full vCard of the contact into memory. Folks could then return some kind of handle for this data to gnome-contacts as part of the undoable-deletion operation. If the user decides they want to undo the deletion, gnome-contacts could pass the handle back to folks, which could re-add the personas using the data it saved earlier. I can't think of a clean way around the Telepathy problem, though. I guess the best we could do is to only add an UndoableDeletion interface to PersonaStores which support it (i.e. _not_ Tpf.PersonaStore). gnome-contacts could then display a really, really big question dialogue before deleting individuals containing personas from stores which don't implement this interface, giving the user the option to: • Delete all personas (without the option to undo) • Delete all personas except the ones which can't be un-deleted (leaving the option of undoing the deletion for the other personas) • Run away This all feels icky and unstable. Different answer: How about solving the problem entirely in gnome-contacts, by only actually deleting personas 5 minutes (or so) after the user presses “delete”? I'd guess that most times people click “undo” are almost immediately after pressing “delete” by accident (in this scenario, anyway; the undo stack in GIMP is a different use case). It would be reasonable for changes to only propagate after 5 minutes (people are used to this kind of weak consistency from web services already), and I'm willing to bet it would cover 99% of the cases where people would want to undo deleting a contact. For example, this is what GMail does with its undo functionality for sending e-mails (http://gmailblog.blogspot.com/2009/03/new-in-labs-undo-send.html).
In fact, the UI mockup had undo as only availible directly after deleting the contact, so we could just hide it temporarily in contacts itself and then do the delete later. It would mean the contact would be visible in all other apps using folks though, but that is not really a problem i guess.
Closing as WONTFIX then. :-)