cleanup and do not show - if message is empty

This commit is contained in:
Nikos Kouremenos 2005-09-12 22:27:36 +00:00
parent 9a91297e5b
commit b503e6bb21
1 changed files with 10 additions and 6 deletions

View File

@ -212,7 +212,7 @@ class NotificationAreaTooltip(BaseTooltip, StatusTable):
elif len(accounts) > 1: elif len(accounts) > 1:
text = _('Gajim') text = _('Gajim')
self.current_row = 1 self.current_row = 1
self.table.resize(2,1) self.table.resize(2, 1)
iconset = gajim.config.get('iconset') iconset = gajim.config.get('iconset')
if not iconset: if not iconset:
iconset = 'sun' iconset = 'sun'
@ -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'],