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

  • Committer: Jelmer Vernooij
  • Date: 2006-05-19 18:59:23 UTC
  • Revision ID: jelmer@samba.org-20060519185923-fa9110fd5448b4d6
Rework some of the parameters to DiffWindow.set_diff() to be 
more usable to other code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    differences between two revisions on a branch.
33
33
    """
34
34
 
35
 
    def __init__(self, app=None):
 
35
    def __init__(self):
36
36
        gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
37
37
        self.set_border_width(0)
38
38
        self.set_title("bzrk diff")
39
39
 
40
 
        self.app = app
41
 
 
42
40
        # Use two thirds of the screen by default
43
41
        screen = self.get_screen()
44
42
        monitor = screen.get_monitor_geometry(0)
100
98
        scrollwin.add(sourceview)
101
99
        sourceview.show()
102
100
 
103
 
    def set_diff(self, branch, revid, parentid):
 
101
    def set_diff(self, description, rev_tree, parent_tree):
104
102
        """Set the differences showed by this window.
105
103
 
106
104
        Compares the two trees and populates the window with the
107
105
        differences.
108
106
        """
109
 
        self.rev_tree = branch.repository.revision_tree(revid)
110
 
        self.parent_tree = branch.repository.revision_tree(parentid)
 
107
        self.rev_tree = rev_tree
 
108
        self.parent_tree = parent_tree
111
109
 
112
110
        self.model.clear()
113
111
        delta = compare_trees(self.parent_tree, self.rev_tree)
136
134
                self.model.append(titer, [ path, path ])
137
135
 
138
136
        self.treeview.expand_all()
139
 
        self.set_title(revid + " - " + branch.nick + " - bzrk diff")
 
137
        self.set_title(description + " - bzrk diff")
140
138
 
141
139
    def _treeview_cursor_cb(self, *args):
142
140
        """Callback for when the treeview cursor changes."""