[tmolitor] add a way to sort emoticons in emoticon menu. Fixes #8204
This commit is contained in:
parent
7c9a5aa429
commit
292a0ba99a
|
@ -2005,6 +2005,11 @@ class Interface:
|
||||||
import imp
|
import imp
|
||||||
imp.reload(emoticons)
|
imp.reload(emoticons)
|
||||||
emots = emoticons.emoticons
|
emots = emoticons.emoticons
|
||||||
|
self.emoticons_sorting = None
|
||||||
|
try:
|
||||||
|
self.emoticons_sorting = emoticons.sorting
|
||||||
|
except:
|
||||||
|
pass
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return True
|
return True
|
||||||
for emot_filename in emots:
|
for emot_filename in emots:
|
||||||
|
@ -2023,6 +2028,12 @@ class Interface:
|
||||||
16, 16)
|
16, 16)
|
||||||
self.emoticons_images.append((emot, pix))
|
self.emoticons_images.append((emot, pix))
|
||||||
self.emoticons[emot.upper()] = emot_file
|
self.emoticons[emot.upper()] = emot_file
|
||||||
|
def emoticons_sorter(item):
|
||||||
|
try:
|
||||||
|
return self.emoticons_sorting.index(item[0])
|
||||||
|
except:
|
||||||
|
return 0
|
||||||
|
self.emoticons_images = sorted(self.emoticons_images, key=emoticons_sorter)
|
||||||
del emoticons
|
del emoticons
|
||||||
sys.path.remove(path)
|
sys.path.remove(path)
|
||||||
|
|
||||||
|
@ -2772,6 +2783,7 @@ class Interface:
|
||||||
self.emoticons = []
|
self.emoticons = []
|
||||||
self.emoticons_animations = {}
|
self.emoticons_animations = {}
|
||||||
self.emoticons_images = {}
|
self.emoticons_images = {}
|
||||||
|
self.emoticons_sorting = None
|
||||||
|
|
||||||
cfg_was_read = parser.read()
|
cfg_was_read = parser.read()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue