Fix up, look sharp

This commit is contained in:
Travis Shirk 2006-01-09 00:47:54 +00:00
parent a6bdc39d5d
commit 2a794ba19e
4 changed files with 17 additions and 12 deletions

View file

@ -965,7 +965,7 @@ class Interface:
'''SIGNED_IN event is emitted when we sign in, so handle it''' '''SIGNED_IN event is emitted when we sign in, so handle it'''
# join already open groupchats # join already open groupchats
for gc_control in gajim.interface.msg_win_mgr.get_controls(message_control.TYPE_GC): 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]: if gajim.gc_connected[account][room_jid]:
continue continue
room, server = gajim.get_room_name_and_server_from_room_jid(room_jid) room, server = gajim.get_room_name_and_server_from_room_jid(room_jid)

View file

@ -497,7 +497,10 @@ class MessageWindowMgr:
return self.get_window(jid) return self.get_window(jid)
def one_window_opened(self, contact, acct, type): def one_window_opened(self, contact, acct, type):
try:
return self._windows[self._mode_to_key(contact, acct, type)] != None return self._windows[self._mode_to_key(contact, acct, type)] != None
except KeyError:
return False
def _size_window(self, win, acct, type): def _size_window(self, win, acct, type):
'''Returns the size tuple: (width, height)''' '''Returns the size tuple: (width, height)'''
@ -566,11 +569,13 @@ class MessageWindowMgr:
win = self._windows[key] win = self._windows[key]
except KeyError: except KeyError:
win = self._new_window(win_acct, win_type) win = self._new_window(win_acct, win_type)
self._windows[key] = win
# Postion and size window based on saved state and window mode # Postion and size window based on saved state and window mode
if not self.one_window_opened(contact, acct, type):
self._position_window(win, acct, type) self._position_window(win, acct, type)
self._size_window(win, acct, type) self._size_window(win, acct, type)
self._windows[key] = win
return win return win
def _on_window_delete(self, win, event): def _on_window_delete(self, win, event):

View file

@ -244,7 +244,7 @@ class NotificationAreaTooltip(BaseTooltip, StatusTable):
for acct in gajim.connections: for acct in gajim.connections:
# we count unread chat/pm messages # we count unread chat/pm messages
for ctl in gajim.interface.msg_win_mgr.controls(): 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: if c:
unread_chat += ctl.nb_unread unread_chat += ctl.nb_unread
else: else: