ctl --> ctrl

This commit is contained in:
Nikos Kouremenos 2006-01-11 23:21:00 +00:00
parent bc59eadfff
commit ed7fb86bbf
1 changed files with 20 additions and 20 deletions

View File

@ -220,9 +220,9 @@ class Interface:
(jid_from, file_props)) (jid_from, file_props))
conn.disconnect_transfer(file_props) conn.disconnect_transfer(file_props)
return return
ctl = gajim.interface.msg_win_mgr.get_control(jid_from) ctrl = gajim.interface.msg_win_mgr.get_control(jid_from)
if ctl and ctl.type_id == message_control.TYPE_GC: if ctrl and ctrl.type_id == message_control.TYPE_GC:
ctl.print_conversation('Error %s: %s' % (array[2], array[1])) ctrl.print_conversation('Error %s: %s' % (array[2], array[1]))
def handle_event_con_type(self, account, con_type): def handle_event_con_type(self, account, con_type):
# ('CON_TYPE', account, con_type) which can be 'ssl', 'tls', 'tcp' # ('CON_TYPE', account, con_type) which can be 'ssl', 'tls', 'tcp'
@ -426,13 +426,13 @@ class Interface:
# Handle chat states # Handle chat states
contact = gajim.contacts.get_first_contact_from_jid(account, jid) contact = gajim.contacts.get_first_contact_from_jid(account, jid)
if chat_control and chat_control.type_id == message_control.TYPE_CHAT: if chat_control and chat_control.type_id == message_control.TYPE_CHAT:
ctl = gajim.interface.msg_win_mgr.get_control(jid) ctrl = gajim.interface.msg_win_mgr.get_control(jid)
if chatstate is not None: # he or she sent us reply, so he supports jep85 if chatstate is not None: # he or she sent us reply, so he supports jep85
contact.chatstate = chatstate contact.chatstate = chatstate
if contact.our_chatstate == 'ask': # we were jep85 disco? if contact.our_chatstate == 'ask': # we were jep85 disco?
contact.our_chatstate = 'active' # no more contact.our_chatstate = 'active' # no more
ctl.handle_incoming_chatstate() ctrl.handle_incoming_chatstate()
elif contact.chatstate != 'active': elif contact.chatstate != 'active':
# got no valid jep85 answer, peer does not support it # got no valid jep85 answer, peer does not support it
contact.chatstate = False contact.chatstate = False
@ -495,8 +495,8 @@ class Interface:
name = nick, show = show) name = nick, show = show)
c = gajim.contacts.contact_from_gc_contct(c) c = gajim.contacts.contact_from_gc_contct(c)
self.roster.new_chat(c, account, private_chat = True) self.roster.new_chat(c, account, private_chat = True)
ctl = gajim.interface.msg_win_mgr.get_control(fjid) ctrl = gajim.interface.msg_win_mgr.get_control(fjid)
ctl.print_conversation('Error %s: %s' % (array[1], array[2]), ctrl.print_conversation('Error %s: %s' % (array[1], array[2]),
'status') 'status')
return return
@ -649,15 +649,15 @@ class Interface:
# show avatar in chat # show avatar in chat
win = None win = None
ctl = None ctrl = None
if gajim.interface.msg_win_mgr.has_window(jid): if gajim.interface.msg_win_mgr.has_window(jid):
win = gajim.interface.msg_win_mgr.get_window(jid) win = gajim.interface.msg_win_mgr.get_window(jid)
ctl = win.get_control(jid) ctrl = win.get_control(jid)
elif resource and gajim.interface.msg_win_mgr.has_window(jid + '/' + resource): elif resource and gajim.interface.msg_win_mgr.has_window(jid + '/' + resource):
win = gajim.interface.msg_win_mgr.get_window(jid + '/' + resource) win = gajim.interface.msg_win_mgr.get_window(jid + '/' + resource)
ctl = win.get_control(jid + '/' + resource) ctrl = win.get_control(jid + '/' + resource)
if win and ctl.type_id != message_control.TYPE_GC: if win and ctrl.type_id != message_control.TYPE_GC:
ctl.show_avatar() ctrl.show_avatar()
# Show avatar in roster # Show avatar in roster
self.roster.draw_avatar(jid, account) self.roster.draw_avatar(jid, account)
@ -687,15 +687,15 @@ class Interface:
status = array[2] status = array[2]
# print status in chat window and update status/GPG image # print status in chat window and update status/GPG image
if gajim.interface.msg_win_mgr.has_window(fjid): if gajim.interface.msg_win_mgr.has_window(fjid):
ctl = gajim.interface.msg_win_mgr.get_control(fjid) ctrl = gajim.interface.msg_win_mgr.get_control(fjid)
contact = ctl.contact contact = ctrl.contact
contact.show = show contact.show = show
contact.status = status contact.status = status
ctl.update_ui() ctrl.update_ui()
uf_show = helpers.get_uf_show(show) uf_show = helpers.get_uf_show(show)
ctl.print_conversation(_('%s is now %s (%s)') % (nick, uf_show, status), ctrl.print_conversation(_('%s is now %s (%s)') % (nick, uf_show, status),
'status') 'status')
ctl.draw_banner() ctrl.draw_banner()
# Get the window and control for the updated status, this may be a PrivateChatControl # Get the window and control for the updated status, this may be a PrivateChatControl
control = gajim.interface.msg_win_mgr.get_control(room_jid) control = gajim.interface.msg_win_mgr.get_control(room_jid)
@ -1289,10 +1289,10 @@ class Interface:
w.set_active_tab(jid) w.set_active_tab(jid)
w.window.present() w.window.present()
w.window.window.focus() w.window.window.focus()
ctl = w.get_control(jid) ctrl = w.get_control(jid)
# Using isinstance here because we want to catch all derived types # Using isinstance here because we want to catch all derived types
if isinstance(ctl, ChatControlBase): if isinstance(ctrl, ChatControlBase):
tv = ctl.conv_textview tv = ctrl.conv_textview
tv.scroll_to_end() tv.scroll_to_end()
def __init__(self): def __init__(self):