Show
Ignore:
Timestamp:
02/15/07 19:05:38 (22 months ago)
Author:
asterix
Message:

mrege diff from trunk

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/gajim_0.11/src/disco.py

    r7888 r7984  
    17251725                ''' Create treemodel for the window. ''' 
    17261726                # JID, node, name (with description) - pango markup, dont have info?, subscribed? 
    1727                 model = gtk.ListStore(str, str, str, bool, bool) 
    1728                 model.set_sort_column_id(3, gtk.SORT_ASCENDING) 
    1729                 self.window.services_treeview.set_model(model) 
     1727                self.model = gtk.ListStore(str, str, str, bool, bool) 
     1728                self.model.set_sort_column_id(3, gtk.SORT_ASCENDING) 
     1729                self.window.services_treeview.set_model(self.model) 
    17301730 
    17311731                # Name column 
     
    17491749                self.window.services_treeview.set_headers_visible(True) 
    17501750 
    1751         def _add_item(self, model, jid, node, item, force): 
     1751        def _add_item(self, jid, node, item, force): 
    17521752                ''' Called when we got basic information about new node from query. 
    17531753                Show the item. ''' 
     
    17561756                if self.subscriptions is not None: 
    17571757                        dunno = False 
    1758                         subscribed = name in self.subscriptions 
     1758                        subscribed = node in self.subscriptions 
    17591759                else: 
    17601760                        dunno = True 
     
    17641764                name = '<b>%s</b>' % name 
    17651765 
    1766                 model.append((jid, node, name, dunno, subscribed)) 
     1766                self.model.append((jid, node, name, dunno, subscribed)) 
    17671767 
    17681768        def _add_actions(self): 
     
    18461846                ''' We got the subscribed groups list stanza. Now, if we already 
    18471847                have items on the list, we should actualize them. ''' 
    1848                 print 0 
    18491848                try: 
    18501849                        subscriptions = request.getTag('pubsub').getTag('subscriptions') 
     
    18521851                        return  
    18531852 
    1854                 print 1 
    18551853                groups = set() 
    18561854                for child in subscriptions.getTags('subscription'): 
    1857                         print 2, repr(child), str(child) 
    18581855                        groups.add(child['node']) 
    1859                 print 3, groups 
    18601856 
    18611857                self.subscriptions = groups 
     
    18631859                # try to setup existing items in model 
    18641860                model = self.window.services_treeview.get_model() 
    1865                 print 4 
    18661861                for row in model: 
    1867                         print 5 
    18681862                        # 1 = group node 
    18691863                        # 3 = insensitive checkbox for subscribed 
     
    18721866                        row[3]=False 
    18731867                        row[4]=groupnode in groups 
    1874                 print 6 
    18751868 
    18761869                # we now know subscriptions, update button states