2
# -*- coding: UTF-8 -*-
5
This module contains the application object that manages the windows
6
on screen, and can be used to create new windows of various types.
9
__copyright__ = "Copyright © 2005 Canonical Ltd."
10
__author__ = "Scott James Remnant <scott@ubuntu.com>"
18
from branchwin import BranchWindow
21
class BzrkApp(object):
22
"""Application manager.
24
This object manages the bzrk application, creating and managing
25
individual branch windows and ensuring the application exits when
26
the last window is closed.
32
def show(self, branch, start):
33
"""Open a new window to show the given branch."""
34
self._num_windows += 1
36
window = BranchWindow()
37
window.set_branch(branch, start)
38
window.connect("destroy", self._destroy_cb)
41
def _destroy_cb(self, widget):
42
"""Callback for when a window we manage is destroyed."""
43
self._num_windows -= 1
44
if self._num_windows <= 0:
48
"""Start the GTK+ main loop."""
52
"""Stop the GTK+ main loop."""