diff options
author | Travis Shirk <travis@pobox.com> | 2006-01-09 03:47:54 +0300 |
---|---|---|
committer | Travis Shirk <travis@pobox.com> | 2006-01-09 03:47:54 +0300 |
commit | 2a794ba19e672d39abfaf63654dae7c4eaaccb21 (patch) | |
tree | 83408ef842b735219f9c7e1ee75bb476347cc0cb | |
parent | a6bdc39d5dce3ceec658aad950893d2fcab38812 (diff) |
Fix up, look sharp
-rwxr-xr-x | src/gajim.py | 2 | ||||
-rw-r--r-- | src/groupchat_control.py | 12 | ||||
-rw-r--r-- | src/message_window.py | 13 | ||||
-rw-r--r-- | src/tooltips.py | 2 |
4 files changed, 17 insertions, 12 deletions
diff --git a/src/gajim.py b/src/gajim.py index 836138e9d..59e997d95 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -965,7 +965,7 @@ class Interface: '''SIGNED_IN event is emitted when we sign in, so handle it''' # join already open groupchats for gc_control in gajim.interface.msg_win_mgr.get_controls(message_control.TYPE_GC): - room_jid = gc_control.contact.jid + room_jid = gc_control.room_jid if gajim.gc_connected[account][room_jid]: continue room, server = gajim.get_room_name_and_server_from_room_jid(room_jid) diff --git a/src/groupchat_control.py b/src/groupchat_control.py index 9293d8240..78360a7f0 100644 --- a/src/groupchat_control.py +++ b/src/groupchat_control.py @@ -232,7 +232,7 @@ class GroupchatControl(ChatControlBase): self.draw_contact(nick, selected=True, focus=True) def get_tab_label(self, chatstate): - '''Markup the label if necessary. Returns a tuple such as: + '''Markup the label if necessary. Returns a tuple such as: (new_label_str, color) either of which can be None if chatstate is given that means we have HE SENT US a chatstate''' @@ -253,7 +253,7 @@ class GroupchatControl(ChatControlBase): color = gajim.config.get_per('themes', theme, 'state_active_color') elif chatstate == 'newmsg' and (not has_focus or not current_tab) and\ - not self.attention_flag: + not self.attention_flag: color = gajim.config.get_per('themes', theme, 'state_muc_msg') if color: color = gtk.gdk.colormap_get_system().alloc_color(color) @@ -663,7 +663,7 @@ class GroupchatControl(ChatControlBase): iter = self.add_contact_to_roster(nick, show, role, affiliation, status, jid) if statusCode == '201': # We just created the room - gajim.connections[self.account].request_gc_config(self.room_jid) + gajim.connections[self.account].request_gc_config(self.room_jid) else: actual_role = self.get_role(nick) if role != actual_role: @@ -790,7 +790,7 @@ class GroupchatControl(ChatControlBase): self.get_command_help(command) return True elif command == 'msg': - # Send a message to a nick. Also opens a private message window. + # Send a message to a nick. Also opens a private message window. # example: /msg foo Hey, what's up? if len(message_array): message_array = message_array[0].split() @@ -871,7 +871,7 @@ class GroupchatControl(ChatControlBase): return True elif command == 'leave' or command == 'part' or command == 'close': # Leave the room and close the tab or window - # FIXME: Sometimes this doesn't actually leave the room. Why? + # FIXME: Sometimes this doesn't actually leave the room. Why? reason = 'offline' if len(message_array): reason = message_array.pop(0) @@ -1435,7 +1435,7 @@ class GroupchatControl(ChatControlBase): if props and self.tooltip.id == props[0]: # check if the current pointer is at the same path # as it was before setting the timeout - rect = self.list_treeview.get_cell_area(props[0],props[1]) + rect = self.list_treeview.get_cell_area(props[0],props[1]) position = self.list_treeview.window.get_origin() pointer = self.parent_win.window.get_pointer() self.tooltip.show_tooltip(contact, (0, rect.height), diff --git a/src/message_window.py b/src/message_window.py index f8f5225eb..fca893460 100644 --- a/src/message_window.py +++ b/src/message_window.py @@ -497,7 +497,10 @@ class MessageWindowMgr: return self.get_window(jid) def one_window_opened(self, contact, acct, type): - return self._windows[self._mode_to_key(contact, acct, type)] != None + try: + return self._windows[self._mode_to_key(contact, acct, type)] != None + except KeyError: + return False def _size_window(self, win, acct, type): '''Returns the size tuple: (width, height)''' @@ -566,11 +569,13 @@ class MessageWindowMgr: win = self._windows[key] except KeyError: win = self._new_window(win_acct, win_type) - self._windows[key] = win # Postion and size window based on saved state and window mode - self._position_window(win, acct, type) - self._size_window(win, acct, type) + if not self.one_window_opened(contact, acct, type): + self._position_window(win, acct, type) + self._size_window(win, acct, type) + + self._windows[key] = win return win def _on_window_delete(self, win, event): diff --git a/src/tooltips.py b/src/tooltips.py index 7a6577f22..5f2db2edf 100644 --- a/src/tooltips.py +++ b/src/tooltips.py @@ -244,7 +244,7 @@ class NotificationAreaTooltip(BaseTooltip, StatusTable): for acct in gajim.connections: # we count unread chat/pm messages for ctl in gajim.interface.msg_win_mgr.controls(): - c = gajim.contacts.get_first_contact_from_jid(acct, jid) + c = gajim.contacts.get_first_contact_from_jid(acct, ctl.contact.jid) if c: unread_chat += ctl.nb_unread else: |