diff --git a/TODO b/TODO index be2733d..dd573ce 100644 --- a/TODO +++ b/TODO @@ -3,6 +3,7 @@ Bugs: * X and _ buttons move around all crazy like Features: +* Manual reconnect * help menu -- about and forum * copy quirks between profiles? * shared buddy lists - changes to the buddy list should refresh it? diff --git a/irc.py b/irc.py index 2d6d6a7..f3e87b5 100644 --- a/irc.py +++ b/irc.py @@ -24,6 +24,8 @@ class PesterIRC(QtCore.QObject): self.cli.command_handler.mainwindow = self.mainwindow self.conn = self.cli.connect() self.brokenConnection = False + def closeConnection(self): + self.cli.close() def setConnectionBroken(self): self.brokenConnection = True @QtCore.pyqtSlot(PesterProfile) @@ -155,6 +157,9 @@ class PesterIRC(QtCore.QObject): helpers.mode(self.cli, c, m, cmd) except socket.error: self.setConnectionBroken() + @QtCore.pyqtSlot() + def reconnectIRC(self): + self.setConnectionBroken() def updateIRC(self): self.conn.next() diff --git a/irc.pyc b/irc.pyc index 15a2525..5a9a877 100644 Binary files a/irc.pyc and b/irc.pyc differ diff --git a/oyoyo/client.py b/oyoyo/client.py index b2d5975..6c5fff2 100644 --- a/oyoyo/client.py +++ b/oyoyo/client.py @@ -185,7 +185,8 @@ class IRCClient: if self.socket: logging.info('closing socket') self.socket.close() - + def close(self): + self.socket.close() class IRCApp: """ This class manages several IRCClient instances without the use of threads. diff --git a/oyoyo/client.pyc b/oyoyo/client.pyc index 88704aa..d3a6ea9 100644 Binary files a/oyoyo/client.pyc and b/oyoyo/client.pyc differ diff --git a/parsetools.pyc b/parsetools.pyc index 68bb11c..97122b3 100644 Binary files a/parsetools.pyc and b/parsetools.pyc differ diff --git a/pesterchum.js b/pesterchum.js index 57d8f08..aaa058c 100644 --- a/pesterchum.js +++ b/pesterchum.js @@ -1 +1 @@ -{"tabs": true, "soundon": true, "server": "irc.tymoon.eu", "chums": ["unknownTraveler", "tentacleTherapist", "vaginalEngineer", "mechanicalSpectacle", "carcinoGeneticist", "schlagzeugGator", "gamblingGenocider", "gardenGnostic", "superGhost", "centaursTesticle", "arachnidsGrip", "grimAuxiliatrix", "remoteBloodbath", "nitroZealist", "greenZephyr", "arsenicCatnip", "adiosToreador", "cuttlefishCuller", "rageInducer", "gallowsCalibrator", "caligulasAquarium", "terminallyCapricious", "illuminatedWax", "aquaMarinist", "elegantDiversion", "moirailBunp", "uroborosUnbound", "androidTechnician", "midnightSparrow", "apocalypseArisen", "anguillaNuntia", "oilslickOrchid", "confusedTransient", "pretentiousFantasia", "aquaticMarinist", "lyricalKeraunoscopic", "counterRealist", "ectoBiologist", "percipientPedestrian", "asceticClinician", "doctectiveMiracles", "noSense", "obliviousCrafter"], "defaultprofile": "ghostDunk", "block": []} \ No newline at end of file +{"tabs": true, "soundon": true, "server": "irc.tymoon.eu", "chums": ["unknownTraveler", "tentacleTherapist", "vaginalEngineer", "mechanicalSpectacle", "carcinoGeneticist", "schlagzeugGator", "gamblingGenocider", "gardenGnostic", "superGhost", "centaursTesticle", "arachnidsGrip", "grimAuxiliatrix", "remoteBloodbath", "nitroZealist", "greenZephyr", "arsenicCatnip", "adiosToreador", "cuttlefishCuller", "rageInducer", "gallowsCalibrator", "caligulasAquarium", "terminallyCapricious", "illuminatedWax", "aquaMarinist", "elegantDiversion", "moirailBunp", "uroborosUnbound", "androidTechnician", "midnightSparrow", "apocalypseArisen", "anguillaNuntia", "oilslickOrchid", "confusedTransient", "pretentiousFantasia", "aquaticMarinist", "lyricalKeraunoscopic", "counterRealist", "ectoBiologist", "percipientPedestrian", "asceticClinician", "doctectiveMiracles", "noSense", "obliviousCrafter", "ircMonster"], "defaultprofile": "ghostDunk", "block": []} \ No newline at end of file diff --git a/pesterchum.py b/pesterchum.py index a3aaf09..8572a33 100644 --- a/pesterchum.py +++ b/pesterchum.py @@ -60,7 +60,7 @@ class PesterLog(object): self.convos = {} def log(self, handle, msg): bbcodemsg = convertTags(msg, "bbcode") - html = convertTags(msg, "html") + html = convertTags(msg, "html")+"
" msg = convertTags(msg, "text") modes = {"bbcode": bbcodemsg, "html": html, "text": msg} if not self.convos.has_key(handle): @@ -694,6 +694,9 @@ class PesterWindow(MovingWindow): self.idleaction.setCheckable(True) self.connect(self.idleaction, QtCore.SIGNAL('toggled(bool)'), self, QtCore.SLOT('toggleIdle(bool)')) + self.reconnectAction = QtGui.QAction(self.theme["main/menus/client/reconnect"], self) + self.connect(self.reconnectAction, QtCore.SIGNAL('triggered()'), + self, QtCore.SIGNAL('reconnectIRC()')) self.menu = QtGui.QMenuBar(self) @@ -704,6 +707,7 @@ class PesterWindow(MovingWindow): filemenu.addAction(userlistaction) filemenu.addAction(self.idleaction) filemenu.addAction(self.importaction) + filemenu.addAction(self.reconnectAction) filemenu.addAction(exitaction) changetheme = QtGui.QAction(self.theme["main/menus/profile/theme"], self) @@ -1000,6 +1004,7 @@ class PesterWindow(MovingWindow): self.memoaction.setText(theme["main/menus/client/memos"]) self.importaction.setText(theme["main/menus/client/import"]) self.idleaction.setText(theme["main/menus/client/idle"]) + self.reconnectAction.setText(theme["main/menus/client/reconnect"]) self.filemenu.setTitle(theme["main/menus/client/_name"]) self.changetheme.setText(theme["main/menus/profile/theme"]) self.changequirks.setText(theme["main/menus/profile/quirks"]) @@ -1642,6 +1647,7 @@ class PesterWindow(MovingWindow): leftChannel = QtCore.pyqtSignal(QtCore.QString) setChannelMode = QtCore.pyqtSignal(QtCore.QString, QtCore.QString, QtCore.QString) closeSignal = QtCore.pyqtSignal() + reconnectIRC = QtCore.pyqtSignal() class IRCThread(QtCore.QThread): def __init__(self, ircobj): @@ -1652,11 +1658,13 @@ class IRCThread(QtCore.QThread): irc.IRCConnect() while 1: if irc.brokenConnection: - self.exit(1) + self.finished.emit() + irc.closeConnection() + self.terminate() try: irc.updateIRC() except socket.error: - self.exit(1) + irc.setConnectionBroken() class PesterTray(QtGui.QSystemTrayIcon): def __init__(self, icon, mainwindow, parent): @@ -1790,6 +1798,10 @@ class MainProgram(QtCore.QObject): QtCore.SIGNAL('setChannelMode(QString, QString, QString)'), irc, QtCore.SLOT('setChannelMode(QString, QString, QString)')) + irc.connect(widget, + QtCore.SIGNAL('reconnectIRC()'), + irc, + QtCore.SLOT('reconnectIRC()')) # IRC --> Main window irc.connect(irc, QtCore.SIGNAL('connected()'), diff --git a/themes/pesterchum/style.js b/themes/pesterchum/style.js index 2f4fbe6..df8d68f 100644 --- a/themes/pesterchum/style.js +++ b/themes/pesterchum/style.js @@ -23,6 +23,7 @@ "userlist": "USERLIST", "import": "IMPORT", "idle": "IDLE", + "reconnect": "RECONNECT", "exit": "EXIT"}, "profile": {"_name": "PROFILE", "switch": "SWITCH",