frango !
This commit is contained in:
parent
bb72fdcc9a
commit
156165524b
@ -26,6 +26,10 @@ class start(QtGui.QDialog):
|
|||||||
self.ui = Ui_Dialog()
|
self.ui = Ui_Dialog()
|
||||||
self.ui.setupUi(self)
|
self.ui.setupUi(self)
|
||||||
|
|
||||||
|
self.ui.lineEdit.setDisabled(True)
|
||||||
|
self.ui.pushButton.setDisabled(True)
|
||||||
|
self.ui.pushButton_3.setDisabled(True)
|
||||||
|
|
||||||
self.message_buffer = ""
|
self.message_buffer = ""
|
||||||
self.ShowMessageAsText("coucou ! comment ça va ?")
|
self.ShowMessageAsText("coucou ! comment ça va ?")
|
||||||
self.connectActions()
|
self.connectActions()
|
||||||
@ -33,8 +37,6 @@ class start(QtGui.QDialog):
|
|||||||
|
|
||||||
# self.UpdateMainDisplay()
|
# self.UpdateMainDisplay()
|
||||||
|
|
||||||
self.ui.txtOutput.setText(self.message_buffer)
|
|
||||||
|
|
||||||
def connectActions(self):
|
def connectActions(self):
|
||||||
self.ui.pushButton_2.clicked.connect(self.connecter)
|
self.ui.pushButton_2.clicked.connect(self.connecter)
|
||||||
self.ui.pushButton_3.clicked.connect(self.deco)
|
self.ui.pushButton_3.clicked.connect(self.deco)
|
||||||
@ -43,9 +45,16 @@ class start(QtGui.QDialog):
|
|||||||
def connecter(self):
|
def connecter(self):
|
||||||
self.s = socket(AF_INET, SOCK_STREAM)
|
self.s = socket(AF_INET, SOCK_STREAM)
|
||||||
self.s.connect(Addr)
|
self.s.connect(Addr)
|
||||||
|
self.ui.lineEdit.setDisabled(False)
|
||||||
|
self.ui.pushButton.setDisabled(False)
|
||||||
|
self.ui.pushButton_2.setDisabled(True)
|
||||||
|
self.ui.pushButton_3.setDisabled(False)
|
||||||
|
|
||||||
def deco(self):
|
def deco(self):
|
||||||
self.s.close()
|
self.s.close()
|
||||||
|
self.ui.lineEdit.setDisabled(True)
|
||||||
|
self.ui.pushButton.setDisabled(True)
|
||||||
|
self.ui.pushButton_2.setDisabled(False)
|
||||||
|
|
||||||
def client(self):
|
def client(self):
|
||||||
|
|
||||||
@ -56,7 +65,9 @@ class start(QtGui.QDialog):
|
|||||||
try:
|
try:
|
||||||
self.s.send(cmd.encode())
|
self.s.send(cmd.encode())
|
||||||
data = self.s.recv(4096)
|
data = self.s.recv(4096)
|
||||||
print(data.decode())
|
messgServeur = (data.decode())
|
||||||
|
self.ShowMessageAsText(messgServeur)
|
||||||
|
self.ui.txtOutput.setText(self.message_buffer)
|
||||||
except timeout:
|
except timeout:
|
||||||
print("Erreur : Timeout. Le serveur ne repond pas.")
|
print("Erreur : Timeout. Le serveur ne repond pas.")
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user