paques chocolat :D
This commit is contained in:
parent
f1e5ae4b84
commit
e140cf3f97
@ -8,11 +8,6 @@ from pm import Ui_Form
|
|||||||
Host = "127.0.0.1"
|
Host = "127.0.0.1"
|
||||||
Port = 2222
|
Port = 2222
|
||||||
|
|
||||||
#def selectFile():
|
|
||||||
# lineEdit.setText(QFileDialog.getOpenFileName())
|
|
||||||
|
|
||||||
#pushButton.clicked.connect(selectFile)
|
|
||||||
|
|
||||||
|
|
||||||
class MySignal(QObject):
|
class MySignal(QObject):
|
||||||
sig = Signal(str)
|
sig = Signal(str)
|
||||||
@ -51,22 +46,48 @@ class MyThread(QThread):
|
|||||||
self.gui = gui
|
self.gui = gui
|
||||||
|
|
||||||
class privateMessage () :
|
class privateMessage () :
|
||||||
def __init__(self,main):
|
def __init__(self,main,s):
|
||||||
|
|
||||||
#self.queueMsg= []
|
|
||||||
#self.thread = MyThread()
|
|
||||||
#self.thread.finished.connect(self.UpdateChat)
|
|
||||||
|
|
||||||
self.main = main
|
self.main = main
|
||||||
|
self.s = s
|
||||||
self.g = QtGui.QWidget()
|
self.g = QtGui.QWidget()
|
||||||
self.ui = Ui_Form()
|
self.ui = Ui_Form()
|
||||||
self.ui.setupUi(self.g)
|
self.ui.setupUi(self.g)
|
||||||
self.g.show()
|
self.g.show()
|
||||||
|
old = start()
|
||||||
|
|
||||||
def selectFile():
|
self.queueMsg= []
|
||||||
|
self.thread = MyThread()
|
||||||
|
self.thread.finished.connect(old.UpdateChat)
|
||||||
|
|
||||||
|
self.ui.pushButton.clicked.connect(self.send)
|
||||||
|
self.ui.pushButton_2.clicked.connect(self.selectFile)
|
||||||
|
|
||||||
|
|
||||||
|
def selectFile(self):
|
||||||
self.ui.lineEdit.setText(''.join(QFileDialog.getOpenFileName()))
|
self.ui.lineEdit.setText(''.join(QFileDialog.getOpenFileName()))
|
||||||
|
|
||||||
self.ui.pushButton_2.clicked.connect(selectFile)
|
|
||||||
|
|
||||||
|
def send(self):
|
||||||
|
self.cmd = self.ui.lineEdit.text()
|
||||||
|
if self.cmd != "":
|
||||||
|
self.ui.lineEdit.setText('')
|
||||||
|
self.s.settimeout(5.0)
|
||||||
|
try:
|
||||||
|
self.s.send(self.cmd.encode())
|
||||||
|
|
||||||
|
if self.cmd.split(" ")[0] == "/newname":
|
||||||
|
self.pseudo = self.cmd.split(" ")[1]
|
||||||
|
|
||||||
|
if self.cmd.split(" ")[0] == "/name":
|
||||||
|
self.pseudo = self.cmd.split(" ")[1]
|
||||||
|
|
||||||
|
except timeout:
|
||||||
|
self.ShowMessageErreur("Erreur : Timeout. Le serveur ne repond pas")
|
||||||
|
self.ui.txtOutput.setText(self.message_buffer)
|
||||||
|
sb = self.ui.txtOutput.verticalScrollBar()
|
||||||
|
sb.setValue(sb.maximum())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -136,7 +157,7 @@ class start(QtGui.QDialog):
|
|||||||
if txt.split(" ")[0] == "ASKING_FOR_PM" :
|
if txt.split(" ")[0] == "ASKING_FOR_PM" :
|
||||||
self.ShowMessageOK("private discution from "+ txt.split(" ")[1] )
|
self.ShowMessageOK("private discution from "+ txt.split(" ")[1] )
|
||||||
#ouvrir fenetre !!!!
|
#ouvrir fenetre !!!!
|
||||||
self.admin = privateMessage(self)
|
self.admin = privateMessage(self,self.s)
|
||||||
|
|
||||||
|
|
||||||
if txt.split(" ")[0] == "SUCCESSFUL_LOGOUT" :
|
if txt.split(" ")[0] == "SUCCESSFUL_LOGOUT" :
|
||||||
|
Reference in New Issue
Block a user