Exemple #1
0
	def __init__(self, parent=None):
		QtGui.QMainWindow.__init__(self, parent)
		self.settings = QtCore.QSettings("Intellicom", "Sacks")
		self.media = {}
		streamDialog = pystreamDialog(self.settings)
		self.media["streamSession"] = pystream(streamDialog)
		self.media["voip"] = pyvoipInterface(self.settings, self)
		self.interfaceGui = pymainWindow(self.media)
		self.usersRoomList = {}
		
		self.clientParameters = {}
		self.clientParameters["urlServer"] = "riunionidigitali.net"
		self.clientParameters["jidServer"] = "*****@*****.**"
		self.clientParameters["jidMaxLenght"] = 30
		self.clientParameters["ipAddrServer"] = ""
		self.clientParameters["jidChair"] = ""
		self.clientParameters["portToken"] = None
		self.clientParameters["passwdCtrlRemoteScreen"] = ""
		self.clientParameters["passwdViewRemoteScreen"] = ""
		self.clientParameters["ipRemoteScreen"] = ""
		self.httpRequestCheckRiunioni = QtNetwork.QHttp()
		self.httpRequestCheckRiunioni.setHost(self.clientParameters["urlServer"])
		QtCore.QObject.connect(self.httpRequestCheckRiunioni, QtCore.SIGNAL("readyRead(const QHttpResponseHeader&)"), self.httpCheckRiunioniRead)

		licenceFile = QtCore.QFile("COPYING")
		if not licenceFile.open(QtCore.QIODevice.ReadOnly | QtCore.QIODevice.Text):	
			print "missing license"
			exit()
		self.licenseText = QtCore.QString(licenceFile.readAll())
		
		# lista degli slot Widget
		self.usersList = {}
		
		# lista con informazioni sugli eventuali stream da leggere
		self.readMediaList = {}		
		self.interfaceGui.show()
		QtCore.QObject.connect(self.interfaceGui.ui.actionConnection, QtCore.SIGNAL("toggled(bool)"), self.connJabber)
		QtCore.QObject.connect(self.interfaceGui.ui.actionNew, QtCore.SIGNAL("triggered()"), self.addRoomUser)
		QtCore.QObject.connect(self.interfaceGui.ui.actionDelete, QtCore.SIGNAL("triggered()"), self.delRoomUser)
		QtCore.QObject.connect(self.interfaceGui.ui.actionAbout, QtCore.SIGNAL("triggered()"), self.showAbout)
		QtCore.QObject.connect(self.interfaceGui.ui.actionFocusRequest, QtCore.SIGNAL("triggered()"), self.focusRequestUser)
		QtCore.QObject.connect(self.interfaceGui.ui.actionExit, QtCore.SIGNAL("triggered()"), self.close)
		QtCore.QObject.connect(self.interfaceGui, QtCore.SIGNAL("msgOut"), self.sendJabberRoom)

# definizione jabber con le sue connessioni
		self.jabberUser = pyjabber(self)
		# self.elabCommand=pyelabCommand(self.jabberUser, self.usersList, self.usersRoomList)
		QtCore.QObject.connect(self.jabberUser, QtCore.SIGNAL("jabberMessage"), self.menageIncomingJabberMsg)
		QtCore.QObject.connect(self.jabberUser, QtCore.SIGNAL("fileIncomingRequest"), self.menageJabberFileIncomingRequest)
		QtCore.QObject.connect(self.jabberUser, QtCore.SIGNAL("presence"), self.elaboratePresence)
		QtCore.QObject.connect(self.jabberUser, QtCore.SIGNAL("subscriptionRequest"), self.userRoomSubscriptionRequest)
		QtCore.QObject.connect(self.jabberUser, QtCore.SIGNAL("connection"), self.connection)
		QtCore.QObject.connect(self.jabberUser, QtCore.SIGNAL("userInterface"), self.userInterface)
		# lista degli utenti aggiunti nella stanza del chair, e mi informa se son presenti o no in quella stanza
		
		self.connectedChair = False
		self.udpSendReq = QtNetwork.QUdpSocket()
		self.chairModeStatus = False
		self.focusStatus = False
		self.remoteDesktopStatus = False
Exemple #2
0
			if abilitated:
				QtCore.QObject.connect(self.interfaceGui.timer, QtCore.SIGNAL("timeout()"), self.lightIcon)
			else:	
				QtCore.QObject.disconnect(self.interfaceGui.timer, QtCore.SIGNAL("timeout()"), self.lightIcon)
	
	def lightIcon(self):
		boxIndex = self.interfaceGui.ui.toolBox.indexOf(self)
		iconUser = self.interfaceGui.ui.toolBox.itemIcon(boxIndex)
		iconLight = self.interfaceGui.ui.actionFocusRequest.icon()
		self.interfaceGui.ui.toolBox.setItemIcon(boxIndex, iconLight)
		QtCore.QTimer.singleShot(1000, lambda: self.interfaceGui.ui.toolBox.setItemIcon(boxIndex, iconUser))
	
# 	def manageRemoteScreen(self,  registered):
# 		if not registered:
# 			self.userSlot.buttonRemoteDesktop.setChecked(False)
	def closeEvent(self, closeEvent):	
		print "close userBox"
		
from jabber.py_jabber import pyjabber
if __name__ == "__main__":
	app = QtGui.QApplication(sys.argv)
	a = pyjabber()
	
	box = pyuserBox("marcello", a)
	b = box.userSlot
	# box.show()
# 	c=QtGui.QToolBox()
# 	c.addItem(b, "uyyu")
# 	c.show()
	sys.exit(app.exec_())