fixed "Pan Taduesz; Ksiega I" problem

This commit is contained in:
Dimitur Kirov 2005-07-31 21:16:20 +00:00
parent 830f414b4a
commit a6f9f83f31
1 changed files with 12 additions and 2 deletions

View File

@ -623,9 +623,17 @@ class StatusTable:
if status: if status:
status = status.strip() status = status.strip()
if status != '': if status != '':
status = self.strip_text(status, 50)
str_status += ' - ' + status str_status += ' - ' + status
return gtkgui_helpers.escape_for_pango_markup(str_status) return gtkgui_helpers.escape_for_pango_markup(str_status)
# "Pan Taduesz; Ksiega I" problem, reported by koorek
def strip_text(self, text, max_length):
text = text.strip()
if len(text) > max_length:
text = text[:max_length - 3] + '...'
return text
def add_status_row(self, file_path, show, str_status): def add_status_row(self, file_path, show, str_status):
''' appends a new row with status icon to the table ''' ''' appends a new row with status icon to the table '''
self.current_row += 1 self.current_row += 1
@ -700,9 +708,11 @@ class NotificationAreaTooltip(BaseTooltip, StatusTable):
iconset = 'sun' iconset = 'sun'
file_path = os.path.join(gajim.DATA_DIR, 'iconsets', iconset, '16x16') file_path = os.path.join(gajim.DATA_DIR, 'iconsets', iconset, '16x16')
for acct in accounts: for acct in accounts:
mesage = gtkgui_helpers.escape_for_pango_markup(acct['message'])
mesage = self.strip_text(mesage, 50)
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>'
+ ' - ' + gtkgui_helpers.escape_for_pango_markup(acct['message'])) + ' - ' + mesage)
elif len(accounts) == 1: elif len(accounts) == 1:
text = _('Gajim - %s') % accounts[0]['status_line'] text = _('Gajim - %s') % accounts[0]['status_line']