turie 3 !

This commit is contained in:
DonRenando 2015-04-03 23:28:55 +02:00
parent 4feefdd4aa
commit b26a83f81c
3 changed files with 48 additions and 11 deletions

View File

@ -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)

View File

@ -2,12 +2,15 @@
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>774</width>
<height>540</height>
<width>814</width>
<height>557</height>
</rect>
</property>
<property name="windowTitle">
@ -17,12 +20,18 @@
<iconset>
<normaloff>../../../../../../Images/Homer-Simpson-homer-simpson-3065329-800-600.jpg</normaloff>../../../../../../Images/Homer-Simpson-homer-simpson-3065329-800-600.jpg</iconset>
</property>
<property name="sizeGripEnabled">
<bool>false</bool>
</property>
<property name="modal">
<bool>false</bool>
</property>
<widget class="QWidget" name="verticalLayoutWidget">
<property name="geometry">
<rect>
<x>600</x>
<y>100</y>
<width>160</width>
<width>201</width>
<height>361</height>
</rect>
</property>
@ -102,7 +111,7 @@
<rect>
<x>20</x>
<y>470</y>
<width>741</width>
<width>781</width>
<height>69</height>
</rect>
</property>

View File

@ -84,7 +84,7 @@ class start(QtGui.QDialog):
if re.match("^ERR_", txt):
self.ShowMessageErreur("Erreur !")
self.message_buffer += '<br> <span style="color : #E6E6E6"> '+ txt.split(" ")[0] +' </span>'
self.message_buffer += '<br> <span style="color : #E6E6E6"> '+ txt +' </span>'
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 += '<br> <span style="color : #FF00FF; font-weight: bold;"> '+ self.htmlToText(txt) +' has joined DNC </span>'
def ShowMessageHasLeft (self, txt) :
self.message_buffer += '<br> <span style="color : #FF00FF; font-weight: bold;"> '+ self.htmlToText(txt) +' has left DNC </span>'
def ShowMessageNameChange (self, txt, txt2) :
self.message_buffer += '<br> <span style="color : #FF00FF; font-weight: bold;"> '+ self.htmlToText(txt) +' is now : '+self.htmlToText(txt2)+' </span>'
@ -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: