cleanup and do not show - if message is empty
This commit is contained in:
parent
9a91297e5b
commit
b503e6bb21
|
@ -221,13 +221,17 @@ class NotificationAreaTooltip(BaseTooltip, StatusTable):
|
|||
message = acct['message']
|
||||
# before reducing the chars we should assure we send unicode, else
|
||||
# there are possible pango TBs on 'set_markup'
|
||||
if type(message) == str:
|
||||
if isinstance(message, str):
|
||||
message = unicode(message, encoding = 'utf-8')
|
||||
message = gtkgui_helpers.reduce_chars_newlines(message, 50, 1)
|
||||
message = gtkgui_helpers.escape_for_pango_markup(message)
|
||||
if message:
|
||||
self.add_status_row(file_path, acct['show'], '<span weight="bold">' +
|
||||
gtkgui_helpers.escape_for_pango_markup(acct['name']) + '</span>'
|
||||
+ ' - ' + message)
|
||||
else:
|
||||
self.add_status_row(file_path, acct['show'], '<span weight="bold">' +
|
||||
gtkgui_helpers.escape_for_pango_markup(acct['name']) + '</span>')
|
||||
|
||||
elif len(accounts) == 1:
|
||||
message = gtkgui_helpers.reduce_chars_newlines(accounts[0]['status_line'],
|
||||
|
|
Loading…
Reference in New Issue