Changeset 740
- Timestamp:
- 07/24/08 15:39:48 (4 months ago)
- Files:
-
- oss/jlib/examples/basic/client.py (modified) (5 diffs)
- oss/jlib/jlib/core/connection.py (modified) (1 diff)
- oss/jlib/jlib/core/pubsub.py (modified) (6 diffs)
- oss/jlib/jlib/gui/pubsub/node.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
oss/jlib/examples/basic/client.py
r738 r740 16 16 jlibNodeItem, jlibNodeItemModel 17 17 from jlib.gui.atom.entry import jlibAtomEntryForm 18 from jlib.core.logger import jlibLogger, jlibLoggerComponent18 #from jlib.core.logger import jlibLogger, jlibLoggerComponent 19 19 20 20 from clientui import Ui_MainWindow … … 36 36 self.connection = None 37 37 38 self.logger = jlibLogger()39 self.logger.setComponent(jlibLoggerComponent())38 #self.logger = jlibLogger() 39 #self.logger.setComponent(jlibLoggerComponent()) 40 40 QtCore.QObject.connect(self.actionShowLog, QtCore.SIGNAL("toggled(bool)"), 41 41 self.changeLogAreaView) 42 QtCore.QObject.connect(self.logger, QtCore.SIGNAL("logData(PyQt_PyObject)"),43 self.logData)42 #QtCore.QObject.connect(self.logger, QtCore.SIGNAL("logData(PyQt_PyObject)"), 43 # self.logData) 44 44 45 45 self.toolBox.setItemText(0, "Contacts") … … 75 75 self.connection.emit(QtCore.SIGNAL("activateChat()")) 76 76 self.connection.emit(QtCore.SIGNAL("activatePubSub(PyQt_PyObject)"), unicode(self.options.pubsub)) 77 self.connection.emit(QtCore.SIGNAL("registerLinkages(PyQt_PyObject)"), self.logger)77 #self.connection.emit(QtCore.SIGNAL("registerLinkages(PyQt_PyObject)"), self.logger) 78 78 self.connection.emit(QtCore.SIGNAL("registerLinkages(PyQt_PyObject)"), self.contactUi.contact) 79 79 self.connection.emit(QtCore.SIGNAL("registerLinkages(PyQt_PyObject)"), self.contactUi.presence) … … 147 147 QtCore.QObject.connect(self.connection.qobj.pubsubnode, QtCore.SIGNAL("receivedPubSubMessage(PyQt_PyObject)"), 148 148 self.displayPubSubItems) 149 QtCore.QObject.connect(self.connection.qobj.pubsubnode, QtCore.SIGNAL("purgedNode(PyQt_PyObject)"), 150 self.purgedNode) 149 151 150 152 def setSubscriptionsModel(self, subscriptions): … … 186 188 chat.emit(QtCore.SIGNAL("receivedMessage.%s(PyQt_PyObject)" % contact_jid), message) 187 189 190 def purgedNode(self, message): 191 model = self.nodesUi.model() 192 if model: 193 model.purgeNode(message.node_name) 194 disco = self.connection.qobj.discovery 195 disco.emit(QtCore.SIGNAL("discoverItems(PyQt_PyObject)"), 196 message.node_name) 197 188 198 def openChat(self, contact): 189 199 self._openChat(str(contact.jid)) oss/jlib/jlib/core/connection.py
r735 r740 105 105 ClientStream.Outboxes["%s.affiliations" % XMPP_PUBSUB_NS] = "Pubsub affiliations handler" 106 106 ClientStream.Outboxes["%s.create" % XMPP_PUBSUB_NS] = "Pubsub node creation handler" 107 ClientStream.Outboxes["%s.purge" % XMPP_PUBSUB_ OWNER_NS] = "Pubsub node purge handler"107 ClientStream.Outboxes["%s.purge" % XMPP_PUBSUB_NS] = "Pubsub node purge handler" 108 108 ClientStream.Outboxes["%s.delete" % XMPP_PUBSUB_OWNER_NS] = "Pubsub node delete handler" 109 109 ClientStream.Outboxes["%s.publish" % XMPP_PUBSUB_NS] = "Pubsub item publication handler" oss/jlib/jlib/core/pubsub.py
r738 r740 362 362 linkages = {("xmpp", "%s.create" % XMPP_PUBSUB_NS): ("pubsubdisp", "create.inbox"), 363 363 ("xmpp", "%s.delete" % XMPP_PUBSUB_OWNER_NS): ("pubsubdisp", "delete.inbox"), 364 ("xmpp", "%s.purge" % XMPP_PUBSUB_ OWNER_NS): ("pubsubdisp", "purge.inbox"),364 ("xmpp", "%s.purge" % XMPP_PUBSUB_NS): ("pubsubdisp", "purge.inbox"), 365 365 ("xmpp", "%s.subscribe" % XMPP_PUBSUB_NS): ("pubsubdisp", "subscribe.inbox"), 366 366 ("xmpp", "%s.unsubscribe" % XMPP_PUBSUB_NS):("pubsubdisp", "unsubscribe.inbox"), … … 388 388 ("pubsubdisp", "retract.outbox"): ("xmpp", "forward"), 389 389 ("pubsubdisp", "out.message"): ('itemshandler', 'message.received'), 390 ("pubsubdisp", "out.message.purge"): ('itemshandler', 'purged'), 390 391 ("pubsubdisp", "out.retrieve.result"): ("itemshandler", "retrieved"), 391 392 ("pubsubdisp", "out.create.result"): ("itemshandler", "created"), … … 395 396 ("pubsubdisp", "out.create.error"): ("itemshandler", "error"), 396 397 ("pubsubdisp", "out.delete.error"): ("itemshandler", "error"), 398 ("pubsubdisp", "out.purge.error"): ("itemshandler", "error"), 397 399 ("pubsubdisp", "out.publish.error"): ("itemshandler", "publish.error"), 398 400 ("pubsubdisp", "out.retract.error"): ("itemshandler", "retract.error"), … … 446 448 "created": "", 447 449 "deleted" : "", 450 "purged" : "", 448 451 "error" : "", 449 452 "message.received": "", … … 577 580 self.qobj.emit(QtCore.SIGNAL("receivedPubSubMessage(PyQt_PyObject)"), message) 578 581 582 if self.dataReady('purged'): 583 message = self.recv('purged') 584 self.qobj.emit(QtCore.SIGNAL("purgedNode(PyQt_PyObject)"), message) 585 579 586 if not self.anyReady(): 580 587 self.pause() … … 684 691 rootItem.removeRow(item.row(), item.parent()) 685 692 686 687 693 def purgeNode(self, node): 694 index = self.getNodeIndex(node) 695 if index.isValid(): 696 parentItem = self.itemFromIndex(index) 697 if parentItem.hasChildren(): 698 for row in range(0, parentItem.rowCount()): 699 item = parentItem.child(row, 0) 700 del self.items[item.item.name] 701 702 parentItem.removeRows(0, parentItem.rowCount()) 703 704 #del self.items[node] 705 #parentItem.parent().removeRow(parentItem.row()) 706 oss/jlib/jlib/gui/pubsub/node.py
r737 r740 63 63 item = model.itemFromIndex(index) 64 64 self.pubsub.emit(QtCore.SIGNAL("purgeCollectionNode(PyQt_PyObject)"), item.node) 65 65 66 66 def activated(self, index): 67 67 model = self.nodes.model()
