From b503e6bb2118a6fd37aa61bacec90c3e6e48e10e Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Mon, 12 Sep 2005 22:27:36 +0000 Subject: [PATCH] cleanup and do not show - if message is empty --- src/tooltips.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/tooltips.py b/src/tooltips.py index b24b5c770..d3bbfd1ed 100644 --- a/src/tooltips.py +++ b/src/tooltips.py @@ -212,7 +212,7 @@ class NotificationAreaTooltip(BaseTooltip, StatusTable): elif len(accounts) > 1: text = _('Gajim') self.current_row = 1 - self.table.resize(2,1) + self.table.resize(2, 1) iconset = gajim.config.get('iconset') if not iconset: iconset = 'sun' @@ -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: - message = unicode(message, encoding='utf-8') + 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) - self.add_status_row(file_path, acct['show'], '' + - gtkgui_helpers.escape_for_pango_markup(acct['name']) + '' - + ' - ' + message) + if message: + self.add_status_row(file_path, acct['show'], '' + + gtkgui_helpers.escape_for_pango_markup(acct['name']) + '' + + ' - ' + message) + else: + self.add_status_row(file_path, acct['show'], '' + + gtkgui_helpers.escape_for_pango_markup(acct['name']) + '') elif len(accounts) == 1: message = gtkgui_helpers.reduce_chars_newlines(accounts[0]['status_line'],