Set IRC away when idle

This commit is contained in:
Kiooeht 2011-06-28 16:26:13 -07:00
parent e5040f9b12
commit cc06be351e
4 changed files with 18 additions and 2 deletions

View file

@ -51,6 +51,7 @@ CHANGELOG
* Ping server if no ping from server to test connection - Kiooeht [evacipatedBox] (Idea: Lexi [lexicalNuance])
* MSPA comic update notifier - Kiooeht [evacipatedBox]
* Volume control - Kiooeht [evacipatedBox]
* Set IRC away on idle - Kiooeht [evacipatedBox]
* Bug fixes
* Logviewer updates - Kiooeht [evacipatedBox]
* Memo scrollbar thing - Kiooeht [evacipatedBox]

View file

@ -17,6 +17,7 @@ Features
* Remote quirk disable
* Tab completion of two letter names
* Compress exit dumps into one line (eg. FTC, CTC, PTC1-12 ceased responding to memo)
* Customizable name alerts
Bugs
----
@ -29,6 +30,7 @@ Bugs
* right clicking an offline chum and choosing remove asks you why you're reporting someone, and if you hit cancel the menus stop working
* Closing a timeclone doesn't actually cease for everyone else
* Alt characters break quirks
* +q(~) and +a(&) do weird things
Windows Bugs
------------

10
irc.py
View file

@ -277,6 +277,16 @@ class PesterIRC(QtCore.QThread):
except socket.error:
self.setConnectionBroken()
@QtCore.pyqtSlot(bool)
def setAway(self, away=True):
try:
if away:
self.cli.send("AWAY Idle")
else:
self.cli.send("AWAY")
except socket.error:
self.setConnectionBroken()
moodUpdated = QtCore.pyqtSignal(QtCore.QString, Mood)
colorUpdated = QtCore.pyqtSignal(QtCore.QString, QtGui.QColor)
messageReceived = QtCore.pyqtSignal(QtCore.QString, QtCore.QString)

View file

@ -2318,6 +2318,7 @@ class PesterWindow(MovingWindow):
@QtCore.pyqtSlot(bool)
def toggleIdle(self, idle):
if idle:
self.setAway.emit(True)
sysColor = QtGui.QColor(self.theme["convo/systemMsgColor"])
verb = self.theme["convo/text/idle"]
for (h, convo) in self.convos.iteritems():
@ -2327,6 +2328,7 @@ class PesterWindow(MovingWindow):
self.chatlog.log(h, msg)
self.sendMessage.emit("PESTERCHUM:IDLE", h)
else:
self.setAway.emit(False)
self.idletime = 0
@QtCore.pyqtSlot()
def checkIdle(self):
@ -2943,6 +2945,7 @@ class PesterWindow(MovingWindow):
reconnectIRC = QtCore.pyqtSignal()
gainAttention = QtCore.pyqtSignal(QtGui.QWidget)
pingServer = QtCore.pyqtSignal()
setAway = QtCore.pyqtSignal(bool)
class PesterTray(QtGui.QSystemTrayIcon):
def __init__(self, icon, mainwindow, parent):
@ -3101,8 +3104,8 @@ class MainProgram(QtCore.QObject):
'channelNames(QString)'),
('inviteChum(QString, QString)',
'inviteChum(QString, QString)'),
('pingServer()',
'pingServer()'),
('pingServer()', 'pingServer()'),
('setAway(bool)', 'setAway(bool)'),
('reconnectIRC()', 'reconnectIRC()')
]
# IRC --> Main window