Update to randomEncounter interface: set idle/unidle

This commit is contained in:
Kiooeht 2012-01-20 12:46:44 -08:00
parent 5d46a91d98
commit 2f3cf9d703
3 changed files with 12 additions and 0 deletions

View file

@ -17,6 +17,7 @@ CHANGELOG
* Makefile for Linux installing - Kiooeht [evacipatedBox]
* Recognize www. as link - Kiooeht [evacipatedBox]
* Pester menu option to just pester a handle - Kiooeht [evacipatedBox]
* Update to randomEncounter interface - Kiooeht [evacipatedBox]
* Bug fixes
* Don't require pygame (it's kind of optional, you just don't get sound) - Kiooeht [evacipatedBox]
* Allow add chum dialog to open after adding an existing chum - Kiooeht [evacipatedBox]

View file

@ -1952,6 +1952,7 @@ class PesterWindow(MovingWindow):
def toggleIdle(self, idle):
if idle:
self.setAway.emit(True)
self.randhandler.setIdle(True)
sysColor = QtGui.QColor(self.theme["convo/systemMsgColor"])
verb = self.theme["convo/text/idle"]
for (h, convo) in self.convos.iteritems():
@ -1962,6 +1963,7 @@ class PesterWindow(MovingWindow):
self.sendMessage.emit("PESTERCHUM:IDLE", h)
else:
self.setAway.emit(False)
self.randhandler.setIdle(False)
self.idletime = 0
@QtCore.pyqtSlot()
def checkIdle(self):

View file

@ -23,6 +23,12 @@ class RandomHandler(QtCore.QObject):
self.queue.append(code)
self.mainwindow.sendNotice.emit(code, self.randNick)
def setIdle(self, i):
if i: code = "~"
else: code = "*"
self.queue.append(code)
self.mainwindow.sendNotice.emit(code, self.randNick)
@QtCore.pyqtSlot()
def getEncounter(self):
self.queue.append("!")
@ -45,6 +51,9 @@ class RandomHandler(QtCore.QObject):
self.mainwindow.userprofile.setRandom(True)
else:
self.mainwindow.userprofile.setRandom(False)
elif code in ["~","*"]:
if l[1][0] == "k":
pass
elif code == "!":
if l[1] == "x":
from PyQt4 import QtGui