bugfixes
This commit is contained in:
parent
5bae56ddbd
commit
f50c617d6d
13 changed files with 73 additions and 14 deletions
BIN
convo.pyc
BIN
convo.pyc
Binary file not shown.
7
irc.py
7
irc.py
|
@ -24,10 +24,14 @@ class PesterIRC(QtCore.QObject):
|
||||||
self.cli.command_handler.mainwindow = self.mainwindow
|
self.cli.command_handler.mainwindow = self.mainwindow
|
||||||
self.conn = self.cli.connect()
|
self.conn = self.cli.connect()
|
||||||
self.brokenConnection = False
|
self.brokenConnection = False
|
||||||
|
self.connectedIRC = False
|
||||||
def closeConnection(self):
|
def closeConnection(self):
|
||||||
self.cli.close()
|
self.cli.close()
|
||||||
def setConnectionBroken(self, broken=True):
|
def setConnectionBroken(self, broken=True):
|
||||||
self.brokenConnection = True
|
self.brokenConnection = True
|
||||||
|
def setConnected(self):
|
||||||
|
self.connectedIRC = True
|
||||||
|
self.connected.emit()
|
||||||
@QtCore.pyqtSlot(PesterProfile)
|
@QtCore.pyqtSlot(PesterProfile)
|
||||||
def getMood(self, *chums):
|
def getMood(self, *chums):
|
||||||
self.cli.command_handler.getMood(*chums)
|
self.cli.command_handler.getMood(*chums)
|
||||||
|
@ -178,6 +182,7 @@ class PesterIRC(QtCore.QObject):
|
||||||
|
|
||||||
class PesterHandler(DefaultCommandHandler):
|
class PesterHandler(DefaultCommandHandler):
|
||||||
def privmsg(self, nick, chan, msg):
|
def privmsg(self, nick, chan, msg):
|
||||||
|
msg = msg.decode("utf-8")
|
||||||
# display msg, do other stuff
|
# display msg, do other stuff
|
||||||
if len(msg) == 0:
|
if len(msg) == 0:
|
||||||
return
|
return
|
||||||
|
@ -223,7 +228,7 @@ class PesterHandler(DefaultCommandHandler):
|
||||||
|
|
||||||
|
|
||||||
def welcome(self, server, nick, msg):
|
def welcome(self, server, nick, msg):
|
||||||
self.parent.connected.emit()
|
self.parent.setConnected()
|
||||||
helpers.join(self.client, "#pesterchum")
|
helpers.join(self.client, "#pesterchum")
|
||||||
mychumhandle = self.mainwindow.profile().handle
|
mychumhandle = self.mainwindow.profile().handle
|
||||||
mymood = self.mainwindow.profile().mood.value()
|
mymood = self.mainwindow.profile().mood.value()
|
||||||
|
|
BIN
irc.pyc
BIN
irc.pyc
Binary file not shown.
File diff suppressed because one or more lines are too long
14
menus.py
14
menus.py
|
@ -636,16 +636,24 @@ class LoadingScreen(QtGui.QDialog):
|
||||||
self.mainwindow = parent
|
self.mainwindow = parent
|
||||||
self.setStyleSheet(self.mainwindow.theme["main/defaultwindow/style"])
|
self.setStyleSheet(self.mainwindow.theme["main/defaultwindow/style"])
|
||||||
|
|
||||||
self.loadinglabel = QtGui.QLabel("LO4D1NG")
|
self.loadinglabel = QtGui.QLabel("CONN3CT1NG", self)
|
||||||
self.cancel = QtGui.QPushButton("QU1T >:?")
|
self.cancel = QtGui.QPushButton("QU1T >:?", self)
|
||||||
|
self.ok = QtGui.QPushButton("R3CONN3CT >:]", self)
|
||||||
self.connect(self.cancel, QtCore.SIGNAL('clicked()'),
|
self.connect(self.cancel, QtCore.SIGNAL('clicked()'),
|
||||||
self, QtCore.SLOT('reject()'))
|
self, QtCore.SLOT('reject()'))
|
||||||
|
self.connect(self.ok, QtCore.SIGNAL('clicked()'),
|
||||||
|
self, QtCore.SIGNAL('tryAgain()'))
|
||||||
|
|
||||||
self.layout = QtGui.QVBoxLayout()
|
self.layout = QtGui.QVBoxLayout()
|
||||||
self.layout.addWidget(self.loadinglabel)
|
self.layout.addWidget(self.loadinglabel)
|
||||||
self.layout.addWidget(self.cancel)
|
layout_1 = QtGui.QHBoxLayout()
|
||||||
|
layout_1.addWidget(self.cancel)
|
||||||
|
layout_1.addWidget(self.ok)
|
||||||
|
self.layout.addLayout(layout_1)
|
||||||
self.setLayout(self.layout)
|
self.setLayout(self.layout)
|
||||||
|
|
||||||
|
tryAgain = QtCore.pyqtSignal()
|
||||||
|
|
||||||
class AboutPesterchum(QtGui.QMessageBox):
|
class AboutPesterchum(QtGui.QMessageBox):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
QtGui.QMessageBox.__init__(self, parent)
|
QtGui.QMessageBox.__init__(self, parent)
|
||||||
|
|
BIN
menus.pyc
BIN
menus.pyc
Binary file not shown.
|
@ -129,14 +129,13 @@ class IRCClient:
|
||||||
self.socket.send(msg + bytes("\r\n", "ascii"))
|
self.socket.send(msg + bytes("\r\n", "ascii"))
|
||||||
except socket.error, se:
|
except socket.error, se:
|
||||||
try: # a little dance of compatibility to get the errno
|
try: # a little dance of compatibility to get the errno
|
||||||
errno = e.errno
|
errno = se.errno
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
errno = e[0]
|
errno = se[0]
|
||||||
if not self.blocking and errno == 11:
|
if not self.blocking and errno == 11:
|
||||||
print "O WELLS"
|
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
raise e
|
raise se
|
||||||
|
|
||||||
def connect(self):
|
def connect(self):
|
||||||
""" initiates the connection to the server set in self.host:self.port
|
""" initiates the connection to the server set in self.host:self.port
|
||||||
|
@ -192,7 +191,13 @@ class IRCClient:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
yield True
|
yield True
|
||||||
finally:
|
except socket.error, se:
|
||||||
|
if self.socket:
|
||||||
|
logging.info('closing socket')
|
||||||
|
self.socket.close()
|
||||||
|
print se
|
||||||
|
raise se
|
||||||
|
else:
|
||||||
if self.socket:
|
if self.socket:
|
||||||
logging.info('closing socket')
|
logging.info('closing socket')
|
||||||
self.socket.close()
|
self.socket.close()
|
||||||
|
|
BIN
oyoyo/client.pyc
BIN
oyoyo/client.pyc
Binary file not shown.
Binary file not shown.
BIN
parsetools.pyc
BIN
parsetools.pyc
Binary file not shown.
|
@ -3,7 +3,7 @@
|
||||||
Name "PESTERCHUM3.14a"
|
Name "PESTERCHUM3.14a"
|
||||||
|
|
||||||
; The file to write
|
; The file to write
|
||||||
OutFile "pesterchum3.14a.2update.exe"
|
OutFile "pesterchum3.14a.3update.exe"
|
||||||
|
|
||||||
RequestExecutionLevel admin
|
RequestExecutionLevel admin
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Name "PESTERCHUM3.14a"
|
Name "PESTERCHUM3.14a"
|
||||||
|
|
||||||
; The file to write
|
; The file to write
|
||||||
OutFile "pesterchum3.14a.1.exe"
|
OutFile "pesterchum3.14a.3.exe"
|
||||||
|
|
||||||
InstallDir C:\Pesterchum
|
InstallDir C:\Pesterchum
|
||||||
|
|
||||||
|
|
|
@ -1675,10 +1675,17 @@ class IRCThread(QtCore.QThread):
|
||||||
irc.IRCConnect()
|
irc.IRCConnect()
|
||||||
try:
|
try:
|
||||||
irc.updateIRC()
|
irc.updateIRC()
|
||||||
except socket.error:
|
except socket.error, se:
|
||||||
irc.setConnectionBroken()
|
if irc.connectedIRC:
|
||||||
|
irc.setConnectionBroken()
|
||||||
|
else:
|
||||||
|
irc.closeConnection()
|
||||||
|
self.failedIRC.emit()
|
||||||
|
except StopIteration:
|
||||||
|
pass
|
||||||
|
|
||||||
restartIRC = QtCore.pyqtSignal()
|
restartIRC = QtCore.pyqtSignal()
|
||||||
|
failedIRC = QtCore.pyqtSignal()
|
||||||
|
|
||||||
class PesterTray(QtGui.QSystemTrayIcon):
|
class PesterTray(QtGui.QSystemTrayIcon):
|
||||||
def __init__(self, icon, mainwindow, parent):
|
def __init__(self, icon, mainwindow, parent):
|
||||||
|
@ -1750,6 +1757,8 @@ class MainProgram(QtCore.QObject):
|
||||||
self.ircapp = IRCThread(self.irc)
|
self.ircapp = IRCThread(self.irc)
|
||||||
self.connect(self.ircapp, QtCore.SIGNAL('restartIRC()'),
|
self.connect(self.ircapp, QtCore.SIGNAL('restartIRC()'),
|
||||||
self, QtCore.SLOT('restartIRC()'))
|
self, QtCore.SLOT('restartIRC()'))
|
||||||
|
self.connect(self.ircapp, QtCore.SIGNAL('failedIRC()'),
|
||||||
|
self, QtCore.SLOT('failedIRC()'))
|
||||||
|
|
||||||
def connectWidgets(self, irc, widget):
|
def connectWidgets(self, irc, widget):
|
||||||
irc.connect(widget, QtCore.SIGNAL('sendMessage(QString, QString)'),
|
irc.connect(widget, QtCore.SIGNAL('sendMessage(QString, QString)'),
|
||||||
|
@ -1857,22 +1866,54 @@ class MainProgram(QtCore.QObject):
|
||||||
widget,
|
widget,
|
||||||
QtCore.SLOT('timeCommand(QString, QString, QString)'))
|
QtCore.SLOT('timeCommand(QString, QString, QString)'))
|
||||||
|
|
||||||
|
@QtCore.pyqtSlot()
|
||||||
|
def tryAgain(self):
|
||||||
|
self.ircapp.irc.closeConnection()
|
||||||
|
self.ircapp.irc.IRCConnect()
|
||||||
|
labeltxt = self.widget.loadingscreen.loadinglabel.text()
|
||||||
|
if labeltxt != "R3CONN3CT1NG":
|
||||||
|
self.widget.loadingscreen.loadinglabel.setText("R3CONN3CTING")
|
||||||
|
elif labeltxt[0:12] == "R3CONN3CT1NG":
|
||||||
|
i = int(labeltxt[13:])
|
||||||
|
self.widget.loadingscreen.loadinglabel.setText("R3CONN3CTING %d" (i+1))
|
||||||
|
|
||||||
@QtCore.pyqtSlot()
|
@QtCore.pyqtSlot()
|
||||||
def restartIRC(self):
|
def restartIRC(self):
|
||||||
|
# tell ppl that we're restarting
|
||||||
self.widget.show()
|
self.widget.show()
|
||||||
self.widget.activateWindow()
|
self.widget.activateWindow()
|
||||||
self.widget.loadingscreen = LoadingScreen(self.widget)
|
self.widget.loadingscreen = LoadingScreen(self.widget)
|
||||||
self.connect(self.widget.loadingscreen, QtCore.SIGNAL('rejected()'),
|
self.connect(self.widget.loadingscreen, QtCore.SIGNAL('rejected()'),
|
||||||
self.widget, QtCore.SLOT('close()'))
|
self.widget, QtCore.SLOT('close()'))
|
||||||
|
self.connect(self.widget.loadingscreen, QtCore.SIGNAL('tryAgain()'),
|
||||||
|
self, QtCore.SLOT('tryAgain()'))
|
||||||
status = self.widget.loadingscreen.exec_()
|
status = self.widget.loadingscreen.exec_()
|
||||||
if status == QtGui.QDialog.Rejected:
|
if status == QtGui.QDialog.Rejected:
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
@QtCore.pyqtSlot()
|
||||||
|
def failedIRC(self):
|
||||||
|
self.widget.show()
|
||||||
|
self.widget.activateWindow()
|
||||||
|
if not self.widget.loadingscreen:
|
||||||
|
self.widget.loadingscreen = LoadingScreen(self.widget)
|
||||||
|
self.widget.loadingscreen.loadinglabel.setText("F41L3D")
|
||||||
|
self.connect(self.widget.loadingscreen, QtCore.SIGNAL('rejected()'),
|
||||||
|
self.widget, QtCore.SLOT('close()'))
|
||||||
|
self.connect(self.widget.loadingscreen, QtCore.SIGNAL('tryAgain()'),
|
||||||
|
self, QtCore.SLOT('tryAgain()'))
|
||||||
|
status = self.widget.loadingscreen.exec_()
|
||||||
|
if status == QtGui.QDialog.Rejected:
|
||||||
|
sys.exit(0)
|
||||||
|
else:
|
||||||
|
self.widget.loadingscreen.loadinglabel.setText("F41L3D")
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.ircapp.start()
|
self.ircapp.start()
|
||||||
self.widget.loadingscreen = LoadingScreen(self.widget)
|
self.widget.loadingscreen = LoadingScreen(self.widget)
|
||||||
self.connect(self.widget.loadingscreen, QtCore.SIGNAL('rejected()'),
|
self.connect(self.widget.loadingscreen, QtCore.SIGNAL('rejected()'),
|
||||||
self.widget, QtCore.SLOT('close()'))
|
self.widget, QtCore.SLOT('close()'))
|
||||||
|
self.connect(self.widget.loadingscreen, QtCore.SIGNAL('tryAgain()'),
|
||||||
|
self, QtCore.SLOT('tryAgain()'))
|
||||||
status = self.widget.loadingscreen.exec_()
|
status = self.widget.loadingscreen.exec_()
|
||||||
if status == QtGui.QDialog.Rejected:
|
if status == QtGui.QDialog.Rejected:
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
Loading…
Reference in a new issue