diff --git a/client/view/img/matt-icons_accessories-irc-client.png b/client/view/img/matt-icons_accessories-irc-client.png new file mode 100644 index 0000000..d3f2083 Binary files /dev/null and b/client/view/img/matt-icons_accessories-irc-client.png differ diff --git a/client/view/mainWindow.py b/client/view/main.py old mode 100755 new mode 100644 similarity index 78% rename from client/view/mainWindow.py rename to client/view/main.py index 1124ce5..d13e7fc --- a/client/view/mainWindow.py +++ b/client/view/main.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file 'mainWindow.ui' +# Form implementation generated from reading ui file 'main.ui' # -# Created: Wed Apr 8 16:42:34 2015 +# 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! @@ -23,20 +23,165 @@ except AttributeError: def _translate(context, text, disambig): return QtGui.QApplication.translate(context, text, disambig) -class Ui_Dialog(object): - def setupUi(self, Dialog): - Dialog.setObjectName(_fromUtf8("Dialog")) - Dialog.setEnabled(True) - Dialog.resize(827, 558) - Dialog.setMaximumSize(QtCore.QSize(827, 558)) - 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.setStyleSheet(_fromUtf8(" background-color: #EFEFEF")) - Dialog.setSizeGripEnabled(False) - Dialog.setModal(False) - self.verticalLayoutWidget = QtGui.QWidget(Dialog) - self.verticalLayoutWidget.setGeometry(QtCore.QRect(600, 90, 201, 411)) +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) @@ -102,178 +247,31 @@ class Ui_Dialog(object): self.listNames_2.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) self.listNames_2.setObjectName(_fromUtf8("listNames_2")) self.verticalLayout.addWidget(self.listNames_2) - self.horizontalLayoutWidget = QtGui.QWidget(Dialog) - self.horizontalLayoutWidget.setGeometry(QtCore.QRect(20, 510, 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" -" 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_2 = QtGui.QWidget(Dialog) - self.horizontalLayoutWidget_2.setGeometry(QtCore.QRect(20, 30, 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" -"")) - 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" -"")) - 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" -"")) - self.pushButton_2.setObjectName(_fromUtf8("pushButton_2")) - self.horizontalLayout_2.addWidget(self.pushButton_2) - self.horizontalLayoutWidget_3 = QtGui.QWidget(Dialog) - self.horizontalLayoutWidget_3.setGeometry(QtCore.QRect(20, 90, 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" -"")) - self.pushButton_5.setObjectName(_fromUtf8("pushButton_5")) - self.horizontalLayout_3.addWidget(self.pushButton_5) - self.txtOutput = QtGui.QTextEdit(Dialog) - self.txtOutput.setGeometry(QtCore.QRect(20, 140, 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.label_2 = QtGui.QLabel(Dialog) - self.label_2.setGeometry(QtCore.QRect(20, 0, 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")) + MainWindow.setCentralWidget(self.centralwidget) - self.retranslateUi(Dialog) - QtCore.QMetaObject.connectSlotsByName(Dialog) + self.retranslateUi(MainWindow) + QtCore.QMetaObject.connectSlotsByName(MainWindow) - def retranslateUi(self, Dialog): - Dialog.setWindowTitle(_translate("Dialog", "Dialog", None)) - self.label.setText(_translate("Dialog", "Nick list", None)) - self.listNames.setSortingEnabled(True) - self.listNames_2.setSortingEnabled(True) - self.pushButton.setText(_translate("Dialog", "Send message", None)) - self.label_3.setText(_translate("Dialog", "IP : ", None)) - self.lineEdit_4.setText(_translate("Dialog", "127.0.0.1", None)) - self.label_4.setText(_translate("Dialog", "Port :", None)) - self.lineEdit_3.setText(_translate("Dialog", "2222", None)) - self.label_5.setText(_translate("Dialog", "Pseudo :", None)) - self.lineEdit_2.setText(_translate("Dialog", "anonymous", None)) - self.pushButton_6.setText(_translate("Dialog", "Change pseudo", None)) - self.pushButton_3.setText(_translate("Dialog", "Disconnect", None)) - self.pushButton_2.setText(_translate("Dialog", "Connect", None)) - self.pushButton_5.setText(_translate("Dialog", "Away From Keyboard", None)) - self.txtOutput.setHtml(_translate("Dialog", "\n" + def retranslateUi(self, MainWindow): + MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow", None)) + self.txtOutput.setHtml(_translate("MainWindow", "\n" "\n" "


