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] * Makefile for Linux installing - Kiooeht [evacipatedBox]
* Recognize www. as link - Kiooeht [evacipatedBox] * Recognize www. as link - Kiooeht [evacipatedBox]
* Pester menu option to just pester a handle - Kiooeht [evacipatedBox] * Pester menu option to just pester a handle - Kiooeht [evacipatedBox]
* Update to randomEncounter interface - Kiooeht [evacipatedBox]
* Bug fixes * Bug fixes
* Don't require pygame (it's kind of optional, you just don't get sound) - Kiooeht [evacipatedBox] * 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] * 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): def toggleIdle(self, idle):
if idle: if idle:
self.setAway.emit(True) self.setAway.emit(True)
self.randhandler.setIdle(True)
sysColor = QtGui.QColor(self.theme["convo/systemMsgColor"]) sysColor = QtGui.QColor(self.theme["convo/systemMsgColor"])
verb = self.theme["convo/text/idle"] verb = self.theme["convo/text/idle"]
for (h, convo) in self.convos.iteritems(): for (h, convo) in self.convos.iteritems():
@ -1962,6 +1963,7 @@ class PesterWindow(MovingWindow):
self.sendMessage.emit("PESTERCHUM:IDLE", h) self.sendMessage.emit("PESTERCHUM:IDLE", h)
else: else:
self.setAway.emit(False) self.setAway.emit(False)
self.randhandler.setIdle(False)
self.idletime = 0 self.idletime = 0
@QtCore.pyqtSlot() @QtCore.pyqtSlot()
def checkIdle(self): def checkIdle(self):

View file

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