This commit is contained in:
parent
f91a115dd6
commit
0af89a407c
1 changed files with 19 additions and 8 deletions
|
@ -1957,14 +1957,17 @@ class Interface:
|
||||||
self.emoticons = dict()
|
self.emoticons = dict()
|
||||||
self.emoticons_animations = dict()
|
self.emoticons_animations = dict()
|
||||||
|
|
||||||
sys.path.append(path)
|
sys.path.insert(0, path)
|
||||||
import emoticons
|
import emoticons
|
||||||
if need_reload:
|
try:
|
||||||
# we need to reload else that doesn't work when changing emoticon
|
if need_reload:
|
||||||
# set
|
# we need to reload else that doesn't work when changing
|
||||||
import imp
|
# emoticons set
|
||||||
imp.reload(emoticons)
|
import imp
|
||||||
emots = emoticons.emoticons
|
imp.reload(emoticons)
|
||||||
|
emots = emoticons.emoticons
|
||||||
|
except Exception, e:
|
||||||
|
return True
|
||||||
for emot_filename in emots:
|
for emot_filename in emots:
|
||||||
emot_file = os.path.join(path, emot_filename)
|
emot_file = os.path.join(path, emot_filename)
|
||||||
if not self.image_is_ok(emot_file):
|
if not self.image_is_ok(emot_file):
|
||||||
|
@ -2005,7 +2008,14 @@ class Interface:
|
||||||
transient_for=transient_for)
|
transient_for=transient_for)
|
||||||
gajim.config.set('emoticons_theme', '')
|
gajim.config.set('emoticons_theme', '')
|
||||||
return
|
return
|
||||||
self._init_emoticons(path, need_reload)
|
if self._init_emoticons(path, need_reload):
|
||||||
|
dialogs.WarningDialog(_('Emoticons disabled'),
|
||||||
|
_('Your configured emoticons theme cannot been loaded. You '
|
||||||
|
'maybe need to update the format of emoticons.py file. See '
|
||||||
|
'http://trac.gajim.org/wiki/Emoticons for more details.'),
|
||||||
|
transient_for=transient_for)
|
||||||
|
gajim.config.set('emoticons_theme', '')
|
||||||
|
return
|
||||||
if len(self.emoticons) == 0:
|
if len(self.emoticons) == 0:
|
||||||
# maybe old format of emoticons file, try to convert it
|
# maybe old format of emoticons file, try to convert it
|
||||||
try:
|
try:
|
||||||
|
@ -2028,6 +2038,7 @@ class Interface:
|
||||||
'maybe need to update the format of emoticons.py file. See '
|
'maybe need to update the format of emoticons.py file. See '
|
||||||
'http://trac.gajim.org/wiki/Emoticons for more details.'),
|
'http://trac.gajim.org/wiki/Emoticons for more details.'),
|
||||||
transient_for=transient_for)
|
transient_for=transient_for)
|
||||||
|
gajim.config.set('emoticons_theme', '')
|
||||||
if self.emoticons_menu:
|
if self.emoticons_menu:
|
||||||
self.emoticons_menu.destroy()
|
self.emoticons_menu.destroy()
|
||||||
self.emoticons_menu = self.prepare_emoticons_menu()
|
self.emoticons_menu = self.prepare_emoticons_menu()
|
||||||
|
|
Loading…
Add table
Reference in a new issue