Fix up, look sharp
This commit is contained in:
parent
a6bdc39d5d
commit
2a794ba19e
4 changed files with 17 additions and 12 deletions
|
@ -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)
|
||||||
|
|
|
@ -232,7 +232,7 @@ class GroupchatControl(ChatControlBase):
|
||||||
self.draw_contact(nick, selected=True, focus=True)
|
self.draw_contact(nick, selected=True, focus=True)
|
||||||
|
|
||||||
def get_tab_label(self, chatstate):
|
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)
|
(new_label_str, color)
|
||||||
either of which can be None
|
either of which can be None
|
||||||
if chatstate is given that means we have HE SENT US a chatstate'''
|
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,
|
color = gajim.config.get_per('themes', theme,
|
||||||
'state_active_color')
|
'state_active_color')
|
||||||
elif chatstate == 'newmsg' and (not has_focus or not current_tab) and\
|
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')
|
color = gajim.config.get_per('themes', theme, 'state_muc_msg')
|
||||||
if color:
|
if color:
|
||||||
color = gtk.gdk.colormap_get_system().alloc_color(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,
|
iter = self.add_contact_to_roster(nick, show, role,
|
||||||
affiliation, status, jid)
|
affiliation, status, jid)
|
||||||
if statusCode == '201': # We just created the room
|
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:
|
else:
|
||||||
actual_role = self.get_role(nick)
|
actual_role = self.get_role(nick)
|
||||||
if role != actual_role:
|
if role != actual_role:
|
||||||
|
@ -790,7 +790,7 @@ class GroupchatControl(ChatControlBase):
|
||||||
self.get_command_help(command)
|
self.get_command_help(command)
|
||||||
return True
|
return True
|
||||||
elif command == 'msg':
|
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?
|
# example: /msg foo Hey, what's up?
|
||||||
if len(message_array):
|
if len(message_array):
|
||||||
message_array = message_array[0].split()
|
message_array = message_array[0].split()
|
||||||
|
@ -871,7 +871,7 @@ class GroupchatControl(ChatControlBase):
|
||||||
return True
|
return True
|
||||||
elif command == 'leave' or command == 'part' or command == 'close':
|
elif command == 'leave' or command == 'part' or command == 'close':
|
||||||
# Leave the room and close the tab or window
|
# 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'
|
reason = 'offline'
|
||||||
if len(message_array):
|
if len(message_array):
|
||||||
reason = message_array.pop(0)
|
reason = message_array.pop(0)
|
||||||
|
@ -1435,7 +1435,7 @@ class GroupchatControl(ChatControlBase):
|
||||||
if props and self.tooltip.id == props[0]:
|
if props and self.tooltip.id == props[0]:
|
||||||
# check if the current pointer is at the same path
|
# check if the current pointer is at the same path
|
||||||
# as it was before setting the timeout
|
# 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()
|
position = self.list_treeview.window.get_origin()
|
||||||
pointer = self.parent_win.window.get_pointer()
|
pointer = self.parent_win.window.get_pointer()
|
||||||
self.tooltip.show_tooltip(contact, (0, rect.height),
|
self.tooltip.show_tooltip(contact, (0, rect.height),
|
||||||
|
|
|
@ -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):
|
||||||
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):
|
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
|
||||||
self._position_window(win, acct, type)
|
if not self.one_window_opened(contact, acct, type):
|
||||||
self._size_window(win, acct, type)
|
self._position_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):
|
||||||
|
|
|
@ -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:
|
||||||
|
|
Loading…
Add table
Reference in a new issue