27
26
the last window is closed.
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)
38
self._num_windows += 1
32
window.set_branch(branch, start, maxnum)
39
33
window.connect("destroy", self._destroy_cb)
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)
47
self._num_windows += 1
48
window.connect("destroy", self._destroy_cb)
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)
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:
58
50
"""Start the GTK+ main loop."""