/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: Jelmer Vernooij
  • Date: 2007-10-31 02:18:28 UTC
  • Revision ID: jelmer@samba.org-20071031021828-8xid6b5xmv1p8d53
Make broken_line_length setting from higher up.

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
132
        (linegraphdata, index, columns_len) = linegraph(self.branch.repository,
128
133
                                                        start,
129
 
                                                        maxnum)
 
134
                                                        maxnum, 
 
135
                                                        broken_line_length)
130
136
 
131
137
        self.model = TreeModel(self.branch.repository, linegraphdata)
132
138
        self.graph_cell.columns_len = columns_len