This commit is contained in:
Stephen Dranger 2011-02-14 17:54:44 -06:00
parent db64c53bfb
commit 666c2b88c0
7 changed files with 29 additions and 20 deletions

1
TODO
View file

@ -3,7 +3,6 @@ Bugs:
* X and _ buttons move around all crazy like * X and _ buttons move around all crazy like
Features: Features:
* Manual reconnect
* help menu -- about and forum * help menu -- about and forum
* copy quirks between profiles? * copy quirks between profiles?
* shared buddy lists - changes to the buddy list should refresh it? * shared buddy lists - changes to the buddy list should refresh it?

2
irc.py
View file

@ -26,7 +26,7 @@ class PesterIRC(QtCore.QObject):
self.brokenConnection = False self.brokenConnection = False
def closeConnection(self): def closeConnection(self):
self.cli.close() self.cli.close()
def setConnectionBroken(self): def setConnectionBroken(self, broken=True):
self.brokenConnection = True self.brokenConnection = True
@QtCore.pyqtSlot(PesterProfile) @QtCore.pyqtSlot(PesterProfile)
def getMood(self, *chums): def getMood(self, *chums):

BIN
irc.pyc

Binary file not shown.

View file

@ -136,7 +136,15 @@ class pesterTheme(dict):
self.defaultTheme = pesterTheme("pesterchum", default=True) self.defaultTheme = pesterTheme("pesterchum", default=True)
def __getitem__(self, key): def __getitem__(self, key):
keys = key.split("/") keys = key.split("/")
v = dict.__getitem__(self, keys.pop(0)) try:
v = dict.__getitem__(self, keys.pop(0))
except KeyError, e:
if hasattr(self, 'inheritedTheme'):
return self.inheritedTheme[key]
if hasattr(self, 'defaultTheme'):
return self.defaultTheme[key]
else:
raise e
for k in keys: for k in keys:
try: try:
v = v[k] v = v[k]
@ -1658,14 +1666,17 @@ class IRCThread(QtCore.QThread):
irc.IRCConnect() irc.IRCConnect()
while 1: while 1:
if irc.brokenConnection: if irc.brokenConnection:
self.finished.emit() irc.brokenConnection = False
self.restartIRC.emit()
irc.closeConnection() irc.closeConnection()
self.terminate() irc.IRCConnect()
try: try:
irc.updateIRC() irc.updateIRC()
except socket.error: except socket.error:
irc.setConnectionBroken() irc.setConnectionBroken()
restartIRC = QtCore.pyqtSignal()
class PesterTray(QtGui.QSystemTrayIcon): class PesterTray(QtGui.QSystemTrayIcon):
def __init__(self, icon, mainwindow, parent): def __init__(self, icon, mainwindow, parent):
QtGui.QSystemTrayIcon.__init__(self, icon, parent) QtGui.QSystemTrayIcon.__init__(self, icon, parent)
@ -1734,7 +1745,7 @@ class MainProgram(QtCore.QObject):
self.irc = PesterIRC(self.widget.config, self.widget) self.irc = PesterIRC(self.widget.config, self.widget)
self.connectWidgets(self.irc, self.widget) self.connectWidgets(self.irc, self.widget)
self.ircapp = IRCThread(self.irc) self.ircapp = IRCThread(self.irc)
self.connect(self.ircapp, QtCore.SIGNAL('finished()'), self.connect(self.ircapp, QtCore.SIGNAL('restartIRC()'),
self, QtCore.SLOT('restartIRC()')) self, QtCore.SLOT('restartIRC()'))
def connectWidgets(self, irc, widget): def connectWidgets(self, irc, widget):
@ -1847,12 +1858,6 @@ class MainProgram(QtCore.QObject):
def restartIRC(self): def restartIRC(self):
self.widget.show() self.widget.show()
self.widget.activateWindow() self.widget.activateWindow()
self.irc = PesterIRC(self.widget.config, self.widget)
self.connectWidgets(self.irc, self.widget)
self.ircapp = IRCThread(self.irc)
self.connect(self.ircapp, QtCore.SIGNAL('finished()'),
self, QtCore.SLOT('restartIRC()'))
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()'))

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 B

After

Width:  |  Height:  |  Size: 44 B

View file

@ -6,24 +6,29 @@
"icon": "$path/trayicon.png", "icon": "$path/trayicon.png",
"newmsgicon": "$path/trayicon2.png", "newmsgicon": "$path/trayicon2.png",
"windowtitle": "PESTERCHUM", "windowtitle": "PESTERCHUM",
"menu" : { "style": "font-family: 'Courier'; font: bold; font-size: 14px; background-color: #fdb302;border:2px solid #ffff00",
"menuitem": "font-size:14px;" },
"close": { "image": "$path/x.gif", "close": { "image": "$path/x.gif",
"loc": [280, 2]}, "loc": [280, 2]},
"minimize": { "image": "$path/m.gif", "minimize": { "image": "$path/m.gif",
"loc": [260, 2]}, "loc": [260, 8]},
"chums": { "loc": [15, 70], "chums": { "style": "border:2px solid yellow; background-color: black;color: white;font: bold;font-size:14px;font-family: 'Courier';selection-background-color:#646464; ",
"size": [270, 300] "loc": [15, 70],
"size": [270, 300]
}, },
"mychumhandle": { "label": "mychumhandle": { "label":
{ "text": "CHUMHANDLE:", { "text": "CHUMHANDLE:",
"loc": [12,430], "loc": [12,415],
"style": "color: black ;font:bold; font-family: 'Courier';" "style": "color: black ;font:bold; font-family: 'Courier';"
}, },
"handle": { "loc": [35,440], "handle": { "loc": [15,435],
"size": [240, 21] }, "size": [240, 21],
"colorswatch": { "loc": [260,440], "style": "background-color: black; padding: 3px; padding-left: 20px; color:white; font-family:'Courier'; font:bold; text-align:left;"
},
"colorswatch": { "loc": [260,435],
"size": [30,30], "size": [30,30],
"text": "C" }, "text": "C" },
"currentMood": [15, 440] "currentMood": [15, 435]
}, },
"addchum": { "style": "background: rgba(255, 255, 0, 100%); border:2px solid #c48a00; font: bold; color: black; font-family:'Courier';", "addchum": { "style": "background: rgba(255, 255, 0, 100%); border:2px solid #c48a00; font: bold; color: black; font-family:'Courier';",
"loc": [15,380], "loc": [15,380],

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 B

After

Width:  |  Height:  |  Size: 55 B