/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: Jelmer Vernooij
  • Date: 2006-05-19 16:37:13 UTC
  • Revision ID: jelmer@samba.org-20060519163713-be77b31c72cbc7e8
Move visualisation code to a separate directory, preparing for bundling 
the GTK+ plugins for bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
import gtk
17
17
 
18
18
from branchwin import BranchWindow
 
19
from diffwin import DiffWindow
19
20
 
20
21
 
21
22
class BzrkApp(object):
26
27
    the last window is closed.
27
28
    """
28
29
 
29
 
    def __init__(self):
30
 
        self._num_windows = 0
31
 
 
32
 
    def show(self, branch, start):
 
30
    def show(self, branch, start, maxnum):
33
31
        """Open a new window to show the given branch."""
34
 
        self._num_windows += 1
35
 
 
36
 
        window = BranchWindow()
37
 
        window.set_branch(branch, start)
 
32
        window = BranchWindow(self)
 
33
        window.set_branch(branch, start, maxnum)
38
34
        window.connect("destroy", self._destroy_cb)
39
35
        window.show()
40
36
 
 
37
    def show_diff(self, branch, revid, parentid):
 
38
        """Open a new window to show a diff between the given revisions."""
 
39
        window = DiffWindow(self)
 
40
        window.set_diff(branch, revid, parentid)
 
41
        window.show()
 
42
 
41
43
    def _destroy_cb(self, widget):
42
44
        """Callback for when a window we manage is destroyed."""
43
 
        self._num_windows -= 1
44
 
        if self._num_windows <= 0:
45
 
            self.quit()
 
45
        self.quit()
46
46
 
47
47
    def main(self):
48
48
        """Start the GTK+ main loop."""