:pedobear a des bonbons

This commit is contained in:
DonRenando 2015-04-09 22:35:08 +02:00
parent 5719da74fd
commit 28a4442f00

View File

@ -400,12 +400,34 @@ class start(QtGui.QMainWindow):
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)
#self.ui.listNames.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
self.ui.listNames.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
self.ui.listNames.customContextMenuRequested.connect(self.buttonAMenu)
@QtCore.pyqtSlot()
def on_buttonA_released(self):
print ('Doing Stuff when clicking on Button A')
def buttonAMenu(self, pos):
menu = QtGui.QMenu()
menu.addAction('Private discussion', lambda:self.SecondActionButtonA(self.ui.listNames.itemActivated))
menu.addAction('Send file', lambda:self.FirstActionButtonA("au revoir"))
menu.exec_(QtGui.QCursor.pos())
def FirstActionButtonA(self, txt):
print(txt)
def SecondActionButtonA(self, txt):
txt = self.ui.listNames.itemActivated.emit(self.ui.listNames.currentItem())
#print(txt)
def someMethod(self,item):
nom = item.text().replace("SUCC_INVITED","")
cmdPM = "/askpm "+nom
@ -471,9 +493,6 @@ class start(QtGui.QMainWindow):
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)