From ff63d0c1bd4e9669bb8ee72e94aec7bddc8fbc72 Mon Sep 17 00:00:00 2001 From: Travis Shirk Date: Tue, 10 Jan 2006 19:24:06 +0000 Subject: [PATCH] Fixes for #1370, #1372, #1374 --- src/groupchat_control.py | 2 +- src/message_window.py | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/groupchat_control.py b/src/groupchat_control.py index ebd544c3f..e65606eb8 100644 --- a/src/groupchat_control.py +++ b/src/groupchat_control.py @@ -570,7 +570,7 @@ class GroupchatControl(ChatControlBase): self._start_private_message(nick) if msg: - chat_control.send_message(msg) + gajim.interface.msg_win_mgr.get_control(fjid).send_message(msg) def draw_contact(self, nick, selected=False, focus=False): iter = self.get_contact_iter(nick) diff --git a/src/message_window.py b/src/message_window.py index c599628c7..455d72d26 100644 --- a/src/message_window.py +++ b/src/message_window.py @@ -306,6 +306,9 @@ class MessageWindow: def get_control(self, key): '''Return the MessageControl for jid or n, where n is the notebook page index''' + if isinstance(key, str): + key = unicode(key, 'utf-8') + if isinstance(key, unicode): jid = key for ctl in self._controls.values(): @@ -448,6 +451,12 @@ class MessageWindow: elif event.keyval == gtk.keysyms.Escape: # ESCAPE if ctl.type_id == message_control.TYPE_CHAT: self.remove_tab(contact) + else: + # If the active control has a message_textview pass the event to it + active_ctl = self.get_active_control() + if isinstance(active_ctl, ChatControlBase): + active_ctl.msg_textview.emit('key_press_event', event) + active_ctl.msg_textview.grab_focus() ################################################################################ class MessageWindowMgr: @@ -581,7 +590,7 @@ class MessageWindowMgr: return False msg_win = self._gtk_win_to_msg_win(win) - # Save widnow size and postion + # Save window size and postion pos_x_key = 'msgwin-x-position' pos_y_key = 'msgwin-y-position' size_width_key = 'msgwin-width' @@ -603,10 +612,10 @@ class MessageWindowMgr: size_height_key = type + "-msgwin-height" if acct: - gajim.config.set_per(pos_x_key, x, acct) - gajim.config.set_per(pos_y_key, y, acct) - gajim.config.set_per(size_width_key, width, acct) - gajim.config.set_per(size_height_key, height, acct) + gajim.config.set_per('accounts', acct, pos_x_key, x) + gajim.config.set_per('accounts', acct, pos_y_key, y) + gajim.config.set_per('accounts', acct, size_width_key, width) + gajim.config.set_per('accounts', acct, size_height_key, height) else: gajim.config.set(pos_x_key, x) gajim.config.set(pos_y_key, y)