From 156165524b29b1e42f63abb33afaba11a027368d Mon Sep 17 00:00:00 2001 From: DonRenando Date: Tue, 31 Mar 2015 17:05:45 +0200 Subject: [PATCH] frango ! --- client/view/start.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/client/view/start.py b/client/view/start.py index dc3f8dd..c983577 100644 --- a/client/view/start.py +++ b/client/view/start.py @@ -26,6 +26,10 @@ class start(QtGui.QDialog): self.ui = Ui_Dialog() self.ui.setupUi(self) + self.ui.lineEdit.setDisabled(True) + self.ui.pushButton.setDisabled(True) + self.ui.pushButton_3.setDisabled(True) + self.message_buffer = "" self.ShowMessageAsText("coucou ! comment ça va ?") self.connectActions() @@ -33,8 +37,6 @@ class start(QtGui.QDialog): # self.UpdateMainDisplay() - self.ui.txtOutput.setText(self.message_buffer) - def connectActions(self): self.ui.pushButton_2.clicked.connect(self.connecter) self.ui.pushButton_3.clicked.connect(self.deco) @@ -43,9 +45,16 @@ class start(QtGui.QDialog): def connecter(self): self.s = socket(AF_INET, SOCK_STREAM) 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): self.s.close() + self.ui.lineEdit.setDisabled(True) + self.ui.pushButton.setDisabled(True) + self.ui.pushButton_2.setDisabled(False) def client(self): @@ -56,7 +65,9 @@ class start(QtGui.QDialog): try: self.s.send(cmd.encode()) data = self.s.recv(4096) - print(data.decode()) + messgServeur = (data.decode()) + self.ShowMessageAsText(messgServeur) + self.ui.txtOutput.setText(self.message_buffer) except timeout: print("Erreur : Timeout. Le serveur ne repond pas.")