diff frontends/sortilege/sortilege @ 52:6455fb62ff83

Connection/disconnection signals - wix, sortilege: management of this new signals /!\ sortilege is bugged, the contact list window is not updated correctly
author Goffi <goffi@goffi.org>
date Thu, 07 Jan 2010 01:55:30 +1100
parents 8c67ea98ab91
children a5b5fb5fc9fd
line wrap: on
line diff
--- a/frontends/sortilege/sortilege	Thu Jan 07 00:17:27 2010 +1100
+++ b/frontends/sortilege/sortilege	Thu Jan 07 01:55:30 2010 +1100
@@ -45,6 +45,7 @@
 from quick_frontend.quick_app import QuickApp
 from quick_frontend.quick_contact_management import QuickContactManagement
 
+
 ### logging configuration FIXME: put this elsewhere ###
 logging.basicConfig(level=logging.CRITICAL,  #TODO: configure it top put messages in a log file
                     format='%(message)s')
@@ -78,7 +79,6 @@
         self.sizer.update()
         return chat 
         
-
 class ContactList(Window, QuickContactList):
     
     def __init__(self, host, CM):
@@ -101,6 +101,12 @@
     def registerEnterCB(self, CB):
         self.__enterCB=CB
 
+    def clear_contacts(self):
+        """clear all the contact list"""
+        del self.jid_list[:]
+        self.__index = 0
+        self.update()  #FIXME: window is not updated correctly (contacts are still here until C-L)
+
     def replace(self, jid):
         """add a contact to the list"""
         name = self.CM.getAttr(jid,'name')
@@ -256,7 +262,7 @@
     def onContactChoosed(self, jid_txt):
         """Called when a contact is selected in contact list."""
         jid=JID(jid_txt)
-        debug ("contact choose: %s", jid)
+        debug ("contact choosed: %s", jid)
         self.showChat(jid.short)
         self.statusBar.remove_item(jid.short)
         if len(self.statusBar)==0: