This commit is contained in:
ingvar1995 2016-08-28 16:11:40 +03:00
parent 43d9a41dae
commit d81e3e781b
2 changed files with 4 additions and 2 deletions

View File

@ -25,7 +25,9 @@ class MessageEdit(QtGui.QTextBrowser):
self.setOpenExternalLinks(True) self.setOpenExternalLinks(True)
self.setAcceptRichText(True) self.setAcceptRichText(True)
self.setOpenLinks(False) self.setOpenLinks(False)
self.setSearchPaths([smileys.SmileyLoader.get_instance().get_smileys_path()]) path = smileys.SmileyLoader.get_instance().get_smileys_path()
if path is not None:
self.setSearchPaths([path])
self.document().setDefaultStyleSheet('a { color: #306EFF; }') self.document().setDefaultStyleSheet('a { color: #306EFF; }')
text = self.decoratedText(text) text = self.decoratedText(text)
if message_type != TOX_MESSAGE_TYPE['NORMAL']: if message_type != TOX_MESSAGE_TYPE['NORMAL']:

View File

@ -48,7 +48,7 @@ class SmileyLoader(util.Singleton):
print('Smiley pack {} was not loaded. Error: {}'.format(pack_name, ex)) print('Smiley pack {} was not loaded. Error: {}'.format(pack_name, ex))
def get_smileys_path(self): def get_smileys_path(self):
return util.curr_directory() + '/smileys/' + self._curr_pack + '/' return util.curr_directory() + '/smileys/' + self._curr_pack + '/' if self._curr_pack is not None else None
def get_packs_list(self): def get_packs_list(self):
d = util.curr_directory() + '/smileys/' d = util.curr_directory() + '/smileys/'