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']
|
message = acct['message']
|
||||||
# before reducing the chars we should assure we send unicode, else
|
# before reducing the chars we should assure we send unicode, else
|
||||||
# there are possible pango TBs on 'set_markup'
|
# there are possible pango TBs on 'set_markup'
|
||||||
if type(message) == str:
|
if isinstance(message, str):
|
||||||
message = unicode(message, encoding = 'utf-8')
|
message = unicode(message, encoding = 'utf-8')
|
||||||
message = gtkgui_helpers.reduce_chars_newlines(message, 50, 1)
|
message = gtkgui_helpers.reduce_chars_newlines(message, 50, 1)
|
||||||
message = gtkgui_helpers.escape_for_pango_markup(message)
|
message = gtkgui_helpers.escape_for_pango_markup(message)
|
||||||
|
if message:
|
||||||
self.add_status_row(file_path, acct['show'], '<span weight="bold">' +
|
self.add_status_row(file_path, acct['show'], '<span weight="bold">' +
|
||||||
gtkgui_helpers.escape_for_pango_markup(acct['name']) + '</span>'
|
gtkgui_helpers.escape_for_pango_markup(acct['name']) + '</span>'
|
||||||
+ ' - ' + message)
|
+ ' - ' + 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:
|
elif len(accounts) == 1:
|
||||||
message = gtkgui_helpers.reduce_chars_newlines(accounts[0]['status_line'],
|
message = gtkgui_helpers.reduce_chars_newlines(accounts[0]['status_line'],
|
||||||
|
|
Loading…
Reference in New Issue