From 07b1222e5e930f3152407329c10c791e9ab3062e Mon Sep 17 00:00:00 2001 From: Luca Dariz Date: Mon, 3 Aug 2009 15:03:04 +0200 Subject: [PATCH] [core] Added confirmation window when deleting a contact, how could i forget?? --- amsn2/core/contactlist_manager.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/amsn2/core/contactlist_manager.py b/amsn2/core/contactlist_manager.py index 2806d4a2..6bf9f9b7 100644 --- a/amsn2/core/contactlist_manager.py +++ b/amsn2/core/contactlist_manager.py @@ -85,8 +85,13 @@ def onContactAdded(self, contact): self._core._gui.gui.aMSNNotificationWindow("Contact %s added!" % contact.account) def removeContact(self, uid): - self._papyon_addressbook.delete_contact(self._papyon_addressbook.contacts. + def cb_ok(): + self._papyon_addressbook.delete_contact(self._papyon_addressbook.contacts. search_by('id', uid)[0]) + # call the UImanager for all the dialogs + self._core._gui.gui.aMSNDialogWindow('Are you sure you want to remove the contact %s?' + % self._papyon_addressbook.contacts.search_by('id', uid)[0].account, + (('OK', cb_ok), ('Cancel', lambda : ''))) def onContactRemoved(self, contact): self._removeContactFromGroups(contact.id)