From 3ab1fb353902b335b2595c7be399f12f41d7f6e6 Mon Sep 17 00:00:00 2001 From: Travis Shirk Date: Sun, 12 Feb 2006 21:22:49 +0000 Subject: [PATCH] More fixes for #1386 - Window titles and one_message_window PERTYPE mode --- src/chat_control.py | 6 +++--- src/groupchat_control.py | 5 +++-- src/message_control.py | 6 ++++-- src/message_window.py | 7 ++++--- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/chat_control.py b/src/chat_control.py index 521140f53..195b8d318 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -75,8 +75,8 @@ class ChatControlBase(MessageControl): def handle_message_textview_mykey_press(self, widget, event_keyval, event_keymod): pass # Derived should implement this rather than connecting to the event itself. - def __init__(self, type_id, parent_win, widget_name, display_name, contact, acct): - MessageControl.__init__(self, type_id, parent_win, widget_name, display_name, + def __init__(self, type_id, parent_win, widget_name, display_names, contact, acct): + MessageControl.__init__(self, type_id, parent_win, widget_name, display_names, contact, acct); # FIXME: These are hidden from 0.8 on, but IMO all these things need @@ -695,7 +695,7 @@ class ChatControl(ChatControlBase): def __init__(self, parent_win, contact, acct): ChatControlBase.__init__(self, self.TYPE_ID, parent_win, 'chat_child_vbox', - _('Chat'), contact, acct) + (_('Chat'), _('Chats')), contact, acct) self.compact_view_always = gajim.config.get('always_compact_view_chat') self.set_compact_view(self.compact_view_always) diff --git a/src/groupchat_control.py b/src/groupchat_control.py index e8fe4d42d..0e916178a 100644 --- a/src/groupchat_control.py +++ b/src/groupchat_control.py @@ -69,7 +69,7 @@ class PrivateChatControl(ChatControl): def __init__(self, parent_win, contact, acct): ChatControl.__init__(self, parent_win, contact, acct) self.TYPE_ID = 'pm' - self.display_name = _('Private chat') + self.display_names = (_('Private Chat'), _('Private Chats')) def send_message(self, message): '''call this function to send our message''' @@ -99,7 +99,8 @@ class GroupchatControl(ChatControlBase): def __init__(self, parent_win, contact, acct): ChatControlBase.__init__(self, self.TYPE_ID, parent_win, - 'muc_child_vbox', _('Group Chat'), contact, acct); + 'muc_child_vbox', (_('Group Chat'), _('Group Chats')), + contact, acct); self.room_jid = self.contact.jid self.nick = contact.name diff --git a/src/message_control.py b/src/message_control.py index 11e4172d3..be7f59e34 100644 --- a/src/message_control.py +++ b/src/message_control.py @@ -37,11 +37,13 @@ GTKGUI_GLADE = 'gtkgui.glade' class MessageControl: '''An abstract base widget that can embed in the gtk.Notebook of a MessageWindow''' - def __init__(self, type_id, parent_win, widget_name, display_name, contact, account): + def __init__(self, type_id, parent_win, widget_name, display_names, contact, account): + '''The display_names argument is a two element tuple containing the desired + display name (pretty string) for the control in both singular and plural form''' self.type_id = type_id self.parent_win = parent_win self.widget_name = widget_name - self.display_name = display_name + self.display_names = display_names self.contact = contact self.account = account self.compact_view_always = False diff --git a/src/message_window.py b/src/message_window.py index c5c949593..3194af5b4 100644 --- a/src/message_window.py +++ b/src/message_window.py @@ -220,10 +220,11 @@ class MessageWindow: name = control.contact.get_shown_name() window_mode = gajim.interface.msg_win_mgr.mode - if window_mode == MessageWindowMgr.ONE_MSG_WINDOW_PERTYPE: - label = control.display_name - elif self.get_num_controls() == 1: + if self.get_num_controls() == 1: label = name + elif window_mode == MessageWindowMgr.ONE_MSG_WINDOW_PERTYPE: + # Show the plural form since number of tabs > 1 + label = control.display_names[1] else: label = _('Messages') title = _('%s - Gajim') % label