Changeset 719
- Timestamp:
- 07/18/08 10:19:47 (5 months ago)
- Files:
-
- oss/jlib/designer/ui/contacts.ui (modified) (1 diff)
- oss/jlib/designer/ui/createnodedialog.ui (added)
- oss/jlib/designer/ui/pubsubaffiliations.ui (added)
- oss/jlib/designer/ui/pubsubfeatures.ui (added)
- oss/jlib/designer/ui/pubsubnodes.ui (added)
- oss/jlib/designer/ui/pubsubsubriptions.ui (added)
- oss/jlib/examples/basic/client.py (modified) (4 diffs)
- oss/jlib/examples/basic/clientui.py (modified) (5 diffs)
- oss/jlib/examples/basic/mainwindow.ui (modified) (5 diffs)
- oss/jlib/jlib/core/connection.py (modified) (5 diffs)
- oss/jlib/jlib/core/contact.py (modified) (1 diff)
- oss/jlib/jlib/core/pubsub.py (added)
- oss/jlib/jlib/gui/connection.py (modified) (2 diffs)
- oss/jlib/jlib/gui/contact.py (modified) (1 diff)
- oss/jlib/jlib/gui/contactui.py (modified) (2 diffs)
- oss/jlib/jlib/gui/pubsub (added)
- oss/jlib/jlib/gui/pubsub/__init__.py (added)
- oss/jlib/jlib/gui/pubsub/affiliation.py (added)
- oss/jlib/jlib/gui/pubsub/affiliationsui.py (added)
- oss/jlib/jlib/gui/pubsub/createnodedialog.py (added)
- oss/jlib/jlib/gui/pubsub/createnodedialogui.py (added)
- oss/jlib/jlib/gui/pubsub/feature.py (added)
- oss/jlib/jlib/gui/pubsub/featuresui.py (added)
- oss/jlib/jlib/gui/pubsub/node.py (added)
- oss/jlib/jlib/gui/pubsub/nodesui.py (added)
- oss/jlib/jlib/gui/pubsub/subscription.py (added)
- oss/jlib/jlib/gui/pubsub/subscriptionsui.py (added)
- oss/jlib/setup.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
oss/jlib/designer/ui/contacts.ui
r714 r719 13 13 <string>Form</string> 14 14 </property> 15 <widget class="QTreeView" name="contacts" > 16 <property name="geometry" > 17 <rect> 18 <x>4</x> 19 <y>4</y> 20 <width>316</width> 21 <height>408</height> 22 </rect> 23 </property> 24 <property name="dragEnabled" > 25 <bool>true</bool> 26 </property> 27 <property name="dragDropMode" > 28 <enum>QAbstractItemView::InternalMove</enum> 29 </property> 30 <property name="alternatingRowColors" > 31 <bool>true</bool> 32 </property> 33 </widget> 15 <layout class="QVBoxLayout" name="verticalLayout" > 16 <item> 17 <widget class="QTreeView" name="contacts" > 18 <property name="dragEnabled" > 19 <bool>true</bool> 20 </property> 21 <property name="dragDropMode" > 22 <enum>QAbstractItemView::InternalMove</enum> 23 </property> 24 <property name="alternatingRowColors" > 25 <bool>true</bool> 26 </property> 27 </widget> 28 </item> 29 </layout> 34 30 </widget> 35 31 <resources/> oss/jlib/examples/basic/client.py
r718 r719 6 6 from jlib.gui.chat import jlibChatWidget 7 7 from jlib.gui.contact import jlibContactWidget 8 from jlib.core.chat import jlibChat, jlibChatComponent 8 from jlib.gui.pubsub.node import jlibPubSubNodeWidget 9 from jlib.gui.pubsub.affiliation import jlibPubSubAffiliationWidget 10 from jlib.gui.pubsub.subscription import jlibPubSubSubscriptionWidget 11 from jlib.gui.pubsub.feature import jlibPubSubFeatureWidget 12 from jlib.core.pubsub import jlibSubscriptionDiscoveryModel, \ 13 jlibFeatureDiscoveryModel, jlibAffiliationDiscoveryModel 9 14 10 15 from clientui import Ui_MainWindow … … 23 28 24 29 self.openedChats = [] 30 self.connection = None 25 31 26 self.connection = None 27 self.contactUi = jlibContactWidget(parent=self.stackedWidget) 28 self.stackedWidget.addWidget(self.contactUi) 32 self.toolBox.setItemText(0, "Contacts") 33 self.contactUi = jlibContactWidget(parent=self.page) 29 34 QtCore.QObject.connect(self.contactUi, QtCore.SIGNAL("contactClicked(PyQt_PyObject)"), 30 35 self.openChat) 36 37 self.toolBox.setItemText(1, "Subscriptions") 38 self.subsUi = jlibPubSubSubscriptionWidget(parent=self.page_2) 39 40 self.toolBox.setItemText(2, "Features") 41 self.featsUi = jlibPubSubFeatureWidget(parent=self.page_3) 42 43 self.toolBox.setItemText(3, "Affiliations") 44 self.affsUi = jlibPubSubAffiliationWidget(parent=self.page_5) 45 46 self.toolBox.setItemText(4, "Nodes") 47 self.nodesUi = jlibPubSubNodeWidget(parent=self.page_4) 31 48 32 49 def start(self): … … 34 51 self.clientReady) 35 52 self.connection.emit(QtCore.SIGNAL("activateChat()")) 53 self.connection.emit(QtCore.SIGNAL("activatePubSub(PyQt_PyObject)"), u'pubsub.localhost') 36 54 self.connection.emit(QtCore.SIGNAL("registerLinkages(PyQt_PyObject)"), self.contactUi.contact) 37 55 self.connection.emit(QtCore.SIGNAL("registerLinkages(PyQt_PyObject)"), self.contactUi.presence) … … 62 80 QtCore.QObject.connect(self.connection.qobj.chat, QtCore.SIGNAL("receivedMessage(PyQt_PyObject)"), 63 81 self.messageReceived) 82 self.nodesUi.setPubSub(self.connection.qobj.pubsubnode) 83 84 disco = self.connection.qobj.discovery 85 86 QtCore.QObject.connect(disco, QtCore.SIGNAL("receivedSubscriptions(PyQt_PyObject)"), 87 self.setSubscriptionsModel) 88 disco.emit(QtCore.SIGNAL("discoverSubscriptions()")) 89 90 QtCore.QObject.connect(disco, QtCore.SIGNAL("receivedFeatures(PyQt_PyObject)"), 91 self.setFeaturesModel) 92 disco.emit(QtCore.SIGNAL("discoverFeatures()")) 93 94 QtCore.QObject.connect(disco, QtCore.SIGNAL("receivedAffiliations(PyQt_PyObject)"), 95 self.setAffiliationsModel) 96 disco.emit(QtCore.SIGNAL("discoverAffiliations()")) 97 98 def setSubscriptionsModel(self, subscriptions): 99 model = jlibSubscriptionDiscoveryModel(parent=self.connection.qobj.discovery) 100 model.setSubscriptions(subscriptions) 101 self.subsUi.setModel(model) 102 103 def setFeaturesModel(self, features): 104 model = jlibFeatureDiscoveryModel(parent=self.connection.qobj.discovery) 105 model.setFeatures(features) 106 self.featsUi.setModel(model) 107 108 def setAffiliationsModel(self, affiliations): 109 model = jlibAffiliationDiscoveryModel(parent=self.connection.qobj.discovery) 110 model.setAffiliations(affiliations) 111 self.affsUi.setModel(model) 64 112 65 113 def messageReceived(self, message): oss/jlib/examples/basic/clientui.py
r709 r719 1 1 # -*- coding: utf-8 -*- 2 2 3 # Form implementation generated from reading ui file ' mainwindow.ui'3 # Form implementation generated from reading ui file '..\..\examples\basic\mainwindow.ui' 4 4 # 5 # Created: Sun Jul 6 13:16:1820086 # by: PyQt4 UI code generator 4. 3.35 # Created: Fri Jul 18 16:54:03 2008 6 # by: PyQt4 UI code generator 4.4.2 7 7 # 8 8 # WARNING! All changes made in this file will be lost! … … 13 13 def setupUi(self, MainWindow): 14 14 MainWindow.setObjectName("MainWindow") 15 MainWindow.resize(QtCore.QSize(QtCore.QRect(0,0,800,600).size()).expandedTo(MainWindow.minimumSizeHint())) 16 15 MainWindow.resize(800,600) 17 16 self.centralwidget = QtGui.QWidget(MainWindow) 17 self.centralwidget.setGeometry(QtCore.QRect(0,19,800,562)) 18 18 self.centralwidget.setObjectName("centralwidget") 19 20 self.hboxlayout = QtGui.QHBoxLayout(self.centralwidget) 21 self.hboxlayout.setObjectName("hboxlayout") 22 19 self.horizontalLayout = QtGui.QHBoxLayout(self.centralwidget) 20 self.horizontalLayout.setObjectName("horizontalLayout") 23 21 self.splitter = QtGui.QSplitter(self.centralwidget) 24 22 self.splitter.setOrientation(QtCore.Qt.Horizontal) 25 23 self.splitter.setObjectName("splitter") 26 27 self.stackedWidget = QtGui.QStackedWidget(self.splitter) 28 self.stackedWidget.setObjectName("stackedWidget") 29 24 self.toolBox = QtGui.QToolBox(self.splitter) 25 self.toolBox.setObjectName("toolBox") 30 26 self.page = QtGui.QWidget() 27 self.page.setGeometry(QtCore.QRect(0,0,172,414)) 31 28 self.page.setObjectName("page") 32 self.stackedWidget.addWidget(self.page) 33 29 self.toolBox.addItem(self.page,"") 34 30 self.page_2 = QtGui.QWidget() 31 self.page_2.setGeometry(QtCore.QRect(0,0,172,414)) 35 32 self.page_2.setObjectName("page_2") 36 self.stackedWidget.addWidget(self.page_2) 37 33 self.toolBox.addItem(self.page_2,"") 34 self.page_3 = QtGui.QWidget() 35 self.page_3.setObjectName("page_3") 36 self.toolBox.addItem(self.page_3,"") 37 self.page_5 = QtGui.QWidget() 38 self.page_5.setObjectName("page_5") 39 self.toolBox.addItem(self.page_5,"") 40 self.page_4 = QtGui.QWidget() 41 self.page_4.setObjectName("page_4") 42 self.toolBox.addItem(self.page_4,"") 38 43 self.tabWidget = QtGui.QTabWidget(self.splitter) 39 44 self.tabWidget.setObjectName("tabWidget") 40 41 45 self.tab = QtGui.QWidget() 46 self.tab.setGeometry(QtCore.QRect(0,0,584,520)) 42 47 self.tab.setObjectName("tab") 43 48 self.tabWidget.addTab(self.tab,"") 44 self.h boxlayout.addWidget(self.splitter)49 self.horizontalLayout.addWidget(self.splitter) 45 50 MainWindow.setCentralWidget(self.centralwidget) 46 47 51 self.menubar = QtGui.QMenuBar(MainWindow) 48 self.menubar.setGeometry(QtCore.QRect(0,0,800, 27))52 self.menubar.setGeometry(QtCore.QRect(0,0,800,19)) 49 53 self.menubar.setObjectName("menubar") 50 51 54 self.menuJabber = QtGui.QMenu(self.menubar) 52 55 self.menuJabber.setObjectName("menuJabber") 53 54 56 self.menuConnection = QtGui.QMenu(self.menuJabber) 55 57 self.menuConnection.setObjectName("menuConnection") 56 58 MainWindow.setMenuBar(self.menubar) 57 58 59 self.statusbar = QtGui.QStatusBar(MainWindow) 60 self.statusbar.setGeometry(QtCore.QRect(0,581,800,19)) 59 61 self.statusbar.setObjectName("statusbar") 60 62 MainWindow.setStatusBar(self.statusbar) 61 62 63 self.actionSettings = QtGui.QAction(MainWindow) 63 64 self.actionSettings.setObjectName("actionSettings") 64 65 65 self.actionStart = QtGui.QAction(MainWindow) 66 66 self.actionStart.setObjectName("actionStart") 67 68 67 self.actionStop = QtGui.QAction(MainWindow) 69 68 self.actionStop.setObjectName("actionStop") 70 71 69 self.actionQuit = QtGui.QAction(MainWindow) 72 70 self.actionQuit.setObjectName("actionQuit") … … 81 79 82 80 self.retranslateUi(MainWindow) 81 self.toolBox.setCurrentIndex(3) 83 82 self.tabWidget.setCurrentIndex(0) 84 83 QtCore.QMetaObject.connectSlotsByName(MainWindow) … … 86 85 def retranslateUi(self, MainWindow): 87 86 MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "MainWindow", None, QtGui.QApplication.UnicodeUTF8)) 87 self.toolBox.setItemText(self.toolBox.indexOf(self.page), QtGui.QApplication.translate("MainWindow", "Page 1", None, QtGui.QApplication.UnicodeUTF8)) 88 self.toolBox.setItemText(self.toolBox.indexOf(self.page_2), QtGui.QApplication.translate("MainWindow", "Page 2", None, QtGui.QApplication.UnicodeUTF8)) 89 self.toolBox.setItemText(self.toolBox.indexOf(self.page_3), QtGui.QApplication.translate("MainWindow", "Page", None, QtGui.QApplication.UnicodeUTF8)) 90 self.toolBox.setItemText(self.toolBox.indexOf(self.page_5), QtGui.QApplication.translate("MainWindow", "Page", None, QtGui.QApplication.UnicodeUTF8)) 91 self.toolBox.setItemText(self.toolBox.indexOf(self.page_4), QtGui.QApplication.translate("MainWindow", "Page", None, QtGui.QApplication.UnicodeUTF8)) 88 92 self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), QtGui.QApplication.translate("MainWindow", "Tab 1", None, QtGui.QApplication.UnicodeUTF8)) 89 93 self.menuJabber.setTitle(QtGui.QApplication.translate("MainWindow", "Jabber", None, QtGui.QApplication.UnicodeUTF8)) … … 94 98 self.actionQuit.setText(QtGui.QApplication.translate("MainWindow", "Quit", None, QtGui.QApplication.UnicodeUTF8)) 95 99 96 97 98 if __name__ == "__main__":99 import sys100 app = QtGui.QApplication(sys.argv)101 MainWindow = QtGui.QMainWindow()102 ui = Ui_MainWindow()103 ui.setupUi(MainWindow)104 MainWindow.show()105 sys.exit(app.exec_())oss/jlib/examples/basic/mainwindow.ui
r709 r719 14 14 </property> 15 15 <widget class="QWidget" name="centralwidget" > 16 <layout class="QHBoxLayout" > 16 <property name="geometry" > 17 <rect> 18 <x>0</x> 19 <y>19</y> 20 <width>800</width> 21 <height>562</height> 22 </rect> 23 </property> 24 <layout class="QHBoxLayout" name="horizontalLayout" > 17 25 <item> 18 26 <widget class="QSplitter" name="splitter" > … … 20 28 <enum>Qt::Horizontal</enum> 21 29 </property> 22 <widget class="QStackedWidget" name="stackedWidget" > 23 <widget class="QWidget" name="page" /> 24 <widget class="QWidget" name="page_2" /> 30 <widget class="QToolBox" name="toolBox" > 31 <property name="currentIndex" > 32 <number>3</number> 33 </property> 34 <widget class="QWidget" name="page" > 35 <property name="geometry" > 36 <rect> 37 <x>0</x> 38 <y>0</y> 39 <width>172</width> 40 <height>414</height> 41 </rect> 42 </property> 43 <attribute name="label" > 44 <string>Page 1</string> 45 </attribute> 46 </widget> 47 <widget class="QWidget" name="page_2" > 48 <property name="geometry" > 49 <rect> 50 <x>0</x> 51 <y>0</y> 52 <width>172</width> 53 <height>414</height> 54 </rect> 55 </property> 56 <attribute name="label" > 57 <string>Page 2</string> 58 </attribute> 59 </widget> 60 <widget class="QWidget" name="page_3" > 61 <attribute name="label" > 62 <string>Page</string> 63 </attribute> 64 </widget> 65 <widget class="QWidget" name="page_5" > 66 <attribute name="label" > 67 <string>Page</string> 68 </attribute> 69 </widget> 70 <widget class="QWidget" name="page_4" > 71 <attribute name="label" > 72 <string>Page</string> 73 </attribute> 74 </widget> 25 75 </widget> 26 76 <widget class="QTabWidget" name="tabWidget" > … … 29 79 </property> 30 80 <widget class="QWidget" name="tab" > 81 <property name="geometry" > 82 <rect> 83 <x>0</x> 84 <y>0</y> 85 <width>584</width> 86 <height>520</height> 87 </rect> 88 </property> 31 89 <attribute name="title" > 32 90 <string>Tab 1</string> … … 44 102 <y>0</y> 45 103 <width>800</width> 46 <height> 27</height>104 <height>19</height> 47 105 </rect> 48 106 </property> … … 66 124 <addaction name="menuJabber" /> 67 125 </widget> 68 <widget class="QStatusBar" name="statusbar" /> 126 <widget class="QStatusBar" name="statusbar" > 127 <property name="geometry" > 128 <rect> 129 <x>0</x> 130 <y>581</y> 131 <width>800</width> 132 <height>19</height> 133 </rect> 134 </property> 135 </widget> 69 136 <action name="actionSettings" > 70 137 <property name="text" > oss/jlib/jlib/core/connection.py
r718 r719 17 17 from bridge import Element as E 18 18 from bridge.common import XMPP_CLIENT_NS, XMPP_ROSTER_NS, \ 19 XMPP_LAST_NS, XMPP_DISCO_INFO_NS, XMPP_IBR_NS 19 XMPP_LAST_NS, XMPP_DISCO_INFO_NS, XMPP_IBR_NS, \ 20 XMPP_DISCO_ITEMS_NS, XMPP_PUBSUB_NS, XMPP_PUBSUB_EVENT_NS,\ 21 XMPP_PUBSUB_OWNER_NS 20 22 21 23 from PyQt4 import QtCore … … 23 25 from jlib.core.qaxon import QAxonObject 24 26 from jlib.core.chat import jlibChat, jlibChatComponent 27 from jlib.core.pubsub import jlibPubSubDiscovery, jlibPubSubDiscoveryComponent,\ 28 jlibPubSubNode, jlibPubSubNodeComponent 25 29 26 30 __all__ = ['jlibConnection', 'jlibConnectionComponent'] … … 34 38 self.registerComponents) 35 39 QtCore.QObject.connect(self, QtCore.SIGNAL("activateChat()"), self.enableChat) 40 QtCore.QObject.connect(self, QtCore.SIGNAL("activatePubSub(PyQt_PyObject)"), 41 self.enablePubSub) 36 42 37 43 def start(self): … … 49 55 components, linkages = self.chat.getLinkages() 50 56 self.registerComponents(components, linkages) 51 52 def messageReceived(self, message): 53 print message 54 57 58 def enablePubSub(self, pubsub_service): 59 self.discovery = jlibPubSubDiscovery() 60 self.discovery.setComponent(jlibPubSubDiscoveryComponent(pubsub_service)) 61 components, linkages = self.discovery.getLinkages() 62 self.registerComponents(components, linkages) 63 64 self.pubsubnode = jlibPubSubNode() 65 self.pubsubnode.setComponent(jlibPubSubNodeComponent(pubsub_service)) 66 components, linkages = self.pubsubnode.getLinkages() 67 self.registerComponents(components, linkages) 68 55 69 class jlibConnectionComponent(component): 56 70 Inboxes = {"inbox" : "", … … 81 95 self.register = register 82 96 self.graph = None 97 98 ClientStream.Outboxes["%s.query" % XMPP_IBR_NS] = "Registration" 99 ClientStream.Outboxes["%s.query" % XMPP_LAST_NS] = "Activity" 100 ClientStream.Outboxes["%s.query" % XMPP_DISCO_INFO_NS] = "Discovery" 101 ClientStream.Outboxes["%s.query" % XMPP_DISCO_ITEMS_NS] = "PubSub Discovery of Nodes" 102 ClientStream.Outboxes["%s.subscribe" % XMPP_PUBSUB_NS] = "Pubsub subscription handler" 103 ClientStream.Outboxes["%s.unsubscribe" % XMPP_PUBSUB_NS] = "Pubsub unsubscription handler" 104 ClientStream.Outboxes["%s.subscriptions" % XMPP_PUBSUB_NS] = "Pubsub subscriptions handler" 105 ClientStream.Outboxes["%s.affiliations" % XMPP_PUBSUB_NS] = "Pubsub affiliations handler" 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" 108 ClientStream.Outboxes["%s.delete" % XMPP_PUBSUB_OWNER_NS] = "Pubsub node delete handler" 109 ClientStream.Outboxes["%s.publish" % XMPP_PUBSUB_NS] = "Pubsub item publication handler" 110 ClientStream.Outboxes["%s.retract" % XMPP_PUBSUB_NS] = "Pubsub item deletion handler" 111 ClientStream.Outboxes["%s.x" % XMPP_PUBSUB_EVENT_NS] = "" 112 ClientStream.Outboxes["%s.event" % XMPP_PUBSUB_EVENT_NS] = "" 83 113 84 114 self.client = ClientStream(self.jid, self.passwordLookup, use_tls=self.usetls) oss/jlib/jlib/core/contact.py
r715 r719 1 # -*- coding: utf-8 -*-1 # -*- coding: utf-8 -*- 2 2 from Axon.Component import component 3 3 from Axon.Ipc import shutdownMicroprocess, producerFinished oss/jlib/jlib/gui/connection.py
r718 r719 19 19 self.registerLinkages) 20 20 QtCore.QObject.connect(self, QtCore.SIGNAL("activateChat()"), self.enableChat) 21 QtCore.QObject.connect(self, QtCore.SIGNAL("activatePubSub(PyQt_PyObject)"), 22 self.enablePubSub) 21 23 22 24 def accepted(self): … … 39 41 def enableChat(self): 40 42 self.qobj.emit(QtCore.SIGNAL("activateChat()")) 43 44 def enablePubSub(self, pubsub_service): 45 self.qobj.emit(QtCore.SIGNAL("activatePubSub(PyQt_PyObject)"), pubsub_service) 41 46 42 47 def registerLinkages(self, qobj): oss/jlib/jlib/gui/contact.py
r718 r719 19 19 20 20 self.contacts.contextMenuEvent = self.contextMenuEvent 21 self.contacts.dragEnterEvent = self.dragEnterEvent22 self.contacts.dropEvent = self.dropEvent21 #self.contacts.dragEnterEvent = self.dragEnterEvent 22 #self.contacts.dropEvent = self.dropEvent 23 23 24 24 self.contact = jlibContact(parent=self) oss/jlib/jlib/gui/contactui.py
r714 r719 3 3 # Form implementation generated from reading ui file 'contacts.ui' 4 4 # 5 # Created: Thu Jul 10 17:31:1720085 # Created: Fri Jul 18 15:32:41 2008 6 6 # by: PyQt4 UI code generator 4.4.2 7 7 # … … 14 14 jlibContacts.setObjectName("jlibContacts") 15 15 jlibContacts.resize(324,416) 16 self.verticalLayout = QtGui.QVBoxLayout(jlibContacts) 17 self.verticalLayout.setObjectName("verticalLayout") 16 18 self.contacts = QtGui.QTreeView(jlibContacts) 17 self.contacts.setGeometry(QtCore.QRect(4,4,316,408))18 19 self.contacts.setDragEnabled(True) 19 20 self.contacts.setDragDropMode(QtGui.QAbstractItemView.InternalMove) 20 21 self.contacts.setAlternatingRowColors(True) 21 22 self.contacts.setObjectName("contacts") 23 self.verticalLayout.addWidget(self.contacts) 22 24 23 25 self.retranslateUi(jlibContacts) oss/jlib/setup.py
r709 r719 13 13 url = "http://trac.defuze.org/wiki/jlib", 14 14 download_url = "http://www.defuze.org/oss/jlib/", 15 packages = ["jlib", "jlib.core", "jlib.gui" ],15 packages = ["jlib", "jlib.core", "jlib.gui", "jlib.gui.pubsub"], 16 16 platforms = ["any"], 17 17 license = 'BSD',
