Bug fix: Hopefully netsplit informing works?

This commit is contained in:
Kiooeht 2011-07-19 16:39:19 -07:00
parent 79331e17ac
commit 6e3c97fb58

View file

@ -878,13 +878,12 @@ class PesterMemo(PesterConvo):
@QtCore.pyqtSlot() @QtCore.pyqtSlot()
def dumpNetsplit(self): def dumpNetsplit(self):
self.splitTimer.stop()
chum = self.mainwindow.profile() chum = self.mainwindow.profile()
systemColor = QtGui.QColor(self.mainwindow.theme["memos/systemMsgColor"]) systemColor = QtGui.QColor(self.mainwindow.theme["memos/systemMsgColor"])
msg = chum.memonetsplitmsg(systemColor, self.netsplit) msg = chum.memonetsplitmsg(systemColor, self.netsplit)
self.textArea.append(convertTags(msg)) self.textArea.append(convertTags(msg))
self.mainwindow.chatlog.log(self.channel, msg) self.mainwindow.chatlog.log(self.channel, msg)
self.netsplit = [] del self.netsplit
@QtCore.pyqtSlot(QtCore.QString, QtCore.QString, QtCore.QString) @QtCore.pyqtSlot(QtCore.QString, QtCore.QString, QtCore.QString)
def userPresentChange(self, handle, channel, update): def userPresentChange(self, handle, channel, update):
@ -917,9 +916,7 @@ class PesterMemo(PesterConvo):
if update == "netsplit": if update == "netsplit":
if not hasattr(self, "netsplit"): if not hasattr(self, "netsplit"):
self.netsplit = [] self.netsplit = []
self.splitTimer = QtCore.QTimer(self) QtCore.QTimer.singleShot(1500, self, QtCore.SLOT('dumpNetsplit()'))
self.connect(self.splitTimer, QtCore.SIGNAL('timeout()'),
self, QtCore.SLOT('dumpNetsplit()'))
for c in chums: for c in chums:
chum = PesterProfile(h) chum = PesterProfile(h)
self.userlist.takeItem(self.userlist.row(c)) self.userlist.takeItem(self.userlist.row(c))
@ -933,9 +930,6 @@ class PesterMemo(PesterConvo):
self.times[h].removeTime(t.getTime()) self.times[h].removeTime(t.getTime())
if update == "netsplit": if update == "netsplit":
self.netsplit.extend(initials) self.netsplit.extend(initials)
if self.splitTimer.isActive():
self.splitTimer.stop()
self.splitTimer.start(1000)
else: else:
msg = chum.memoclosemsg(systemColor, allinitials, self.mainwindow.theme["convo/text/closememo"]) msg = chum.memoclosemsg(systemColor, allinitials, self.mainwindow.theme["convo/text/closememo"])
self.textArea.append(convertTags(msg)) self.textArea.append(convertTags(msg))