Changeset 711
- Timestamp:
- 07/07/08 16:29:16 (5 months ago)
- Files:
-
- oss/jlib/jlib/core/contact.py (modified) (5 diffs)
- oss/jlib/jlib/gui/contact.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
oss/jlib/jlib/core/contact.py
r710 r711 24 24 def __init__(self, parent=None): 25 25 QAxonObject.__init__(self, parent) 26 QtCore.QObject.connect(self, QtCore.SIGNAL("removeContact(PyQt_PyObject)"), 27 self.removeContact) 26 28 27 29 def setComponent(self, component): … … 29 31 self.emit(QtCore.SIGNAL("setupOneMapping(PyQt_PyObject)"), 'inbox') 30 32 self.emit(QtCore.SIGNAL("setupOneMapping(PyQt_PyObject)"), 'pushed') 33 self.emit(QtCore.SIGNAL("setupOneMapping(PyQt_PyObject)"), 'remove') 31 34 32 35 def getLinkages(self): … … 39 42 return dict(rosterdisp=RosterDispatcher(), rosterhandler=self.component), linkages 40 43 44 def removeContact(self, contact_jid): 45 self._deliver(contact_jid, 'remove') 46 41 47 class jlibContactComponent(component): 42 48 Inboxes = {"inbox" : "headstock.api.contact.Roster instance", 43 49 "control" : "stops the component", 44 50 "pushed" : "roster stanzas pushed by the server", 51 "remove" : "", 45 52 "jid" : "headstock.api.jid.JID instance received from the server", 46 53 "ask-activity" : "request activity status to the server for each roster contact"} … … 92 99 self.send(Roster(from_jid=self.from_jid, to_jid=nodeid, 93 100 type=u'result', stanza_id=generate_unique()), 'result') 94 101 102 if self.dataReady('remove'): 103 contact_jid = self.recv('remove') 104 contact_jid = str(contact_jid) 105 r = Roster(from_jid=self.from_jid, to_jid=contact_jid, 106 type=u'set', stanza_id=generate_unique()) 107 i = Item(contact_jid) 108 i.subscription = u'remove' 109 r.items[contact_jid] = i 110 self.send(r, 'result') 111 95 112 if self.dataReady("inbox"): 96 113 roster = self.recv("inbox") … … 126 143 for nodeid in roster.items: 127 144 contact = roster.items[nodeid] 145 print contact.groups 128 146 self.addContact(contact) 129 147 oss/jlib/jlib/gui/contact.py
r710 r711 44 44 model.setRoster(roster) 45 45 46 def removeContact(self, contact): 47 model = self.contacts.model() 48 contact = model.getContact(model.currentIndex()) 49 self.contact.emit(QtCore.SIGNAL("removeContact(PyQt_PyObject)"), contact.jid) 50 46 51 def removedContact(self, contact): 47 52 model = self.contacts.model() … … 76 81 self.presence.emit(QtCore.SIGNAL("rejectSubscription(PyQt_PyObject)"), contact.jid) 77 82 self.presence.emit(QtCore.SIGNAL("requestUnsubscription(PyQt_PyObject)"), contact.jid) 83 self.contact.emit(QtCore.SIGNAL("removeContact(PyQt_PyObject)"), contact.jid) 78 84 79 85 def contextMenuEvent(self, event):
