Two roster sort fixes.

* Change metacontact ordering. Fallback to priority only if two contacts have the same show, not the other way round.
 * Move contacts that just signed out to the bottom of the group, not to the top.
This commit is contained in:
Stephan Erb 2008-06-15 23:03:51 +00:00
parent ca457a7ac2
commit c5f7922e29
2 changed files with 10 additions and 8 deletions

View File

@ -473,14 +473,14 @@ class Contacts:
return 1
if transport1 and not transport2:
return -1
if priority1 > priority2:
return 1
if priority2 > priority1:
return -1
if show1 > show2:
return 1
if show2 > show1:
return -1
if priority1 > priority2:
return 1
if priority2 > priority1:
return -1
server1 = common.gajim.get_server_from_jid(jid1)
server2 = common.gajim.get_server_from_jid(jid2)
myserver1 = common.gajim.config.get_per('accounts', account1, 'hostname')

View File

@ -1031,7 +1031,6 @@ class RosterWindow:
if have_visible_children:
# We are the big brother and have a visible family
# that is not just us
for child_iter in child_iters:
path = self.model.get_path(child_iter)
@ -1058,10 +1057,11 @@ class RosterWindow:
self.model[child_iter][C_IMG] = img
self.model[child_iter][C_NAME] = name
else:
# All iters have the same icon (no expand/collapse)
# A normal contact or little brother
state_images = self.get_appropriate_state_images(jid,
icon_name = icon_name)
# All iters have the same icon (no expand/collapse)
img = state_images[icon_name]
for child_iter in child_iters:
self.model[child_iter][C_IMG] = img
@ -1413,9 +1413,9 @@ class RosterWindow:
if show2 == 6 and jid2 in gajim.to_be_removed[account2]:
removing2 = True
if removing1 and not removing2:
return -1
if removing2 and not removing1:
return 1
if removing2 and not removing1:
return -1
if show1 < show2:
return -1
elif show1 > show2:
@ -3343,6 +3343,7 @@ class RosterWindow:
jid = model[titer][C_JID].decode('utf-8')
account = model[titer][C_ACCOUNT].decode('utf-8')
self.draw_contact(jid, account)
# FIXME redraw child contacts
self._toggeling_row = False
@ -3378,6 +3379,7 @@ class RosterWindow:
jid = model[titer][C_JID].decode('utf-8')
account = model[titer][C_ACCOUNT].decode('utf-8')
self.draw_contact(jid, account)
# FIXME redraw child contacts
self._toggeling_row = False