Window title fix for #1386
This commit is contained in:
parent
22721cb0db
commit
6d3696e83c
2 changed files with 26 additions and 11 deletions
|
@ -842,6 +842,17 @@ class ChatControl(ChatControlBase):
|
||||||
banner_name_label = self.xml.get_widget('banner_name_label')
|
banner_name_label = self.xml.get_widget('banner_name_label')
|
||||||
name = gtkgui_helpers.escape_for_pango_markup(contact.get_shown_name())
|
name = gtkgui_helpers.escape_for_pango_markup(contact.get_shown_name())
|
||||||
|
|
||||||
|
# We know our contacts nick, but if there are any other controls
|
||||||
|
# with the same nick we need to also display the account.
|
||||||
|
acct_info = ''
|
||||||
|
for ctrl in self.parent_win.controls():
|
||||||
|
if ctrl == self:
|
||||||
|
continue
|
||||||
|
if self.contact.get_shown_name() == ctrl.contact.get_shown_name():
|
||||||
|
acct_info = ' (%s)' % \
|
||||||
|
gtkgui_helpers.escape_for_pango_markup(self.account)
|
||||||
|
break
|
||||||
|
|
||||||
status = contact.status
|
status = contact.status
|
||||||
if status is not None:
|
if status is not None:
|
||||||
banner_name_label.set_ellipsize(pango.ELLIPSIZE_END)
|
banner_name_label.set_ellipsize(pango.ELLIPSIZE_END)
|
||||||
|
@ -870,10 +881,11 @@ class ChatControl(ChatControlBase):
|
||||||
else:
|
else:
|
||||||
chatstate = ''
|
chatstate = ''
|
||||||
label_text = \
|
label_text = \
|
||||||
'<span weight="heavy" size="x-large">%s</span> %s' % (name,
|
'<span weight="heavy" size="x-large">%s</span>%s %s' % \
|
||||||
chatstate)
|
(name, acct_info, chatstate)
|
||||||
else:
|
else:
|
||||||
label_text = '<span weight="heavy" size="x-large">%s</span>' % name
|
label_text = '<span weight="heavy" size="x-large">%s</span>%s' % \
|
||||||
|
(name, acct_info)
|
||||||
|
|
||||||
if status is not None:
|
if status is not None:
|
||||||
label_text += '\n%s' % status
|
label_text += '\n%s' % status
|
||||||
|
|
|
@ -219,15 +219,11 @@ class MessageWindow:
|
||||||
else:
|
else:
|
||||||
name = control.contact.get_shown_name()
|
name = control.contact.get_shown_name()
|
||||||
|
|
||||||
prefix = ''
|
title = _('Gajim Messages')
|
||||||
if self.get_num_controls() > 1:
|
if gajim.interface.msg_win_mgr.mode == MessageWindowMgr.ONE_MSG_WINDOW_NEVER:
|
||||||
prefix = _('Chats: ')
|
title = title + ": " + name
|
||||||
#try to translate acct (which means account) to something short but
|
|
||||||
#that does make sense
|
|
||||||
account = ' (' + _('acct: ') + self.get_active_control().account + ')'
|
|
||||||
title = unread_str + prefix + name + account
|
|
||||||
|
|
||||||
self.window.set_title(title)
|
self.window.set_title(unread_str + title)
|
||||||
|
|
||||||
if urgent:
|
if urgent:
|
||||||
gtkgui_helpers.set_unset_urgency_hint(self.window, unread)
|
gtkgui_helpers.set_unset_urgency_hint(self.window, unread)
|
||||||
|
@ -258,6 +254,13 @@ class MessageWindow:
|
||||||
if len(self._controls[ctrl.account]) == 0:
|
if len(self._controls[ctrl.account]) == 0:
|
||||||
del self._controls[ctrl.account]
|
del self._controls[ctrl.account]
|
||||||
|
|
||||||
|
# Notify a dupicate nick to update their banner and clear account display
|
||||||
|
for c in self.controls():
|
||||||
|
if c == self:
|
||||||
|
continue
|
||||||
|
if ctrl.contact.get_shown_name() == c.contact.get_shown_name():
|
||||||
|
c.draw_banner()
|
||||||
|
|
||||||
if self.get_num_controls() == 1: # we are going from two tabs to one
|
if self.get_num_controls() == 1: # we are going from two tabs to one
|
||||||
show_tabs_if_one_tab = gajim.config.get('tabs_always_visible')
|
show_tabs_if_one_tab = gajim.config.get('tabs_always_visible')
|
||||||
self.notebook.set_show_tabs(show_tabs_if_one_tab)
|
self.notebook.set_show_tabs(show_tabs_if_one_tab)
|
||||||
|
|
Loading…
Add table
Reference in a new issue