diff --git a/src/gui_interface.py b/src/gui_interface.py index e10011cfe..1fb6c3043 100644 --- a/src/gui_interface.py +++ b/src/gui_interface.py @@ -3246,8 +3246,10 @@ class Interface: self.show_systray() self.roster = roster_window.RosterWindow() + self.roster._before_fill() for account in gajim.connections: gajim.connections[account].load_roster_from_db() + self.roster._after_fill() # get instances for windows/dialogs that will show_all()/hide() self.instances['file_transfers'] = dialogs.FileTransfersWindow() diff --git a/src/roster_window.py b/src/roster_window.py index f50b3dc9f..05c1c4286 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -284,7 +284,6 @@ class RosterWindow: self.starting = True jids = gajim.contacts.get_jid_list(account) - self.tree.freeze_child_notify() for jid in jids: self.add_contact(jid, account) @@ -298,7 +297,6 @@ class RosterWindow: self.draw_group(group, account) self.draw_account(account) - self.tree.thaw_child_notify() self.starting = False @@ -1364,6 +1362,17 @@ class RosterWindow: task = _draw_all_contacts(jids, account) gobject.idle_add(task.next) + def _before_fill(self): + self.tree.freeze_child_notify() + self.tree.set_model(None) + # disable sorting + self.model.set_sort_column_id(-2, gtk.SORT_ASCENDING) + + def _after_fill(self): + self.model.set_sort_column_id(1, gtk.SORT_ASCENDING) + self.tree.set_model(self.modelfilter) + self.tree.thaw_child_notify() + def setup_and_draw_roster(self): """ Create new empty model and draw roster