[tmolitor] add a way to sort emoticons in emoticon menu. Fixes #8204
This commit is contained in:
parent
7c9a5aa429
commit
292a0ba99a
1 changed files with 14 additions and 2 deletions
|
@ -2005,6 +2005,11 @@ class Interface:
|
|||
import imp
|
||||
imp.reload(emoticons)
|
||||
emots = emoticons.emoticons
|
||||
self.emoticons_sorting = None
|
||||
try:
|
||||
self.emoticons_sorting = emoticons.sorting
|
||||
except:
|
||||
pass
|
||||
except Exception as e:
|
||||
return True
|
||||
for emot_filename in emots:
|
||||
|
@ -2023,6 +2028,12 @@ class Interface:
|
|||
16, 16)
|
||||
self.emoticons_images.append((emot, pix))
|
||||
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
|
||||
sys.path.remove(path)
|
||||
|
||||
|
@ -2772,6 +2783,7 @@ class Interface:
|
|||
self.emoticons = []
|
||||
self.emoticons_animations = {}
|
||||
self.emoticons_images = {}
|
||||
self.emoticons_sorting = None
|
||||
|
||||
cfg_was_read = parser.read()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue