cut multilined status for pygtk2.4

This commit is contained in:
Dimitur Kirov 2005-08-07 22:17:28 +00:00
parent 7a267eb89a
commit 1c8b7c0a09
2 changed files with 8 additions and 2 deletions

View File

@ -390,7 +390,6 @@ class GroupchatWindow(chat.Chat):
# long subject makes window bigger than the screen
def _cut_if_long(str):
if len(str) > 80:
str = str
str = str[:77] + '...'
return str
if len(subject) > 80:

View File

@ -135,7 +135,14 @@ class TabbedChatWindow(chat.Chat):
banner_name_label.set_ellipsize(pango.ELLIPSIZE_END)
#FIXME: remove me when gtk24 is OLD
elif status is not None and len(status) > 50:
status = status[:47] + '...'
def _cut_if_long(str):
if len(str) > 50:
str = str[:47] + '...'
return str
if len(status) > 50:
status = map(lambda e: _cut_if_long(e), status.split('\n'))
status = reduce(lambda e, e1: e + '\n' + e1, status)
status = gtkgui_helpers.escape_for_pango_markup(status)
#FIXME: uncomment me when we support sending messages to specific resource