/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to branchview/treemodel.py

Merged Ali's fancy tags branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
REVISION = 9
28
28
PARENTS = 10
29
29
CHILDREN = 11
 
30
TAGS = 12
30
31
 
31
32
class TreeModel(gtk.GenericTreeModel):
32
33
 
33
34
    
34
 
    def __init__ (self, repository, line_graph_data):
 
35
    def __init__ (self, branch, line_graph_data):
35
36
        gtk.GenericTreeModel.__init__(self)
36
37
        self.revisions = {}
37
 
        self.repository = repository
 
38
        self.branch = branch
 
39
        self.repository = branch.repository
38
40
        self.line_graph_data = line_graph_data
 
41
 
 
42
        if self.branch.supports_tags():
 
43
            self.tags = self.branch.tags.get_reverse_tag_dict()
 
44
        else:
 
45
            self.tags = {}
39
46
    
40
47
    def on_get_flags(self):
41
48
        return gtk.TREE_MODEL_LIST_ONLY
42
49
    
43
50
    def on_get_n_columns(self):
44
 
        return 12
 
51
        return 13
45
52
    
46
53
    def on_get_column_type(self, index):
47
54
        if index == REVID: return gobject.TYPE_STRING
56
63
        if index == REVISION: return gobject.TYPE_PYOBJECT
57
64
        if index == PARENTS: return gobject.TYPE_PYOBJECT
58
65
        if index == CHILDREN: return gobject.TYPE_PYOBJECT
 
66
        if index == TAGS: return gobject.TYPE_PYOBJECT
59
67
        
60
68
    def on_get_iter(self, path):
61
69
        return path[0]
83
91
        if column == REVNO: return ".".join(["%d" % (revno)
84
92
                                      for revno in revno_sequence])
85
93
        
 
94
        if column == TAGS: return self.tags.get(revid, [])
 
95
 
86
96
        if revid is None:
87
97
            return None
88
98
        if revid not in self.revisions: