Deleting control.display_names, useless var now
This commit is contained in:
parent
71293a38e6
commit
e6b3c40e97
|
@ -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')
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue