From 7e2cd62752ddc416bc975de0b8cd9d9b14bc1e1e Mon Sep 17 00:00:00 2001 From: Stephen Dranger Date: Fri, 18 Feb 2011 02:31:04 -0600 Subject: [PATCH] alpha 5 --- TODO | 2 -- memos.py | 5 +++++ pesterchum.py | 16 ++++++++-------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/TODO b/TODO index a1b27fc..72a7929 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,5 @@ Bugs: * heartbeat -- ping IRC occasionally so we pick up on send errors -* need memo limit on time -* color swatch text doesnt disappear * X and _ buttons move around all crazy like Features: diff --git a/memos.py b/memos.py index 1821d87..1b59e61 100644 --- a/memos.py +++ b/memos.py @@ -53,6 +53,11 @@ def txt2delta(txt): timed = timedelta(0, h*3600+m*60) except ValueError: timed = timedelta(0) + except OverflowError: + if sign < 0: + return timedelta(min) + else: + return timedelta(max) return sign*timed def pcfGrammar(td): diff --git a/pesterchum.py b/pesterchum.py index 129267a..99a590d 100644 --- a/pesterchum.py +++ b/pesterchum.py @@ -1680,12 +1680,12 @@ class IRCThread(QtCore.QThread): irc.setConnectionBroken() else: irc.closeConnection() - self.failedIRC.emit() + self.failedIRC.emit(str(se)) except StopIteration: pass restartIRC = QtCore.pyqtSignal() - failedIRC = QtCore.pyqtSignal() + failedIRC = QtCore.pyqtSignal(QtCore.QString) class PesterTray(QtGui.QSystemTrayIcon): def __init__(self, icon, mainwindow, parent): @@ -1757,8 +1757,8 @@ class MainProgram(QtCore.QObject): self.ircapp = IRCThread(self.irc) self.connect(self.ircapp, QtCore.SIGNAL('restartIRC()'), self, QtCore.SLOT('restartIRC()')) - self.connect(self.ircapp, QtCore.SIGNAL('failedIRC()'), - self, QtCore.SLOT('failedIRC()')) + self.connect(self.ircapp, QtCore.SIGNAL('failedIRC(QString)'), + self, QtCore.SLOT('failedIRC(QString)')) def connectWidgets(self, irc, widget): irc.connect(widget, QtCore.SIGNAL('sendMessage(QString, QString)'), @@ -1890,13 +1890,13 @@ class MainProgram(QtCore.QObject): status = self.widget.loadingscreen.exec_() if status == QtGui.QDialog.Rejected: sys.exit(0) - @QtCore.pyqtSlot() - def failedIRC(self): + @QtCore.pyqtSlot(QtCore.QString) + def failedIRC(self, reason): self.widget.show() self.widget.activateWindow() if not self.widget.loadingscreen: self.widget.loadingscreen = LoadingScreen(self.widget) - self.widget.loadingscreen.loadinglabel.setText("F41L3D") + self.widget.loadingscreen.loadinglabel.setText("F41L3D: %s" % (reason)) self.connect(self.widget.loadingscreen, QtCore.SIGNAL('rejected()'), self.widget, QtCore.SLOT('close()')) self.connect(self.widget.loadingscreen, QtCore.SIGNAL('tryAgain()'), @@ -1905,7 +1905,7 @@ class MainProgram(QtCore.QObject): if status == QtGui.QDialog.Rejected: sys.exit(0) else: - self.widget.loadingscreen.loadinglabel.setText("F41L3D") + self.widget.loadingscreen.loadinglabel.setText("F41L3D: %s" % (reason)) def run(self): self.ircapp.start()