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

  • Committer: Scott James Remnant
  • Date: 2005-10-18 12:21:57 UTC
  • Revision ID: scott@netsplit.com-20051018122157-db7d208194d492bf
stop managing windows so much, just quit when the viz window is closed
and close all the diff windows too

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
    the last window is closed.
28
28
    """
29
29
 
30
 
    def __init__(self):
31
 
        self._num_windows = 0
32
 
 
33
30
    def show(self, branch, start):
34
31
        """Open a new window to show the given branch."""
35
32
        window = BranchWindow(self)
36
33
        window.set_branch(branch, start)
37
 
 
38
 
        self._num_windows += 1
39
34
        window.connect("destroy", self._destroy_cb)
40
35
        window.show()
41
36
 
43
38
        """Open a new window to show a diff between the given revisions."""
44
39
        window = DiffWindow(self)
45
40
        window.set_diff(branch, revid, parentid)
46
 
 
47
 
        self._num_windows += 1
48
 
        window.connect("destroy", self._destroy_cb)
49
41
        window.show()
50
42
 
51
43
    def _destroy_cb(self, widget):
52
44
        """Callback for when a window we manage is destroyed."""
53
 
        self._num_windows -= 1
54
 
        if self._num_windows <= 0:
55
 
            self.quit()
 
45
        self.quit()
56
46
 
57
47
    def main(self):
58
48
        """Start the GTK+ main loop."""