From c45f7ea070b0fb489b40e3ba24ccaadefd6d1e1e Mon Sep 17 00:00:00 2001 From: Kiooeht Date: Thu, 23 Jun 2011 00:21:35 -0700 Subject: [PATCH] Bug fix: Animations working in memos again (Whoops I broke the everything) --- convo.py | 4 ++-- memos.py | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/convo.py b/convo.py index ad05dc6..030cdf4 100644 --- a/convo.py +++ b/convo.py @@ -259,13 +259,13 @@ class PesterText(QtGui.QTextEdit): for m in self.urls: html = unicode(self.toHtml()) if html.find(self.urls[m].toString()) != -1: - if movie.frameCount() > 1: + if m.frameCount() > 1: m.start() else: for m in self.urls: html = unicode(self.toHtml()) if html.find(self.urls[m].toString()) != -1: - if movie.frameCount() > 1: + if m.frameCount() > 1: m.stop() @QtCore.pyqtSlot(bool) diff --git a/memos.py b/memos.py index 46be764..95e7c38 100644 --- a/memos.py +++ b/memos.py @@ -256,7 +256,9 @@ class MemoText(PesterText): self, QtCore.SLOT('textReady(bool)')) self.urls = {} for k in smiledict: - self.addAnimation(QtCore.QUrl("smilies/%s" % (smiledict[k])), "smilies/%s" % (smiledict[k])); + self.addAnimation(QtCore.QUrl("smilies/%s" % (smiledict[k])), "smilies/%s" % (smiledict[k])) + self.connect(self.mainwindow, QtCore.SIGNAL('animationSetting(bool)'), + self, QtCore.SLOT('animateChanged(bool)')) def initTheme(self, theme): if theme.has_key("memos/scrollbar"): @@ -272,6 +274,11 @@ class MemoText(PesterText): parent = self.parent() window = parent.mainwindow me = window.profile() + if self.mainwindow.config.animations(): + for m in self.urls: + if convertTags(lexmsg).find(self.urls[m].toString()) != -1: + if m.state() == QtGui.QMovie.NotRunning: + m.start() chumdb = window.chumdb if chum is not me: # SO MUCH WH1T3SP4C3 >:] if type(lexmsg[0]) is colorBegin: # get color tag