modif file
@ -1,7 +0,0 @@
|
||||
[NETWORK]
|
||||
port = 2222
|
||||
ip = 127.0.0.1
|
||||
|
||||
[PSEUDO]
|
||||
name = bob
|
||||
|
Before Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 1014 B |
Before Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 6.5 KiB |
@ -1,277 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'main.ui'
|
||||
#
|
||||
# Created: Thu Apr 9 00:04:59 2015
|
||||
# by: PyQt4 UI code generator 4.11.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
try:
|
||||
_fromUtf8 = QtCore.QString.fromUtf8
|
||||
except AttributeError:
|
||||
def _fromUtf8(s):
|
||||
return s
|
||||
|
||||
try:
|
||||
_encoding = QtGui.QApplication.UnicodeUTF8
|
||||
def _translate(context, text, disambig):
|
||||
return QtGui.QApplication.translate(context, text, disambig, _encoding)
|
||||
except AttributeError:
|
||||
def _translate(context, text, disambig):
|
||||
return QtGui.QApplication.translate(context, text, disambig)
|
||||
|
||||
class Ui_MainWindow(object):
|
||||
def setupUi(self, MainWindow):
|
||||
MainWindow.setObjectName(_fromUtf8("MainWindow"))
|
||||
MainWindow.resize(800, 567)
|
||||
MainWindow.setMaximumSize(QtCore.QSize(800, 567))
|
||||
self.centralwidget = QtGui.QWidget(MainWindow)
|
||||
self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
|
||||
self.txtOutput = QtGui.QTextEdit(self.centralwidget)
|
||||
self.txtOutput.setGeometry(QtCore.QRect(10, 150, 561, 361))
|
||||
self.txtOutput.setMinimumSize(QtCore.QSize(400, 0))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily(_fromUtf8("Arial"))
|
||||
font.setPointSize(14)
|
||||
font.setItalic(False)
|
||||
self.txtOutput.setFont(font)
|
||||
self.txtOutput.setFocusPolicy(QtCore.Qt.NoFocus)
|
||||
self.txtOutput.setAcceptDrops(False)
|
||||
self.txtOutput.setStyleSheet(_fromUtf8(" position: relative;\n"
|
||||
" border-radius: 2px;\n"
|
||||
" font-size: 0.9em;\n"
|
||||
"background-color: #FAFAFA;\n"
|
||||
" color: #646464;"))
|
||||
self.txtOutput.setFrameShape(QtGui.QFrame.NoFrame)
|
||||
self.txtOutput.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
|
||||
self.txtOutput.setTextInteractionFlags(QtCore.Qt.TextBrowserInteraction)
|
||||
self.txtOutput.setObjectName(_fromUtf8("txtOutput"))
|
||||
self.horizontalLayoutWidget_2 = QtGui.QWidget(self.centralwidget)
|
||||
self.horizontalLayoutWidget_2.setGeometry(QtCore.QRect(10, 40, 781, 51))
|
||||
self.horizontalLayoutWidget_2.setObjectName(_fromUtf8("horizontalLayoutWidget_2"))
|
||||
self.horizontalLayout_2 = QtGui.QHBoxLayout(self.horizontalLayoutWidget_2)
|
||||
self.horizontalLayout_2.setMargin(0)
|
||||
self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
|
||||
self.label_3 = QtGui.QLabel(self.horizontalLayoutWidget_2)
|
||||
self.label_3.setObjectName(_fromUtf8("label_3"))
|
||||
self.horizontalLayout_2.addWidget(self.label_3)
|
||||
self.lineEdit_4 = QtGui.QLineEdit(self.horizontalLayoutWidget_2)
|
||||
self.lineEdit_4.setStyleSheet(_fromUtf8(" border: solid 1px #ccc;\n"
|
||||
" font-size:15px;\n"
|
||||
" background-color:rgb(255, 255, 255);"))
|
||||
self.lineEdit_4.setInputMask(_fromUtf8(""))
|
||||
self.lineEdit_4.setObjectName(_fromUtf8("lineEdit_4"))
|
||||
self.horizontalLayout_2.addWidget(self.lineEdit_4)
|
||||
self.label_4 = QtGui.QLabel(self.horizontalLayoutWidget_2)
|
||||
self.label_4.setObjectName(_fromUtf8("label_4"))
|
||||
self.horizontalLayout_2.addWidget(self.label_4)
|
||||
self.lineEdit_3 = QtGui.QLineEdit(self.horizontalLayoutWidget_2)
|
||||
self.lineEdit_3.setStyleSheet(_fromUtf8(" border: solid 1px #ccc;\n"
|
||||
" font-size:15px;\n"
|
||||
" background-color:rgb(255, 255, 255);"))
|
||||
self.lineEdit_3.setObjectName(_fromUtf8("lineEdit_3"))
|
||||
self.horizontalLayout_2.addWidget(self.lineEdit_3)
|
||||
self.label_5 = QtGui.QLabel(self.horizontalLayoutWidget_2)
|
||||
self.label_5.setObjectName(_fromUtf8("label_5"))
|
||||
self.horizontalLayout_2.addWidget(self.label_5)
|
||||
self.lineEdit_2 = QtGui.QLineEdit(self.horizontalLayoutWidget_2)
|
||||
self.lineEdit_2.setStyleSheet(_fromUtf8(" border: solid 1px #ccc;\n"
|
||||
" font-size:15px;\n"
|
||||
" background-color:rgb(255, 255, 255);"))
|
||||
self.lineEdit_2.setObjectName(_fromUtf8("lineEdit_2"))
|
||||
self.horizontalLayout_2.addWidget(self.lineEdit_2)
|
||||
self.pushButton_6 = QtGui.QPushButton(self.horizontalLayoutWidget_2)
|
||||
self.pushButton_6.setStyleSheet(_fromUtf8("\n"
|
||||
" vertical-align: top;\n"
|
||||
" color: white;\n"
|
||||
" text-align: center;\n"
|
||||
" background: #3498db;\n"
|
||||
" border: 0;\n"
|
||||
" border-bottom: 2px solid #2a8bcc;\n"
|
||||
" padding: 2px 10px 2px 10px;\n"
|
||||
""))
|
||||
self.pushButton_6.setObjectName(_fromUtf8("pushButton_6"))
|
||||
self.horizontalLayout_2.addWidget(self.pushButton_6)
|
||||
self.pushButton_3 = QtGui.QPushButton(self.horizontalLayoutWidget_2)
|
||||
self.pushButton_3.setStyleSheet(_fromUtf8("\n"
|
||||
" vertical-align: top;\n"
|
||||
" color: white;\n"
|
||||
" text-align: center;\n"
|
||||
" background: #3498db;\n"
|
||||
" border: 0;\n"
|
||||
" border-bottom: 2px solid #2a8bcc;\n"
|
||||
" padding: 2px 10px 2px 10px;"))
|
||||
self.pushButton_3.setObjectName(_fromUtf8("pushButton_3"))
|
||||
self.horizontalLayout_2.addWidget(self.pushButton_3)
|
||||
self.pushButton_2 = QtGui.QPushButton(self.horizontalLayoutWidget_2)
|
||||
self.pushButton_2.setStyleSheet(_fromUtf8("\n"
|
||||
" vertical-align: top;\n"
|
||||
" color: white;\n"
|
||||
" text-align: center;\n"
|
||||
" background: #3498db;\n"
|
||||
" border: 0;\n"
|
||||
" border-bottom: 2px solid #2a8bcc;\n"
|
||||
" padding: 2px 10px 2px 10px;"))
|
||||
self.pushButton_2.setObjectName(_fromUtf8("pushButton_2"))
|
||||
self.horizontalLayout_2.addWidget(self.pushButton_2)
|
||||
self.label_2 = QtGui.QLabel(self.centralwidget)
|
||||
self.label_2.setGeometry(QtCore.QRect(10, 10, 171, 31))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(16)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label_2.setFont(font)
|
||||
self.label_2.setObjectName(_fromUtf8("label_2"))
|
||||
self.horizontalLayoutWidget = QtGui.QWidget(self.centralwidget)
|
||||
self.horizontalLayoutWidget.setGeometry(QtCore.QRect(10, 520, 781, 41))
|
||||
self.horizontalLayoutWidget.setObjectName(_fromUtf8("horizontalLayoutWidget"))
|
||||
self.horizontalLayout = QtGui.QHBoxLayout(self.horizontalLayoutWidget)
|
||||
self.horizontalLayout.setMargin(0)
|
||||
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
|
||||
self.lineEdit = QtGui.QLineEdit(self.horizontalLayoutWidget)
|
||||
self.lineEdit.setStyleSheet(_fromUtf8(" border: solid 1px #ccc;\n"
|
||||
" font-size:20px;\n"
|
||||
" background-color:rgb(255, 255, 255);"))
|
||||
self.lineEdit.setObjectName(_fromUtf8("lineEdit"))
|
||||
self.horizontalLayout.addWidget(self.lineEdit)
|
||||
self.pushButton = QtGui.QPushButton(self.horizontalLayoutWidget)
|
||||
self.pushButton.setStyleSheet(_fromUtf8("QPushButton {\n"
|
||||
" vertical-align: top;\n"
|
||||
" color: white;\n"
|
||||
" text-align: center;\n"
|
||||
" background: #3498db;\n"
|
||||
" border: 0;\n"
|
||||
" padding: 2px 10px 2px 10px;\n"
|
||||
" border-bottom: 2px solid #2a8bcc;\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"QPushButton : !enabled { \n"
|
||||
"\n"
|
||||
" vertical-align: top;\n"
|
||||
" color: white;\n"
|
||||
" text-align: center;\n"
|
||||
" background: rgb(255, 255, 255);\n"
|
||||
" border: 0;\n"
|
||||
" border-bottom: 2px solid #2a8bcc;\n"
|
||||
"\n"
|
||||
"}"))
|
||||
self.pushButton.setInputMethodHints(QtCore.Qt.ImhNone)
|
||||
self.pushButton.setDefault(False)
|
||||
self.pushButton.setFlat(False)
|
||||
self.pushButton.setObjectName(_fromUtf8("pushButton"))
|
||||
self.horizontalLayout.addWidget(self.pushButton)
|
||||
self.horizontalLayoutWidget_3 = QtGui.QWidget(self.centralwidget)
|
||||
self.horizontalLayoutWidget_3.setGeometry(QtCore.QRect(10, 100, 561, 40))
|
||||
self.horizontalLayoutWidget_3.setObjectName(_fromUtf8("horizontalLayoutWidget_3"))
|
||||
self.horizontalLayout_3 = QtGui.QHBoxLayout(self.horizontalLayoutWidget_3)
|
||||
self.horizontalLayout_3.setMargin(0)
|
||||
self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
|
||||
self.pushButton_5 = QtGui.QPushButton(self.horizontalLayoutWidget_3)
|
||||
self.pushButton_5.setStyleSheet(_fromUtf8("\n"
|
||||
" vertical-align: top;\n"
|
||||
" color: white;\n"
|
||||
" text-align: center;\n"
|
||||
" background: #3498db;\n"
|
||||
" border: 0;\n"
|
||||
" border-bottom: 2px solid #2a8bcc;\n"
|
||||
" padding: 2px 10px 2px 10px;"))
|
||||
self.pushButton_5.setObjectName(_fromUtf8("pushButton_5"))
|
||||
self.horizontalLayout_3.addWidget(self.pushButton_5)
|
||||
self.verticalLayoutWidget = QtGui.QWidget(self.centralwidget)
|
||||
self.verticalLayoutWidget.setGeometry(QtCore.QRect(590, 100, 201, 411))
|
||||
self.verticalLayoutWidget.setObjectName(_fromUtf8("verticalLayoutWidget"))
|
||||
self.verticalLayout = QtGui.QVBoxLayout(self.verticalLayoutWidget)
|
||||
self.verticalLayout.setMargin(0)
|
||||
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
|
||||
self.label = QtGui.QLabel(self.verticalLayoutWidget)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(16)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label.setFont(font)
|
||||
self.label.setObjectName(_fromUtf8("label"))
|
||||
self.verticalLayout.addWidget(self.label)
|
||||
self.listNames = QtGui.QListWidget(self.verticalLayoutWidget)
|
||||
self.listNames.setMinimumSize(QtCore.QSize(50, 0))
|
||||
self.listNames.setMaximumSize(QtCore.QSize(200, 16777215))
|
||||
self.listNames.setBaseSize(QtCore.QSize(0, 0))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily(_fromUtf8("Cantarell"))
|
||||
font.setPointSize(14)
|
||||
font.setBold(True)
|
||||
font.setItalic(False)
|
||||
font.setWeight(75)
|
||||
font.setStrikeOut(False)
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.listNames.setFont(font)
|
||||
self.listNames.setFocusPolicy(QtCore.Qt.NoFocus)
|
||||
self.listNames.setAcceptDrops(False)
|
||||
self.listNames.setStyleSheet(_fromUtf8("\n"
|
||||
" position: relative;\n"
|
||||
" border-radius: 2px;\n"
|
||||
" font-size: 0.9em;\n"
|
||||
"background-color: #DEDEDE;\n"
|
||||
" color: #646464;"))
|
||||
self.listNames.setFrameShape(QtGui.QFrame.NoFrame)
|
||||
self.listNames.setFrameShadow(QtGui.QFrame.Sunken)
|
||||
self.listNames.setLineWidth(1)
|
||||
self.listNames.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
|
||||
self.listNames.setObjectName(_fromUtf8("listNames"))
|
||||
self.verticalLayout.addWidget(self.listNames)
|
||||
self.listNames_2 = QtGui.QListWidget(self.verticalLayoutWidget)
|
||||
self.listNames_2.setMinimumSize(QtCore.QSize(50, 0))
|
||||
self.listNames_2.setMaximumSize(QtCore.QSize(200, 16777215))
|
||||
self.listNames_2.setBaseSize(QtCore.QSize(0, 0))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily(_fromUtf8("Cantarell"))
|
||||
font.setPointSize(14)
|
||||
font.setBold(False)
|
||||
font.setItalic(False)
|
||||
font.setWeight(50)
|
||||
font.setStrikeOut(True)
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.listNames_2.setFont(font)
|
||||
self.listNames_2.setFocusPolicy(QtCore.Qt.NoFocus)
|
||||
self.listNames_2.setAcceptDrops(False)
|
||||
self.listNames_2.setStyleSheet(_fromUtf8(" position: relative;\n"
|
||||
" border-radius: 2px;\n"
|
||||
" font-size: 0.9em;\n"
|
||||
"background-color: #DEDEDE;\n"
|
||||
" color: #646464;"))
|
||||
self.listNames_2.setFrameShape(QtGui.QFrame.NoFrame)
|
||||
self.listNames_2.setFrameShadow(QtGui.QFrame.Sunken)
|
||||
self.listNames_2.setLineWidth(1)
|
||||
self.listNames_2.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
|
||||
self.listNames_2.setObjectName(_fromUtf8("listNames_2"))
|
||||
self.verticalLayout.addWidget(self.listNames_2)
|
||||
MainWindow.setCentralWidget(self.centralwidget)
|
||||
|
||||
self.retranslateUi(MainWindow)
|
||||
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
||||
|
||||
def retranslateUi(self, MainWindow):
|
||||
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow", None))
|
||||
self.txtOutput.setHtml(_translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
|
||||
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
|
||||
"p, li { white-space: pre-wrap; }\n"
|
||||
"</style></head><body style=\" font-family:\'Arial\'; font-size:14pt; font-weight:400; font-style:normal;\">\n"
|
||||
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:\'Inconsolata\';\"><br /></p></body></html>", None))
|
||||
self.label_3.setText(_translate("MainWindow", "IP : ", None))
|
||||
self.lineEdit_4.setText(_translate("MainWindow", "127.0.0.1", None))
|
||||
self.label_4.setText(_translate("MainWindow", "Port :", None))
|
||||
self.lineEdit_3.setText(_translate("MainWindow", "2222", None))
|
||||
self.label_5.setText(_translate("MainWindow", "Pseudo :", None))
|
||||
self.lineEdit_2.setText(_translate("MainWindow", "anonymous", None))
|
||||
self.pushButton_6.setText(_translate("MainWindow", "Change pseudo", None))
|
||||
self.pushButton_3.setText(_translate("MainWindow", "Disconnect", None))
|
||||
self.pushButton_2.setText(_translate("MainWindow", "Connect", None))
|
||||
self.label_2.setText(_translate("MainWindow", "Welcome to DNC", None))
|
||||
self.pushButton.setText(_translate("MainWindow", "Send message", None))
|
||||
self.pushButton_5.setText(_translate("MainWindow", "Away From Keyboard", None))
|
||||
self.label.setText(_translate("MainWindow", "Nick list", None))
|
||||
self.listNames.setSortingEnabled(True)
|
||||
self.listNames_2.setSortingEnabled(True)
|
||||
|
@ -1,460 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>567</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>800</width>
|
||||
<height>567</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<widget class="QTextEdit" name="txtOutput">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>150</y>
|
||||
<width>561</width>
|
||||
<height>361</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Arial</family>
|
||||
<pointsize>14</pointsize>
|
||||
<italic>false</italic>
|
||||
</font>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="acceptDrops">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"> position: relative;
|
||||
border-radius: 2px;
|
||||
font-size: 0.9em;
|
||||
background-color: #FAFAFA;
|
||||
color: #646464;</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="verticalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAsNeeded</enum>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Arial'; font-size:14pt; font-weight:400; font-style:normal;">
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Inconsolata';"><br /></p></body></html></string>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::TextBrowserInteraction</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="horizontalLayoutWidget_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>40</y>
|
||||
<width>781</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>IP : </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_4">
|
||||
<property name="styleSheet">
|
||||
<string notr="true"> border: solid 1px #ccc;
|
||||
font-size:15px;
|
||||
background-color:rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
<property name="inputMask">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>127.0.0.1</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Port :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_3">
|
||||
<property name="styleSheet">
|
||||
<string notr="true"> border: solid 1px #ccc;
|
||||
font-size:15px;
|
||||
background-color:rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>2222</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Pseudo :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_2">
|
||||
<property name="styleSheet">
|
||||
<string notr="true"> border: solid 1px #ccc;
|
||||
font-size:15px;
|
||||
background-color:rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>anonymous</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_6">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">
|
||||
vertical-align: top;
|
||||
color: white;
|
||||
text-align: center;
|
||||
background: #3498db;
|
||||
border: 0;
|
||||
border-bottom: 2px solid #2a8bcc;
|
||||
padding: 2px 10px 2px 10px;
|
||||
</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Change pseudo</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_3">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">
|
||||
vertical-align: top;
|
||||
color: white;
|
||||
text-align: center;
|
||||
background: #3498db;
|
||||
border: 0;
|
||||
border-bottom: 2px solid #2a8bcc;
|
||||
padding: 2px 10px 2px 10px;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Disconnect</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">
|
||||
vertical-align: top;
|
||||
color: white;
|
||||
text-align: center;
|
||||
background: #3498db;
|
||||
border: 0;
|
||||
border-bottom: 2px solid #2a8bcc;
|
||||
padding: 2px 10px 2px 10px;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Connect</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>171</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Welcome to DNC</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="horizontalLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>520</y>
|
||||
<width>781</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit">
|
||||
<property name="styleSheet">
|
||||
<string notr="true"> border: solid 1px #ccc;
|
||||
font-size:20px;
|
||||
background-color:rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton {
|
||||
vertical-align: top;
|
||||
color: white;
|
||||
text-align: center;
|
||||
background: #3498db;
|
||||
border: 0;
|
||||
padding: 2px 10px 2px 10px;
|
||||
border-bottom: 2px solid #2a8bcc;
|
||||
}
|
||||
|
||||
QPushButton : !enabled {
|
||||
|
||||
vertical-align: top;
|
||||
color: white;
|
||||
text-align: center;
|
||||
background: rgb(255, 255, 255);
|
||||
border: 0;
|
||||
border-bottom: 2px solid #2a8bcc;
|
||||
|
||||
}</string>
|
||||
</property>
|
||||
<property name="inputMethodHints">
|
||||
<set>Qt::ImhNone</set>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Send message</string>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="horizontalLayoutWidget_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>100</y>
|
||||
<width>561</width>
|
||||
<height>40</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_5">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">
|
||||
vertical-align: top;
|
||||
color: white;
|
||||
text-align: center;
|
||||
background: #3498db;
|
||||
border: 0;
|
||||
border-bottom: 2px solid #2a8bcc;
|
||||
padding: 2px 10px 2px 10px;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Away From Keyboard</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="verticalLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>590</x>
|
||||
<y>100</y>
|
||||
<width>201</width>
|
||||
<height>411</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Nick list</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="listNames">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="baseSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Cantarell</family>
|
||||
<pointsize>14</pointsize>
|
||||
<weight>75</weight>
|
||||
<italic>false</italic>
|
||||
<bold>true</bold>
|
||||
<strikeout>false</strikeout>
|
||||
<stylestrategy>PreferAntialias</stylestrategy>
|
||||
</font>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="acceptDrops">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">
|
||||
position: relative;
|
||||
border-radius: 2px;
|
||||
font-size: 0.9em;
|
||||
background-color: #DEDEDE;
|
||||
color: #646464;</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="listNames_2">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="baseSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Cantarell</family>
|
||||
<pointsize>14</pointsize>
|
||||
<weight>50</weight>
|
||||
<italic>false</italic>
|
||||
<bold>false</bold>
|
||||
<strikeout>true</strikeout>
|
||||
<stylestrategy>PreferAntialias</stylestrategy>
|
||||
</font>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="acceptDrops">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"> position: relative;
|
||||
border-radius: 2px;
|
||||
font-size: 0.9em;
|
||||
background-color: #DEDEDE;
|
||||
color: #646464;</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,105 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'pmWindow.ui'
|
||||
#
|
||||
# Created: Mon Apr 6 17:05:26 2015
|
||||
# by: PyQt4 UI code generator 4.11.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
try:
|
||||
_fromUtf8 = QtCore.QString.fromUtf8
|
||||
except AttributeError:
|
||||
def _fromUtf8(s):
|
||||
return s
|
||||
|
||||
try:
|
||||
_encoding = QtGui.QApplication.UnicodeUTF8
|
||||
def _translate(context, text, disambig):
|
||||
return QtGui.QApplication.translate(context, text, disambig, _encoding)
|
||||
except AttributeError:
|
||||
def _translate(context, text, disambig):
|
||||
return QtGui.QApplication.translate(context, text, disambig)
|
||||
|
||||
class Ui_Dialog2(object):
|
||||
def setupUi(self, Dialog2):
|
||||
Dialog2.setObjectName(_fromUtf8("Dialog2"))
|
||||
Dialog2.resize(605, 373)
|
||||
self.horizontalLayoutWidget_2 = QtGui.QWidget(Dialog2)
|
||||
self.horizontalLayoutWidget_2.setGeometry(QtCore.QRect(50, 50, 531, 31))
|
||||
self.horizontalLayoutWidget_2.setObjectName(_fromUtf8("horizontalLayoutWidget_2"))
|
||||
self.horizontalLayout_2 = QtGui.QHBoxLayout(self.horizontalLayoutWidget_2)
|
||||
self.horizontalLayout_2.setMargin(0)
|
||||
self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
|
||||
self.pushButton_3 = QtGui.QPushButton(self.horizontalLayoutWidget_2)
|
||||
self.pushButton_3.setObjectName(_fromUtf8("pushButton_3"))
|
||||
self.horizontalLayout_2.addWidget(self.pushButton_3)
|
||||
self.pushButton_4 = QtGui.QPushButton(self.horizontalLayoutWidget_2)
|
||||
self.pushButton_4.setObjectName(_fromUtf8("pushButton_4"))
|
||||
self.horizontalLayout_2.addWidget(self.pushButton_4)
|
||||
self.horizontalLayoutWidget = QtGui.QWidget(Dialog2)
|
||||
self.horizontalLayoutWidget.setGeometry(QtCore.QRect(50, 320, 531, 41))
|
||||
self.horizontalLayoutWidget.setObjectName(_fromUtf8("horizontalLayoutWidget"))
|
||||
self.horizontalLayout = QtGui.QHBoxLayout(self.horizontalLayoutWidget)
|
||||
self.horizontalLayout.setMargin(0)
|
||||
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
|
||||
self.lineEdit = QtGui.QLineEdit(self.horizontalLayoutWidget)
|
||||
self.lineEdit.setObjectName(_fromUtf8("lineEdit"))
|
||||
self.horizontalLayout.addWidget(self.lineEdit)
|
||||
self.pushButton = QtGui.QPushButton(self.horizontalLayoutWidget)
|
||||
self.pushButton.setObjectName(_fromUtf8("pushButton"))
|
||||
self.horizontalLayout.addWidget(self.pushButton)
|
||||
self.pushButton_2 = QtGui.QPushButton(self.horizontalLayoutWidget)
|
||||
self.pushButton_2.setObjectName(_fromUtf8("pushButton_2"))
|
||||
self.horizontalLayout.addWidget(self.pushButton_2)
|
||||
self.txtOutput = QtGui.QTextEdit(Dialog2)
|
||||
self.txtOutput.setGeometry(QtCore.QRect(50, 80, 531, 231))
|
||||
self.txtOutput.setMinimumSize(QtCore.QSize(200, 0))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily(_fromUtf8("Arial"))
|
||||
font.setPointSize(14)
|
||||
font.setItalic(False)
|
||||
self.txtOutput.setFont(font)
|
||||
self.txtOutput.setFocusPolicy(QtCore.Qt.NoFocus)
|
||||
self.txtOutput.setAcceptDrops(False)
|
||||
self.txtOutput.setFrameShape(QtGui.QFrame.NoFrame)
|
||||
self.txtOutput.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
|
||||
self.txtOutput.setTextInteractionFlags(QtCore.Qt.TextBrowserInteraction)
|
||||
self.txtOutput.setObjectName(_fromUtf8("txtOutput"))
|
||||
self.horizontalLayoutWidget_3 = QtGui.QWidget(Dialog2)
|
||||
self.horizontalLayoutWidget_3.setGeometry(QtCore.QRect(50, 10, 531, 41))
|
||||
self.horizontalLayoutWidget_3.setObjectName(_fromUtf8("horizontalLayoutWidget_3"))
|
||||
self.horizontalLayout_4 = QtGui.QHBoxLayout(self.horizontalLayoutWidget_3)
|
||||
self.horizontalLayout_4.setMargin(0)
|
||||
self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4"))
|
||||
self.label = QtGui.QLabel(self.horizontalLayoutWidget_3)
|
||||
self.label.setObjectName(_fromUtf8("label"))
|
||||
self.horizontalLayout_4.addWidget(self.label)
|
||||
self.label_2 = QtGui.QLabel(self.horizontalLayoutWidget_3)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(12)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label_2.setFont(font)
|
||||
self.label_2.setObjectName(_fromUtf8("label_2"))
|
||||
self.horizontalLayout_4.addWidget(self.label_2)
|
||||
|
||||
self.retranslateUi(Dialog2)
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog2)
|
||||
|
||||
def retranslateUi(self, Dialog2):
|
||||
Dialog2.setWindowTitle(_translate("Dialog2", "Dialog", None))
|
||||
self.pushButton_3.setText(_translate("Dialog2", "Accept", None))
|
||||
self.pushButton_4.setText(_translate("Dialog2", "Refuse", None))
|
||||
self.pushButton.setText(_translate("Dialog2", "Send message", None))
|
||||
self.pushButton_2.setText(_translate("Dialog2", "send file", None))
|
||||
self.txtOutput.setHtml(_translate("Dialog2", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
|
||||
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
|
||||
"p, li { white-space: pre-wrap; }\n"
|
||||
"</style></head><body style=\" font-family:\'Arial\'; font-size:14pt; font-weight:400; font-style:normal;\">\n"
|
||||
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:\'Inconsolata\';\"><br /></p></body></html>", None))
|
||||
self.label.setText(_translate("Dialog2", "Private Discussion with :", None))
|
||||
self.label_2.setText(_translate("Dialog2", "TextLabel", None))
|
||||
|
@ -1,152 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Dialog2</class>
|
||||
<widget class="QDialog" name="Dialog2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>605</width>
|
||||
<height>373</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="horizontalLayoutWidget_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>50</x>
|
||||
<y>50</y>
|
||||
<width>531</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_3">
|
||||
<property name="text">
|
||||
<string>Accept</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_4">
|
||||
<property name="text">
|
||||
<string>Refuse</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="horizontalLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>50</x>
|
||||
<y>320</y>
|
||||
<width>531</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>Send message</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="text">
|
||||
<string>send file</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QTextEdit" name="txtOutput">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>50</x>
|
||||
<y>80</y>
|
||||
<width>531</width>
|
||||
<height>231</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Arial</family>
|
||||
<pointsize>14</pointsize>
|
||||
<italic>false</italic>
|
||||
</font>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="acceptDrops">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="verticalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAsNeeded</enum>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Arial'; font-size:14pt; font-weight:400; font-style:normal;">
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Inconsolata';"><br /></p></body></html></string>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::TextBrowserInteraction</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="horizontalLayoutWidget_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>50</x>
|
||||
<y>10</y>
|
||||
<width>531</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Private Discussion with :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,610 +0,0 @@
|
||||
from main import Ui_MainWindow
|
||||
from PyQt4 import QtGui, QtCore
|
||||
from PySide.QtCore import *
|
||||
from PySide.QtGui import *
|
||||
import time, threading, datetime, time, random,re
|
||||
from socket import *
|
||||
from pmWindow import Ui_Dialog2
|
||||
import configparser
|
||||
|
||||
|
||||
|
||||
class MySignal(QObject):
|
||||
sig = Signal(str)
|
||||
|
||||
class MyLongThread(QThread):
|
||||
def __init__(self, parent = None):
|
||||
QThread.__init__(self, parent)
|
||||
self.exiting = False
|
||||
self.signal = MySignal()
|
||||
|
||||
def run(self):
|
||||
end = time.time()+10
|
||||
while self.exiting==False:
|
||||
sys.stdout.write('*')
|
||||
sys.stdout.flush()
|
||||
time.sleep(1)
|
||||
now = time.time()
|
||||
if now>=end:
|
||||
self.exiting=True
|
||||
self.signal.sig.emit('OK')
|
||||
|
||||
class MyThread(QThread):
|
||||
def __init__(self, parent = None):
|
||||
QThread.__init__(self, parent)
|
||||
|
||||
self.exiting = False
|
||||
|
||||
def run(self):
|
||||
self.s.settimeout(None)
|
||||
data = self.s.recv(4096)
|
||||
messgServeur = (data.decode())
|
||||
self.gui.setNewMsg(messgServeur)
|
||||
|
||||
def setConfig(self,s,gui):
|
||||
self.s = s
|
||||
self.gui = gui
|
||||
|
||||
class privateMessage () :
|
||||
def __init__(self,main,s, pmPerson, pmPerso):
|
||||
|
||||
self.main = main
|
||||
self.s = s
|
||||
self.pmPerso = pmPerso
|
||||
self.pmPerson = pmPerson
|
||||
self.g = QtGui.QWidget()
|
||||
self.ui = Ui_Dialog2()
|
||||
self.ui.setupUi(self.g)
|
||||
self.g.show()
|
||||
#old = start()
|
||||
self.message_buffer2 = ""
|
||||
|
||||
self.g.setWindowState(self.g.windowState() & ~QtCore.Qt.WindowMinimized | QtCore.Qt.WindowActive)
|
||||
self.g.activateWindow()
|
||||
|
||||
Qt.WindowStaysOnTopHint
|
||||
|
||||
self.queueMsg2= []
|
||||
self.thread = MyThread()
|
||||
self.thread.finished.connect(self.UpdateChatP)
|
||||
|
||||
self.ui.pushButton.clicked.connect(self.send)
|
||||
self.ui.lineEdit.returnPressed.connect(self.send)
|
||||
|
||||
self.ui.pushButton_4.clicked.connect(self.reject)
|
||||
self.ui.pushButton_3.clicked.connect(self.accept)
|
||||
self.ui.pushButton_2.clicked.connect(self.selectFile)
|
||||
self.ui.label_2.setText(pmPerson)
|
||||
|
||||
def reject(self):
|
||||
self.cmRej = "/rejectpm "+self.pmPerson
|
||||
try:
|
||||
self.s.send(self.cmRej.encode())
|
||||
|
||||
except timeout:
|
||||
self.ShowMessageErreur("Erreur : Timeout. Le serveur ne repond pas")
|
||||
self.ui.txtOutput.setText(self.message_buffer2)
|
||||
sb = self.ui.txtOutput.verticalScrollBar()
|
||||
sb.setValue(sb.maximum())
|
||||
|
||||
def accept(self):
|
||||
self.cmAcc = "/acceptpm "+self.pmPerson
|
||||
try:
|
||||
self.s.send(self.cmAcc.encode())
|
||||
|
||||
|
||||
except timeout:
|
||||
self.ShowMessageErreur("Erreur : Timeout. Le serveur ne repond pas")
|
||||
self.ui.txtOutput.setText(self.message_buffer2)
|
||||
sb = self.ui.txtOutput.verticalScrollBar()
|
||||
sb.setValue(sb.maximum())
|
||||
|
||||
def selectFile(self):
|
||||
self.ui.lineEdit.setText('/pmfile '+self.pmPerson+ ' '.join(QFileDialog.getOpenFileName()))
|
||||
|
||||
def htmlToText( self, html ):
|
||||
|
||||
html = html.replace('<', '<')
|
||||
html = html.replace('>', '>')
|
||||
html = html.replace(':-)', '<img src="img/happy.png" alt="Smiley face">')
|
||||
html = html.replace(':-(', '<img src="img/sad.png" alt="sad face">')
|
||||
html = html.replace(':-p', '<img src="img/langue.png" alt="langue face">')
|
||||
html = html.replace(';-)', '<img src="img/oeil.png" alt="oeil face">')
|
||||
html = html.replace(':-D', '<img src="img/veryHappy.png" alt="very happy face">')
|
||||
html = html.replace(':-o', '<img src="img/etonne.png" alt="etonne face">')
|
||||
html = html.replace(':\'(', '<img src="img/cry.png" alt="cry face">')
|
||||
html = html.replace('(y)', '<img src="img/like.png" alt="like face">')
|
||||
html = html.replace('8|', '<img src="img/lunette.png" alt="lunette face">')
|
||||
html = html.replace('3:)', '<img src="img/hell.png" alt="hell face">')
|
||||
html = html.replace(':pedobear', '<img src="img/pedo.gif" alt="hell face">')
|
||||
html = html.replace(':homer', '<img src="img/homer.gif" alt="homer face">')
|
||||
|
||||
|
||||
return html
|
||||
|
||||
def ShowMessageErreur(self, txt):
|
||||
self.message_buffer2 += '<br> <span style="color : red; font-weight: bold;"> '+ self.htmlToText(txt) +' </span>'
|
||||
|
||||
|
||||
def send(self):
|
||||
self.cmdP = self.ui.lineEdit.text()
|
||||
if self.cmdP != "":
|
||||
self.ui.lineEdit.setText('')
|
||||
self.s.settimeout(5.0)
|
||||
self.cmd = "/pm " +self.pmPerson+ " " + self.cmdP
|
||||
try:
|
||||
self.s.send(self.cmd.encode())
|
||||
|
||||
except timeout:
|
||||
self.ShowMessageErreur("Erreur : Timeout. Le serveur ne repond pas")
|
||||
self.ui.txtOutput.setText(self.message_buffer2)
|
||||
sb = self.ui.txtOutput.verticalScrollBar()
|
||||
sb.setValue(sb.maximum())
|
||||
|
||||
def UpdateChatP(self) :
|
||||
if self.queueMsg2 :
|
||||
m = self.queueMsg2.pop(0)
|
||||
if m :
|
||||
self.thread.start()
|
||||
self.ShowMessageAsTextPm(m)
|
||||
#self.ui.txtOutput.setText(self.message_buffer2)
|
||||
#sb = self.ui.txtOutput.verticalScrollBar()
|
||||
#sb.setValue(sb.maximum())
|
||||
|
||||
def getTimeStamp(self):
|
||||
return ('[%s] ' % str(datetime.datetime.fromtimestamp(int(time.time())).strftime('%H:%M')))
|
||||
|
||||
def ShowMessageAsTextPm(self, txt) :
|
||||
|
||||
self.message_buffer2 += '<br><span style="color : grey">'+txt+'</span>'
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_PRIVATE_DISCUSSION_REFUSED":
|
||||
self.g.close()
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_PRIVATE_DISCUSSION_REJECTED":
|
||||
self.g.close()
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_PM_SENDED":
|
||||
self.message_buffer2 += '<br><span style="color : grey"> ' + self.getTimeStamp() + '</span> <span style="color : red"> < '+self.pmPerso +' > </span> ' + self.htmlToText(self.cmdP) + ''
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_PRIVATE_DISCUSSION_ACCEPTED":
|
||||
self.message_buffer2 += '<br> <span style="color : green"> Chalange Accepted ! </span>'
|
||||
self.ui.pushButton_4.setDisabled(True)
|
||||
self.ui.pushButton_3.setDisabled(True)
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_PRIVATE_DISCUSSION_OK":
|
||||
self.message_buffer2 += '<br> <span style="color : green"> Private discussion with '+txt.split(" ")[1]+' accepted ! </span>'
|
||||
self.ui.pushButton_4.setDisabled(True)
|
||||
self.ui.pushButton_3.setDisabled(True)
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "NEW_PM" :
|
||||
self.message_buffer2 += '<br><span style="color : grey"> ' + self.getTimeStamp() + '</span> <span style="color : red"> < '+ self.pmPerso +' > </span> ' + self.htmlToText(' '.join(txt.split(" ")[2:])) + ''
|
||||
|
||||
|
||||
self.ui.txtOutput.setText(self.message_buffer2)
|
||||
sb = self.ui.txtOutput.verticalScrollBar()
|
||||
sb.setValue(sb.maximum())
|
||||
|
||||
class start(QtGui.QMainWindow):
|
||||
def __init__(self):
|
||||
super(start, self).__init__()
|
||||
self.queueMsg= []
|
||||
self.thread = MyThread()
|
||||
self.thread.finished.connect(self.UpdateChat)
|
||||
|
||||
|
||||
self.createWidgets()
|
||||
|
||||
def setNewMsg (self,msg) :
|
||||
self.queueMsg.append(msg)
|
||||
|
||||
def getTimeStamp(self):
|
||||
return ('[%s] ' % str(datetime.datetime.fromtimestamp(int(time.time())).strftime('%H:%M')))
|
||||
|
||||
def htmlToText( self, html ):
|
||||
|
||||
html = html.replace('<', '<')
|
||||
html = html.replace('>', '>')
|
||||
html = html.replace(':-)', '<img src="img/happy.png" alt="Smiley face">')
|
||||
html = html.replace(':-(', '<img src="img/sad.png" alt="sad face">')
|
||||
html = html.replace(':-p', '<img src="img/langue.png" alt="langue face">')
|
||||
html = html.replace(';-)', '<img src="img/oeil.png" alt="oeil face">')
|
||||
html = html.replace(':-D', '<img src="img/veryHappy.png" alt="very happy face">')
|
||||
html = html.replace(':-o', '<img src="img/etonne.png" alt="etonne face">')
|
||||
html = html.replace(':\'(', '<img src="img/cry.png" alt="cry face">')
|
||||
html = html.replace('(y)', '<img src="img/like.png" alt="like face">')
|
||||
html = html.replace('8|', '<img src="img/lunette.png" alt="lunette face">')
|
||||
html = html.replace('3:)', '<img src="img/hell.png" alt="hell face">')
|
||||
html = html.replace(':pedobear', '<img src="img/pedo.gif" alt="hell face">')
|
||||
html = html.replace(':homer', '<img src="img/homer.gif" alt="homer face">')
|
||||
|
||||
|
||||
return html
|
||||
|
||||
def ShowMessageErreur(self, txt):
|
||||
self.message_buffer += '<br> <span style="color : red; font-weight: bold;"> '+ self.htmlToText(txt) +' </span>'
|
||||
|
||||
def ShowMessageOK(self, txt):
|
||||
self.message_buffer += '<br> <span style="color : green; font-weight: bold;"> '+ self.htmlToText(txt) +' </span>'
|
||||
|
||||
def ShowMessageInfo (self, txt) :
|
||||
self.message_buffer += '<br> <span style="color : #FF00FF; font-weight: bold;"> '+ self.htmlToText(txt) +' </span>'
|
||||
|
||||
|
||||
def ShowMessageAsText(self, txt):
|
||||
|
||||
if re.match("^ERR_", txt):
|
||||
self.ShowMessageErreur("Erreur ! : " + txt)
|
||||
|
||||
self.message_buffer += '<br> <span style="color : #E6E6E6"> '+ txt +' </span>'
|
||||
|
||||
if txt.split(" ")[0] == "IS_NOW_DISABLE":
|
||||
self.ShowMessageInfo(txt.split(" ")[1]+" is Away From Keyboard")
|
||||
self.ui.listNames.clear()
|
||||
self.ui.listNames_2.clear()
|
||||
self.s.send("/userlist".encode())
|
||||
self.s.send("/userlistaway".encode())
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "IS_NOW_ENABLE":
|
||||
self.ShowMessageInfo(txt.split(" ")[1]+" is Back !!")
|
||||
self.ui.listNames.clear()
|
||||
self.ui.listNames_2.clear()
|
||||
self.s.send("/userlist".encode())
|
||||
self.s.send("/userlistaway".encode())
|
||||
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_PRIVATE_DISCUSSION_ACCEPTED":
|
||||
self.message_buffer += '<br> <span style="color : green"> PRIVATE DISCUSSION ? challenge accepted ! '
|
||||
self.private2.ShowMessageAsTextPm("SUCC_PRIVATE_DISCUSSION_ACCEPTED")
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_PRIVATE_DISCUSSION_OK":
|
||||
self.message_buffer += '<br> <span style="color : green"> PRIVATE DISCUSSION WITH '+txt.split(" ")[1]+' ? challenge accepted ! '
|
||||
self.private2.ShowMessageAsTextPm(txt)
|
||||
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_INVITED" :
|
||||
self.ShowMessageOK("invitation requested")
|
||||
self.private2 = privateMessage(self,self.s,self.demande,self.pseudo)
|
||||
|
||||
if txt.split(" ")[0] == "ASKING_FOR_PM" :
|
||||
self.ShowMessageOK("private discution from "+ txt.split(" ")[1] )
|
||||
self.private2 = privateMessage(self,self.s,txt.split(" ")[1],self.pseudo)
|
||||
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_PM_SENDED" :
|
||||
self.private2.ShowMessageAsTextPm(txt.split(" ")[0])
|
||||
|
||||
if txt.split(" ")[0] == "NEW_PM" :
|
||||
self.private2.ShowMessageAsTextPm(txt)
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_PRIVATE_DISCUSSION_REFUSED" :
|
||||
self.private2.ShowMessageAsTextPm(txt)
|
||||
self.ShowMessageOK("Private discussion refused !!")
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_PRIVATE_DISCUSSION_REJECTED" :
|
||||
self.private2.ShowMessageAsTextPm(txt)
|
||||
self.ShowMessageOK(txt.split(" ")[1]+" Rejected your Private discussion !!")
|
||||
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "SUCCESSFUL_LOGOUT" :
|
||||
self.ShowMessageOK("You have logged out of the DNC !")
|
||||
self.ui.listNames.clear()
|
||||
self.ui.listNames_2.clear()
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_DISABLED" :
|
||||
self.ShowMessageOK("You are AFK !")
|
||||
self.ui.listNames.clear()
|
||||
self.ui.listNames_2.clear()
|
||||
self.s.send("/userlist".encode())
|
||||
self.s.send("/userlistaway".encode())
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_ENABLED" :
|
||||
self.ShowMessageOK("You are back !")
|
||||
self.ui.listNames.clear()
|
||||
self.ui.listNames_2.clear()
|
||||
self.s.send("/userlist".encode())
|
||||
self.s.send("/userlistaway".encode())
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_VALID_NICKNAME" :
|
||||
self.ShowMessageOK("Sucessful nickname change !")
|
||||
|
||||
if txt.split(" ")[0] == "ERR_INVALID_NICKNAME" :
|
||||
self.pseudo = "INVALID_NICKNAME"
|
||||
|
||||
#HAS_LEFT anonymous52
|
||||
if txt.split(" ")[0] == "NAME_CHANGED" :
|
||||
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())
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "SUCC_CHANNEL_JOINED" or txt.split(" ")[0] == "SUCC_CHANNEL_JOINEDUSERLIST" :
|
||||
self.ShowMessageHasJoin(self.pseudo)
|
||||
self.ui.listNames.clear()
|
||||
self.ui.listNames_2.clear()
|
||||
#self.s.send("/userlist".encode())
|
||||
#self.s.send("/userlistaway".encode())
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "ERR_NICKNAME_ALREADY_USED" :
|
||||
self.deco()
|
||||
|
||||
|
||||
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]).replace("USERAWAY",""))
|
||||
print(str(txt.split(" ")[1:]))
|
||||
|
||||
if re.compile('USERAWAY').search(txt.split(" ")[0] ) :
|
||||
n = len(txt.split(" ")[1:]) +1
|
||||
for i in range(1,n) :
|
||||
self.ui.listNames_2.addItem(str(txt.split(" ")[i]))
|
||||
print(str(txt.split(" ")[1:]))
|
||||
|
||||
|
||||
|
||||
if txt.split(" ")[0] == "NEW_MSG" :
|
||||
self.message_buffer += '<br><span style="color : grey"> ' + self.getTimeStamp() + '</span> <span style="color : red"> < '+txt.split(" ")[1] +' > </span> <span style="color : black">' + self.htmlToText(' '.join(txt.split(" ")[2:])) + '</span>'
|
||||
|
||||
if txt == "SUCC_MESSAGE_SENDED" :
|
||||
self.message_buffer += '<br><span style="color : grey"> ' + self.getTimeStamp() + '</span> <span style="color : red"> < '+ self.pseudo +' > </span><span style="color : black"> ' + self.htmlToText(self.cmd) + '</span>'
|
||||
|
||||
|
||||
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>'
|
||||
|
||||
def UpdateChat(self) :
|
||||
if self.queueMsg :
|
||||
m = self.queueMsg.pop(0)
|
||||
if m :
|
||||
self.thread.start()
|
||||
self.ShowMessageAsText(m)
|
||||
self.ui.txtOutput.setText(self.message_buffer)
|
||||
sb = self.ui.txtOutput.verticalScrollBar()
|
||||
sb.setValue(sb.maximum())
|
||||
|
||||
|
||||
|
||||
def connectActions(self):
|
||||
self.ui.pushButton_2.clicked.connect(self.connecter)
|
||||
self.ui.pushButton_3.clicked.connect(self.deco)
|
||||
self.ui.pushButton.clicked.connect(self.client)
|
||||
self.ui.pushButton_6.clicked.connect(self.changeN)
|
||||
self.ui.pushButton_5.clicked.connect(self.away)
|
||||
|
||||
self.ui.lineEdit.returnPressed.connect(self.client)
|
||||
|
||||
#self.connect(self.ui.listNames,
|
||||
# QtCore.SIGNAL("itemDoubleClicked(QListWidgetItem *)"),
|
||||
# self.someMethod)
|
||||
self.ui.listNames.itemActivated.connect(self.someMethod)
|
||||
|
||||
def someMethod(self,item):
|
||||
nom = item.text().replace("SUCC_INVITED","")
|
||||
cmdPM = "/askpm "+nom
|
||||
try:
|
||||
self.s.send(cmdPM.encode())
|
||||
self.demande = nom
|
||||
|
||||
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())
|
||||
|
||||
|
||||
def away(self):
|
||||
|
||||
if self.bouton == "disable" :
|
||||
cmdAway = "/disable "
|
||||
try:
|
||||
self.s.send(cmdAway.encode())
|
||||
self.ui.pushButton_5.setText("Back")
|
||||
|
||||
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())
|
||||
self.bouton = "enable"
|
||||
|
||||
elif self.bouton == "enable" :
|
||||
self.bouton = "disable"
|
||||
cmdAway = "/enable "
|
||||
try:
|
||||
self.s.send(cmdAway.encode())
|
||||
self.ui.pushButton_5.setText("Away From Keyboard")
|
||||
|
||||
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())
|
||||
|
||||
|
||||
def changeN(self):
|
||||
changePseudo = self.ui.lineEdit_2.text()
|
||||
cmdChange = "/name "+changePseudo
|
||||
try:
|
||||
self.s.send(cmdChange.encode())
|
||||
self.pseudo = changePseudo
|
||||
self.ui.listNames.clear()
|
||||
self.s.send("/userlist".encode())
|
||||
|
||||
|
||||
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())
|
||||
|
||||
|
||||
|
||||
def connecter(self):
|
||||
|
||||
ip= self.ui.lineEdit_4.text()
|
||||
port = int(self.ui.lineEdit_3.text())
|
||||
if ip is None or port is None :
|
||||
Addr = (Host, Port)
|
||||
else :
|
||||
Addr = (ip,port)
|
||||
|
||||
|
||||
self.s = socket(AF_INET, SOCK_STREAM)
|
||||
self.s.connect(Addr)
|
||||
self.thread.setConfig(self.s,self)
|
||||
self.ui.lineEdit.setDisabled(False)
|
||||
self.ui.pushButton.setDisabled(False)
|
||||
self.ui.pushButton_2.setDisabled(True)
|
||||
self.ui.pushButton_3.setDisabled(False)
|
||||
self.ui.lineEdit_4.setDisabled(True)
|
||||
self.ui.lineEdit_3.setDisabled(True)
|
||||
self.thread.start()
|
||||
|
||||
|
||||
cmd2 = self.ui.lineEdit_2.text()
|
||||
if cmd2 != "":
|
||||
self.s.settimeout(5.0)
|
||||
cmdPseudo = "/newname "+cmd2
|
||||
try:
|
||||
self.s.send(cmdPseudo.encode())
|
||||
self.pseudo = cmd2
|
||||
self.ui.pushButton_6.setDisabled(False)
|
||||
|
||||
|
||||
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())
|
||||
|
||||
|
||||
def deco(self):
|
||||
quitter = "/quit"
|
||||
self.s.send(quitter.encode())
|
||||
#self.s.close()
|
||||
self.ui.lineEdit.setDisabled(True)
|
||||
self.ui.pushButton.setDisabled(True)
|
||||
self.ui.pushButton_2.setDisabled(False)
|
||||
self.ui.pushButton_3.setDisabled(True)
|
||||
self.ui.pushButton_6.setDisabled(True)
|
||||
|
||||
self.ui.lineEdit_4.setDisabled(False)
|
||||
self.ui.lineEdit_3.setDisabled(False)
|
||||
|
||||
def ecoute(self):
|
||||
while 1 :
|
||||
data = self.s.recv(4096)
|
||||
if not data :
|
||||
break
|
||||
messgServeur = (data.decode())
|
||||
|
||||
|
||||
if messgServeur == "ERR_INVALID_NICKNAME" :
|
||||
self.pseudo = "INVALID_NICKNAME"
|
||||
|
||||
|
||||
self.UpdateChat(messgServeur)
|
||||
|
||||
|
||||
def createWidgets(self):
|
||||
self.ui = Ui_MainWindow()
|
||||
self.ui.setupUi(self)
|
||||
|
||||
ano = "anonymous" + ''.join(str(random.randint(1,9)) for _ in range(2))
|
||||
|
||||
config = configparser.ConfigParser()
|
||||
|
||||
config.read("dncClient.conf")
|
||||
|
||||
port = config.get("NETWORK", "port")
|
||||
ip = config.get("NETWORK", "ip")
|
||||
name = config.get("PSEUDO", "name")
|
||||
|
||||
if name is not None :
|
||||
self.ui.lineEdit_2.setText(name)
|
||||
else :
|
||||
self.ui.lineEdit_2.setText(ano)
|
||||
|
||||
if ip is not None :
|
||||
self.ui.lineEdit_4.setText(ip)
|
||||
|
||||
|
||||
if port is not None :
|
||||
self.ui.lineEdit_3.setText(port)
|
||||
|
||||
|
||||
|
||||
|
||||
self.ui.lineEdit.setDisabled(True)
|
||||
self.ui.pushButton.setDisabled(True)
|
||||
self.ui.pushButton_3.setDisabled(True)
|
||||
self.ui.pushButton_6.setDisabled(True)
|
||||
self.message_buffer = ""
|
||||
self.bouton = "disable"
|
||||
|
||||
self.connectActions()
|
||||
|
||||
|
||||
|
||||
def client(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]
|
||||
|
||||
if self.cmd.split(" ")[0]=="/askpm":
|
||||
self.demande = 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())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
app = QtGui.QApplication(sys.argv)
|
||||
myapp = start()
|
||||
myapp.show()
|
||||
myapp.focusWidget()
|
||||
sys.exit(app.exec_())
|
||||
for t in threading.enumerate():
|
||||
if t != threading.main_thread(): t.join()
|