From c0d590759b8ac833c111ec9b6be86ac5f6a7922e Mon Sep 17 00:00:00 2001 From: Lexi Date: Thu, 11 Aug 2011 09:59:51 +0100 Subject: [PATCH] Made animated smilies show up as static in OSX bundles so they actually show up --- menus.py | 22 ++++++++++++---------- ostools.py | 2 +- parsetools.py | 11 +++++++++++ 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/menus.py b/menus.py index c89e328..49ff88b 100644 --- a/menus.py +++ b/menus.py @@ -1,5 +1,5 @@ from PyQt4 import QtGui, QtCore -import re +import re, ostools from os import remove from generic import RightClickList, RightClickTree, MultiTextDialog @@ -984,13 +984,14 @@ class PesterOptions(QtGui.QDialog): if self.config.opvoiceMessages(): self.memomessagecheck.setChecked(True) - self.animationscheck = QtGui.QCheckBox("Use animated smilies", self) - if self.config.animations(): - self.animationscheck.setChecked(True) - animateLabel = QtGui.QLabel("(Disable if you leave chats open for LOOOONG periods of time)") - font = animateLabel.font() - font.setPointSize(8) - animateLabel.setFont(font) + if not ostools.isOSXBundle(): + self.animationscheck = QtGui.QCheckBox("Use animated smilies", self) + if self.config.animations(): + self.animationscheck.setChecked(True) + animateLabel = QtGui.QLabel("(Disable if you leave chats open for LOOOONG periods of time)") + font = animateLabel.font() + font.setPointSize(8) + animateLabel.setFont(font) self.userlinkscheck = QtGui.QCheckBox("Disable #Memo and @User Links", self) self.userlinkscheck.setChecked(self.config.disableUserLinks()) @@ -1121,8 +1122,9 @@ class PesterOptions(QtGui.QDialog): layout_chat.addWidget(self.timestampBox) layout_chat.addWidget(self.secondscheck) layout_chat.addWidget(self.memomessagecheck) - layout_chat.addWidget(self.animationscheck) - layout_chat.addWidget(animateLabel) + if not ostools.isOSXBundle(): + layout_chat.addWidget(self.animationscheck) + layout_chat.addWidget(animateLabel) if parent.randhandler.running: layout_chat.addWidget(self.randomscheck) # Re-enable these when it's possible to disable User and Memo links diff --git a/ostools.py b/ostools.py index 68d980e..294437f 100644 --- a/ostools.py +++ b/ostools.py @@ -9,7 +9,7 @@ def isWin32(): return platform == "win32" def isOSXBundle(): - return isOSX() and path.abspath('.').find(".app") + return isOSX() and (path.abspath('.').find(".app") != -1) def getDataDir(): if isOSX(): diff --git a/parsetools.py b/parsetools.py index 53fc7d7..19be1bf 100644 --- a/parsetools.py +++ b/parsetools.py @@ -1,5 +1,6 @@ import re import random +import ostools from copy import copy from datetime import timedelta from PyQt4 import QtGui @@ -425,6 +426,16 @@ smiledict = { ":acceptant:": "acceptant.png", } +if ostools.isOSXBundle(): + for emote in smiledict: + graphic = smiledict[emote] + if graphic.find(".gif"): + graphic = graphic.replace(".gif", ".png") + smiledict[emote] = graphic + + + + reverse_smiley = dict((v,k) for k, v in smiledict.iteritems()) _smilere = re.compile("|".join(smiledict.keys()))