From 35349d9ee41017348db1871530af98efcb4a4ed3 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sat, 16 Jan 2016 14:18:16 +0100 Subject: [PATCH] [Bahtiar `kalkin-` Gadimov] Shorten name of a gc entry in "Join GC" submenu Some XMPP clients save the subject of a group chat as the bookmark name. The subject can be very long thus the MenuItems can get also very long. This simple patch shortens the name to a carefully chosen value. Fixes #8218 --- src/roster_window.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/roster_window.py b/src/roster_window.py index df953e5d7..d5e94f2b1 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -6158,6 +6158,10 @@ class RosterWindow: # No name was given for this bookmark. # Use the first part of JID instead... name = bookmark['jid'].split("@")[0] + + # Shorten long names + name = (name[:42] + '..') if len(name) > 42 else name + # Do not use underline. item = Gtk.MenuItem.new_with_label(name) item.set_use_underline(False)