From e6b3c40e97981acd7fa50aeaa8c5508627fe9fba Mon Sep 17 00:00:00 2001 From: Jean-Marie Traissard Date: Thu, 8 Feb 2007 18:32:10 +0000 Subject: [PATCH] Deleting control.display_names, useless var now --- src/chat_control.py | 8 ++++---- src/groupchat_control.py | 4 +--- src/message_control.py | 5 +---- src/message_window.py | 8 +++++++- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/chat_control.py b/src/chat_control.py index ae7dcbf0c..a06530aef 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -117,10 +117,10 @@ class ChatControlBase(MessageControl): event_keymod): pass # Derived should implement this rather than connecting to the event itself. - def __init__(self, type_id, parent_win, widget_name, display_names, contact, - acct, resource = None): + def __init__(self, type_id, parent_win, widget_name, contact, acct, + resource = None): MessageControl.__init__(self, type_id, parent_win, widget_name, - display_names, contact, acct, resource = resource); + contact, acct, resource = resource); # when/if we do XHTML we will put formatting buttons back widget = self.xml.get_widget('emoticons_button') id = widget.connect('clicked', self.on_emoticons_button_clicked) @@ -853,7 +853,7 @@ class ChatControl(ChatControlBase): def __init__(self, parent_win, contact, acct, resource = None): ChatControlBase.__init__(self, self.TYPE_ID, parent_win, - 'chat_child_vbox', (_('Chat'), _('Chats')), contact, acct, resource) + 'chat_child_vbox', contact, acct, resource) # for muc use: # widget = self.xml.get_widget('muc_window_actions_button') diff --git a/src/groupchat_control.py b/src/groupchat_control.py index 3dc7060bf..9c35ed966 100644 --- a/src/groupchat_control.py +++ b/src/groupchat_control.py @@ -103,7 +103,6 @@ class PrivateChatControl(ChatControl): self.room_name = room_ctrl.name ChatControl.__init__(self, parent_win, contact, acct) self.TYPE_ID = 'pm' - self.display_names = (_('Private Chat'), _('Private Chats')) def send_message(self, message): '''call this function to send our message''' @@ -141,8 +140,7 @@ class GroupchatControl(ChatControlBase): def __init__(self, parent_win, contact, acct): ChatControlBase.__init__(self, self.TYPE_ID, parent_win, - 'muc_child_vbox', (_('Group Chat'), _('Group Chats')), - contact, acct); + 'muc_child_vbox', contact, acct); widget = self.xml.get_widget('muc_window_actions_button') id = widget.connect('clicked', self.on_actions_button_clicked) diff --git a/src/message_control.py b/src/message_control.py index 7a6a934e9..e2d16a45b 100644 --- a/src/message_control.py +++ b/src/message_control.py @@ -25,16 +25,13 @@ TYPE_PM = 'pm' 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_names, contact, account, resource = None): - '''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''' + def __init__(self, type_id, parent_win, widget_name, contact, account, resource = None): # dict { cb id : widget} # keep all registered callbacks of widgets, created by self.xml self.handlers = {} self.type_id = type_id self.parent_win = parent_win self.widget_name = widget_name - self.display_names = display_names self.contact = contact self.account = account self.hide_chat_buttons_current = False diff --git a/src/message_window.py b/src/message_window.py index 1ccbd19f9..b8d09c0da 100644 --- a/src/message_window.py +++ b/src/message_window.py @@ -264,11 +264,17 @@ class MessageWindow: name += '/' + control.resource window_mode = gajim.interface.msg_win_mgr.mode + 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] + if self.type == 'chat': + label = _('Chats') + elif self.type == 'gc': + label = _('Group Chats') + else: + label = _('Private Chats') else: label = _('Messages') title = _('%s - Gajim') % label