", None)) - self.label_2.setText(_translate("Dialog", "Welcome to DNC", 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) diff --git a/client/view/main.ui b/client/view/main.ui new file mode 100644 index 0000000..b1cf410 --- /dev/null +++ b/client/view/main.ui @@ -0,0 +1,460 @@ + + + MainWindow + + + + 0 + 0 + 800 + 567 + + + + + 800 + 567 + + + + MainWindow + + + + + + 10 + 150 + 561 + 361 + + + + + 400 + 0 + + + + + Arial + 14 + false + + + + Qt::NoFocus + + + false + + + position: relative; + border-radius: 2px; + font-size: 0.9em; +background-color: #FAFAFA; + color: #646464; + + + QFrame::NoFrame + + + Qt::ScrollBarAsNeeded + + + <!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> + + + Qt::TextBrowserInteraction + + + + + + 10 + 40 + 781 + 51 + + + + + + + IP : + + + + + + + border: solid 1px #ccc; + font-size:15px; + background-color:rgb(255, 255, 255); + + + + + + 127.0.0.1 + + + + + + + Port : + + + + + + + border: solid 1px #ccc; + font-size:15px; + background-color:rgb(255, 255, 255); + + + 2222 + + + + + + + Pseudo : + + + + + + + border: solid 1px #ccc; + font-size:15px; + background-color:rgb(255, 255, 255); + + + anonymous + + + + + + + + vertical-align: top; + color: white; + text-align: center; + background: #3498db; + border: 0; + border-bottom: 2px solid #2a8bcc; + padding: 2px 10px 2px 10px; + + + + Change pseudo + + + + + + + + vertical-align: top; + color: white; + text-align: center; + background: #3498db; + border: 0; + border-bottom: 2px solid #2a8bcc; + padding: 2px 10px 2px 10px; + + + Disconnect + + + + + + + + vertical-align: top; + color: white; + text-align: center; + background: #3498db; + border: 0; + border-bottom: 2px solid #2a8bcc; + padding: 2px 10px 2px 10px; + + + Connect + + + + + + + + + 10 + 10 + 171 + 31 + + + + + 16 + 75 + true + + + + Welcome to DNC + + + + + + 10 + 520 + 781 + 41 + + + + + + + border: solid 1px #ccc; + font-size:20px; + background-color:rgb(255, 255, 255); + + + + + + + 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; + +} + + + Qt::ImhNone + + + Send message + + + false + + + false + + + + + + + + + 10 + 100 + 561 + 40 + + + + + + + + vertical-align: top; + color: white; + text-align: center; + background: #3498db; + border: 0; + border-bottom: 2px solid #2a8bcc; + padding: 2px 10px 2px 10px; + + + Away From Keyboard + + + + + + + + + 590 + 100 + 201 + 411 + + + + + + + + 16 + 75 + true + + + + Nick list + + + + + + + + 50 + 0 + + + + + 200 + 16777215 + + + + + 0 + 0 + + + + + Cantarell + 14 + 75 + false + true + false + PreferAntialias + + + + Qt::NoFocus + + + false + + + + position: relative; + border-radius: 2px; + font-size: 0.9em; +background-color: #DEDEDE; + color: #646464; + + + QFrame::NoFrame + + + QFrame::Sunken + + + 1 + + + Qt::ScrollBarAlwaysOff + + + true + + + + + + + + 50 + 0 + + + + + 200 + 16777215 + + + + + 0 + 0 + + + + + Cantarell + 14 + 50 + false + false + true + PreferAntialias + + + + Qt::NoFocus + + + false + + + position: relative; + border-radius: 2px; + font-size: 0.9em; +background-color: #DEDEDE; + color: #646464; + + + QFrame::NoFrame + + + QFrame::Sunken + + + 1 + + + Qt::ScrollBarAlwaysOff + + + true + + + + + + + + + + diff --git a/client/view/mainWindow.ui b/client/view/mainWindow.ui deleted file mode 100755 index 5b608f5..0000000 --- a/client/view/mainWindow.ui +++ /dev/null @@ -1,479 +0,0 @@ - - - Dialog - - - true - - - - 0 - 0 - 827 - 558 - - - - - 827 - 558 - - - - Dialog - - - - ../../../../../../../../../../Images/Homer-Simpson-homer-simpson-3065329-800-600.jpg../../../../../../../../../../Images/Homer-Simpson-homer-simpson-3065329-800-600.jpg - - - background-color: #EFEFEF - - - false - - - false - - - - - 600 - 90 - 201 - 411 - - - - - - - - 16 - 75 - true - - - - Nick list - - - - - - - - 50 - 0 - - - - - 200 - 16777215 - - - - - 0 - 0 - - - - - Cantarell - 14 - 75 - false - true - false - PreferAntialias - - - - Qt::NoFocus - - - false - - - - position: relative; - border-radius: 2px; - font-size: 0.9em; -background-color: #DEDEDE; - color: #646464; - - - QFrame::NoFrame - - - QFrame::Sunken - - - 1 - - - Qt::ScrollBarAlwaysOff - - - true - - - - - - - - 50 - 0 - - - - - 200 - 16777215 - - - - - 0 - 0 - - - - - Cantarell - 14 - 50 - false - false - true - PreferAntialias - - - - Qt::NoFocus - - - false - - - position: relative; - border-radius: 2px; - font-size: 0.9em; -background-color: #DEDEDE; - color: #646464; - - - QFrame::NoFrame - - - QFrame::Sunken - - - 1 - - - Qt::ScrollBarAlwaysOff - - - true - - - - - - - - - 20 - 510 - 781 - 41 - - - - - - - border: solid 1px #ccc; - font-size:20px; - background-color:rgb(255, 255, 255); - - - - - - - QPushButton { - vertical-align: top; - color: white; - text-align: center; - background: #3498db; - border: 0; - 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; - -} - - - Qt::ImhNone - - - Send message - - - false - - - false - - - - - - - - - 20 - 30 - 781 - 51 - - - - - - - IP : - - - - - - - border: solid 1px #ccc; - font-size:15px; - background-color:rgb(255, 255, 255); - - - - - - 127.0.0.1 - - - - - - - Port : - - - - - - - border: solid 1px #ccc; - font-size:15px; - background-color:rgb(255, 255, 255); - - - 2222 - - - - - - - Pseudo : - - - - - - - border: solid 1px #ccc; - font-size:15px; - background-color:rgb(255, 255, 255); - - - anonymous - - - - - - - - vertical-align: top; - color: white; - text-align: center; - background: #3498db; - border: 0; - border-bottom: 2px solid #2a8bcc; - - - - Change pseudo - - - - - - - - vertical-align: top; - color: white; - text-align: center; - background: #3498db; - border: 0; - border-bottom: 2px solid #2a8bcc; - - - - Disconnect - - - - - - - - vertical-align: top; - color: white; - text-align: center; - background: #3498db; - border: 0; - border-bottom: 2px solid #2a8bcc; - - - - Connect - - - - - - - - - 20 - 90 - 561 - 40 - - - - - - - - vertical-align: top; - color: white; - text-align: center; - background: #3498db; - border: 0; - border-bottom: 2px solid #2a8bcc; - - - - Away From Keyboard - - - - - - - - - 20 - 140 - 561 - 361 - - - - - 400 - 0 - - - - - Arial - 14 - false - - - - Qt::NoFocus - - - false - - - position: relative; - border-radius: 2px; - font-size: 0.9em; -background-color: #FAFAFA; - color: #646464; - - - QFrame::NoFrame - - - Qt::ScrollBarAsNeeded - - - <!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> - - - Qt::TextBrowserInteraction - - - - - - 20 - 0 - 171 - 31 - - - - - 16 - 75 - true - - - - Welcome to DNC - - - verticalLayoutWidget - horizontalLayoutWidget - horizontalLayoutWidget_2 - horizontalLayoutWidget_3 - txtOutput - label_2 - listNames - - - - diff --git a/client/view/start.py b/client/view/start.py index 277825b..23b7a2d 100755 --- a/client/view/start.py +++ b/client/view/start.py @@ -1,4 +1,4 @@ -from mainWindow import Ui_Dialog +from main import Ui_MainWindow from PyQt4 import QtGui, QtCore from PySide.QtCore import * from PySide.QtGui import * @@ -56,18 +56,35 @@ class privateMessage () : self.ui = Ui_Dialog2() self.ui.setupUi(self.g) self.g.show() - old = start() + #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.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.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 accept(self): self.cmAcc = "/acceptpm "+self.pmPerson try: @@ -105,6 +122,7 @@ class privateMessage () : def ShowMessageErreur(self, txt): self.message_buffer2 += '
'+ self.htmlToText(txt) +' ' + def send(self): self.cmdP = self.ui.lineEdit.text() if self.cmdP != "": @@ -141,8 +159,12 @@ class privateMessage () : if txt.split(" ")[0] == "SUCC_PRIVATE_DISCUSSION_ACCEPTED": - self.message_buffer2 += '
Chalange Accepted ! ' - + self.message_buffer2 += '
Chalange Accepted ! ' + + if txt.split(" ")[0] == "SUCC_PRIVATE_DISCUSSION_OK": + self.message_buffer2 += '
Private discussion with '+txt.split(" ")[1]+' accepted ! ' + + if txt.split(" ")[0] == "NEW_PM" : self.message_buffer2 += '
' + self.getTimeStamp() + ' < '+ self.pmPerso +' > ' + self.htmlToText(' '.join(txt.split(" ")[2:])) + '' @@ -151,7 +173,7 @@ class privateMessage () : sb = self.ui.txtOutput.verticalScrollBar() sb.setValue(sb.maximum()) -class start(QtGui.QDialog): +class start(QtGui.QMainWindow): def __init__(self): super(start, self).__init__() self.queueMsg= [] @@ -223,6 +245,13 @@ class start(QtGui.QDialog): if txt.split(" ")[0] == "SUCC_PRIVATE_DISCUSSION_ACCEPTED": self.message_buffer += '
PRIVATE DISCUSSION ? challenge accepted ! ' + self.private2.ShowMessageAsTextPm("SUCC_PRIVATE_DISCUSSION_ACCEPTED") + + if txt.split(" ")[0] == "SUCC_PRIVATE_DISCUSSION_OK": + self.message_buffer += '
PRIVATE DISCUSSION WITH '+txt.split(" ")[1]+' ? challenge accepted ! ' + self.private2.ShowMessageAsTextPm(txt) + + if txt.split(" ")[0] == "SUCC_INVITED" : self.ShowMessageOK("invitation requested") @@ -245,7 +274,7 @@ class start(QtGui.QDialog): if txt.split(" ")[0] == "SUCCESSFUL_LOGOUT" : - self.ShowMessageOK("Sucessful logout !") + self.ShowMessageOK("You have logged out of the DNC !") self.ui.listNames.clear() self.ui.listNames_2.clear() @@ -294,7 +323,11 @@ class start(QtGui.QDialog): #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) : @@ -310,10 +343,10 @@ class start(QtGui.QDialog): if txt.split(" ")[0] == "NEW_MSG" : - self.message_buffer += '
' + self.getTimeStamp() + ' < '+txt.split(" ")[1] +' > ' + self.htmlToText(' '.join(txt.split(" ")[2:])) + '' + self.message_buffer += '
' + self.getTimeStamp() + ' < '+txt.split(" ")[1] +' > ' + self.htmlToText(' '.join(txt.split(" ")[2:])) + '' if txt == "SUCC_MESSAGE_SENDED" : - self.message_buffer += '
' + self.getTimeStamp() + ' < '+ self.pseudo +' > ' + self.htmlToText(self.cmd) + '' + self.message_buffer += '
' + self.getTimeStamp() + ' < '+ self.pseudo +' > ' + self.htmlToText(self.cmd) + '' def ShowMessageHasJoin (self, txt) : @@ -478,7 +511,7 @@ class start(QtGui.QDialog): def createWidgets(self): - self.ui = Ui_Dialog() + self.ui = Ui_MainWindow() self.ui.setupUi(self) ano = "anonymous" + ''.join(str(random.randint(1,9)) for _ in range(2))