diff --git a/client/view/mainWindow.py b/client/view/mainWindow.py index 9b2b7fe..28447ff 100755 --- a/client/view/mainWindow.py +++ b/client/view/mainWindow.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'mainWindow.ui' # -# Created: Fri Apr 3 20:01:13 2015 +# Created: Fri Apr 3 22:17:37 2015 # by: PyQt4 UI code generator 4.11.3 # # WARNING! All changes made in this file will be lost! @@ -26,12 +26,15 @@ except AttributeError: class Ui_Dialog(object): def setupUi(self, Dialog): Dialog.setObjectName(_fromUtf8("Dialog")) - Dialog.resize(774, 540) + Dialog.setEnabled(True) + Dialog.resize(814, 557) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(_fromUtf8("../../../../../../Images/Homer-Simpson-homer-simpson-3065329-800-600.jpg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) Dialog.setWindowIcon(icon) + Dialog.setSizeGripEnabled(False) + Dialog.setModal(False) self.verticalLayoutWidget = QtGui.QWidget(Dialog) - self.verticalLayoutWidget.setGeometry(QtCore.QRect(600, 100, 160, 361)) + self.verticalLayoutWidget.setGeometry(QtCore.QRect(600, 100, 201, 361)) self.verticalLayoutWidget.setObjectName(_fromUtf8("verticalLayoutWidget")) self.verticalLayout = QtGui.QVBoxLayout(self.verticalLayoutWidget) self.verticalLayout.setMargin(0) @@ -64,7 +67,7 @@ class Ui_Dialog(object): self.listNames.setObjectName(_fromUtf8("listNames")) self.verticalLayout.addWidget(self.listNames) self.horizontalLayoutWidget = QtGui.QWidget(Dialog) - self.horizontalLayoutWidget.setGeometry(QtCore.QRect(20, 470, 741, 69)) + self.horizontalLayoutWidget.setGeometry(QtCore.QRect(20, 470, 781, 69)) self.horizontalLayoutWidget.setObjectName(_fromUtf8("horizontalLayoutWidget")) self.horizontalLayout = QtGui.QHBoxLayout(self.horizontalLayoutWidget) self.horizontalLayout.setMargin(0) diff --git a/client/view/mainWindow.ui b/client/view/mainWindow.ui index e7c1e56..f88c5a0 100755 --- a/client/view/mainWindow.ui +++ b/client/view/mainWindow.ui @@ -2,12 +2,15 @@ Dialog + + true + 0 0 - 774 - 540 + 814 + 557 @@ -17,12 +20,18 @@ ../../../../../../Images/Homer-Simpson-homer-simpson-3065329-800-600.jpg../../../../../../Images/Homer-Simpson-homer-simpson-3065329-800-600.jpg + + false + + + false + 600 100 - 160 + 201 361 @@ -102,7 +111,7 @@ 20 470 - 741 + 781 69 diff --git a/client/view/start.py b/client/view/start.py index 51ab1a8..c0b221b 100755 --- a/client/view/start.py +++ b/client/view/start.py @@ -84,7 +84,7 @@ class start(QtGui.QDialog): if re.match("^ERR_", txt): self.ShowMessageErreur("Erreur !") - self.message_buffer += '
'+ txt.split(" ")[0] +' ' + self.message_buffer += '
'+ txt +' ' if txt.split(" ")[0] == "SUCCESSFUL_LOGOUT" : @@ -101,15 +101,35 @@ class start(QtGui.QDialog): self.ShowMessageOK("Sucessful nickname change !") - + #HAS_LEFT anonymous52 if txt.split(" ")[0] == "NAME_CHANGED" : - self.ShowMessageNameChange(txt.split(" ")[1], txt.split(" ")[2]) + self.ShowMessageNameChange(txt.split(" ")[1], txt.split(" ")[2]) + self.ui.listNames.clear() + self.s.send("/userlist".encode()) if txt.split(" ")[0] == "HAS_JOIN" : self.ShowMessageHasJoin(txt.split(" ")[1]) + self.ui.listNames.addItem(txt.split(" ")[1]) + + if txt.split(" ")[0] == "HAS_LEFT" : + self.ShowMessageHasLeft(txt.split(" ")[1]) + self.ui.listNames.clear() + self.s.send("/userlist".encode()) + + #self.ui.listNames.removeItemWidget(1) + #self.ui.listNames.addItem(txt.split(" ")[1]) + if txt.split(" ")[0] == "SUCC_CHANNEL_JOINED" or txt.split(" ")[0] == "SUCC_CHANNEL_JOINEDUSERLIST" : self.ShowMessageHasJoin(self.pseudo) + + + if re.compile('USERLIST').search(txt.split(" ")[0] ) : + n = len(txt.split(" ")[1:]) +1 + for i in range(1,n) : + self.ui.listNames.addItem(str(txt.split(" ")[i])) + print(str(txt.split(" ")[1:])) + if txt.split(" ")[0] == "NEW_MSG" : @@ -122,6 +142,9 @@ class start(QtGui.QDialog): def ShowMessageHasJoin (self, txt) : self.message_buffer += '
'+ self.htmlToText(txt) +' has joined DNC ' + def ShowMessageHasLeft (self, txt) : + self.message_buffer += '
'+ self.htmlToText(txt) +' has left DNC ' + def ShowMessageNameChange (self, txt, txt2) : self.message_buffer += '
'+ self.htmlToText(txt) +' is now : '+self.htmlToText(txt2)+' ' @@ -181,6 +204,8 @@ class start(QtGui.QDialog): try: self.s.send(cmdChange.encode()) self.pseudo = changePseudo + self.ui.listNames.clear() + self.s.send("/userlist".encode()) except timeout: