Changeset 9840

Show
Ignore:
Timestamp:
06/25/08 15:15:05 (5 months ago)
Author:
steve-e
Message:

Various roster_window and modelfilter fixes.

  • Do not double escape group names
  • Try to remove SelfContact? on disconnect only once
  • Do not show minimized groupchats which were minimized after disconnect
  • Always reset group expand state after adding a contact to roster.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/roster_window.py

    r9839 r9840  
    490490                # Remove childs first then big brother 
    491491                family_in_roster = False 
     492                big_brother_jid = None 
    492493                for data in nearby_family: 
    493494                        _account = data['account'] 
     
    522523                if not family_in_roster: 
    523524                        return False 
    524  
     525         
     526                assert old_big_jid, 'No Big Brother in nearby family % (Family: %)' % \ 
     527                        (nearby_family, family) 
    525528                iters = self._get_contact_iter(old_big_jid, old_big_account, 
    526529                        old_big_contact, self.model) 
     
    666669                        for group in contact.get_shown_groups(): 
    667670                                self.draw_group(group, account) 
     671                                self._adjust_group_expand_collapse_state(group, account) 
    668672                        self.draw_account(account) 
    669673 
     
    729733                contact = gajim.contacts.get_contact_with_highest_priority(account, jid) 
    730734                if contact is None: 
     735                        # Do not show gc if we are disconnected and minimize it 
     736                        if gajim.account_is_connected(account): 
     737                                show = 'online' 
     738                        else:  
     739                                show = 'offline' 
     740                                status = '' 
    731741                        contact = gajim.contacts.create_contact(jid = jid, name = jid, 
    732                                 groups = [_('Groupchats')], show = 'online', 
     742                                groups = [_('Groupchats')], show = show, 
    733743                                status = status, sub = 'none') 
    734744                        gajim.contacts.add_contact(account, contact) 
     
    736746                else: 
    737747                        contact.show = 'online' 
    738                         self.draw_contact(jid, account) 
     748                        self.draw_completely_and_show_if_needed(jid, account) 
    739749                return contact 
    740750 
     
    923933                        text += ' (%s/%s)' % (repr(nbr_on), repr(nbr_total)) 
    924934 
    925                 self.model[child_iter][C_NAME] = gobject.markup_escape_text(text) 
     935                self.model[child_iter][C_NAME] = text 
    926936                return False 
    927937 
     
    18731883                                        c.is_transport())]: 
    18741884                                                self.chg_contact_status(contact, 'offline', '', account) 
    1875                                 # Remove SelfContact from roster and remove it. 
    1876                                 # It might be gone when we return 
    1877                                 self_jid = gajim.get_jid_from_account(account) 
    1878                                 self.remove_contact(self_jid, account, backend = True) 
    18791885                        self.actions_menu_needs_rebuild = True 
    18801886                self.update_status_combobox() 
     
    26452651                del gajim.interface.minimized_controls[account][jid] 
    26462652                ctrl.shutdown() 
    2647  
    26482653                self.remove_groupchat(jid, account) 
    26492654