/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/branchwin.py

  • Committer: Jelmer Vernooij
  • Date: 2007-07-15 18:12:57 UTC
  • Revision ID: jelmer@samba.org-20070715181257-g264qus2zyi3v39z
Add RevisionSelectionBox widget, use in TagDialog.

Show diffs side-by-side

added added

removed removed

Lines of Context:
172
172
                                   gobject.TYPE_PYOBJECT,
173
173
                                   str, str, str)
174
174
        self.index = {}
175
 
        self.set_title(branch.nick + " - bzrk")
176
 
        gobject.idle_add(self.populate_model, start, maxnum)
177
 
 
178
 
    def populate_model(self, start, maxnum):
179
175
        index = 0
180
 
        
 
176
 
181
177
        last_lines = []
182
178
        (self.revisions, colours, self.children, self.parent_ids,
183
 
            merge_sorted) = distances(self.branch.repository, start)
 
179
            merge_sorted) = distances(branch, start)
184
180
        for (index, (revision, node, lines)) in enumerate(graph(
185
181
                self.revisions, colours, merge_sorted)):
186
182
            # FIXME: at this point we should be able to show the graph order
197
193
            last_lines = lines
198
194
            if maxnum is not None and index > maxnum:
199
195
                break
 
196
 
 
197
        self.set_title(branch.nick + " - bzrk")
200
198
        self.treeview.set_model(self.model)
201
 
        return False
202
 
    
203
 
    
 
199
 
204
200
    def _treeview_cursor_cb(self, *args):
205
201
        """Callback for when the treeview cursor changes."""
206
202
        (path, col) = self.treeview.get_cursor()
208
204
 
209
205
        self.back_button.set_sensitive(len(self.parent_ids[revision]) > 0)
210
206
        self.fwd_button.set_sensitive(len(self.children[revision]) > 0)
211
 
        tags = []
212
 
        if self.branch.supports_tags():
213
 
            tagdict = self.branch.tags.get_reverse_tag_dict()
214
 
            if tagdict.has_key(revision.revision_id):
215
 
                tags = tagdict[revision.revision_id]
216
 
        self.logview.set_revision(revision, tags)
 
207
        self.logview.set_revision(revision)
217
208
 
218
209
    def _back_clicked_cb(self, *args):
219
210
        """Callback for when the back button is clicked."""