/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 viz/treeview.py

  • Committer: John Arbash Meinel
  • Date: 2007-11-02 22:29:12 UTC
  • mfrom: (330 trunk)
  • mto: (330.3.3 trunk)
  • mto: This revision was merged to the branch mainline in revision 368.
  • Revision ID: john@arbash-meinel.com-20071102222912-ei8ll3bla3w2h2gp
Merge in trunk, and update logview per-file commit messages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
                                  ())
30
30
    }
31
31
 
32
 
    def __init__(self, branch, start, maxnum):
 
32
    def __init__(self, branch, start, maxnum, broken_line_length=None):
33
33
        """Create a new TreeView.
34
34
 
35
35
        :param branch: Branch object for branch to show.
36
36
        :param start: Revision id of top revision.
37
37
        :param maxnum: Maximum number of revisions to display, 
38
38
                       None for no limit.
 
39
        :param broken_line_length: After how much lines to break 
 
40
                                   branches.
39
41
        """
40
42
        gtk.ScrolledWindow.__init__(self)
41
43
 
47
49
        self.branch = branch
48
50
        self.branch.lock_read()
49
51
 
50
 
        gobject.idle_add(self.populate, start, maxnum)
 
52
        gobject.idle_add(self.populate, start, maxnum, 
 
53
                         broken_line_length)
51
54
 
52
55
        self.revision = None
53
56
        self.children = None
117
120
            self.treeview.set_cursor(self.index[children[0]])
118
121
        self.treeview.grab_focus()
119
122
 
120
 
    def populate(self, start, maxnum):
 
123
    def populate(self, start, maxnum, broken_line_length=None):
121
124
        """Fill the treeview with contents.
122
125
 
123
126
        :param start: Revision id of revision to start with.
124
127
        :param maxnum: Maximum number of revisions to display, or None 
125
128
                       for no limit.
 
129
        :param broken_line_length: After how much lines branches \
 
130
                       should be broken.
126
131
        """
127
 
        (linegraphdata, index, columns_len) = linegraph(self.branch,
 
132
        (linegraphdata, index, columns_len) = linegraph(self.branch.repository,
128
133
                                                        start,
129
 
                                                        maxnum)
 
134
                                                        maxnum, 
 
135
                                                        broken_line_length)
130
136
 
131
 
        self.model = TreeModel(self.branch, linegraphdata)
 
137
        self.model = TreeModel(self.branch.repository, linegraphdata)
132
138
        self.graph_cell.columns_len = columns_len
133
139
        width = self.graph_cell.get_size(self.treeview)[2]
134
140
        self.graph_column.set_fixed_width(width)