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

  • Committer: Aaron Bentley
  • Date: 2007-01-17 06:42:55 UTC
  • mto: This revision was merged to the branch mainline in revision 129.
  • Revision ID: aaron.bentley@utoronto.ca-20070117064255-x4gznz5e0lyjq3gk
Remove usused span selector

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/python
2
1
# -*- coding: UTF-8 -*-
3
2
"""Application object.
4
3
 
27
26
    the last window is closed.
28
27
    """
29
28
 
30
 
    def __init__(self):
31
 
        self._num_windows = 0
32
 
 
33
 
    def show(self, branch, start):
 
29
    def show(self, branch, start, maxnum):
34
30
        """Open a new window to show the given branch."""
35
31
        window = BranchWindow(self)
36
 
        window.set_branch(branch, start)
37
 
 
38
 
        self._num_windows += 1
 
32
        window.set_branch(branch, start, maxnum)
39
33
        window.connect("destroy", self._destroy_cb)
40
34
        window.show()
41
35
 
42
36
    def show_diff(self, branch, revid, parentid):
43
37
        """Open a new window to show a diff between the given revisions."""
44
 
        window = DiffWindow(self)
45
 
        window.set_diff(branch, revid, parentid)
46
 
 
47
 
        self._num_windows += 1
48
 
        window.connect("destroy", self._destroy_cb)
 
38
        window = DiffWindow()
 
39
        rev_tree = branch.repository.revision_tree(revid)
 
40
        parent_tree = branch.repository.revision_tree(parentid)
 
41
        description = revid + " - " + branch.nick
 
42
        window.set_diff(description, rev_tree, parent_tree)
49
43
        window.show()
50
44
 
51
45
    def _destroy_cb(self, widget):
52
46
        """Callback for when a window we manage is destroyed."""
53
 
        self._num_windows -= 1
54
 
        if self._num_windows <= 0:
55
 
            self.quit()
 
47
        self.quit()
56
48
 
57
49
    def main(self):
58
50
        """Start the GTK+ main loop."""