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
19
from diffwin import DiffWindow
22
class BzrkApp(object):
23
"""Application manager.
25
This object manages the bzrk application, creating and managing
26
individual branch windows and ensuring the application exits when
27
the last window is closed.
30
def show(self, branch, start, maxnum):
31
"""Open a new window to show the given branch."""
32
window = BranchWindow(self)
33
window.set_branch(branch, start, maxnum)
34
window.connect("destroy", self._destroy_cb)
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)
43
def _destroy_cb(self, widget):
44
"""Callback for when a window we manage is destroyed."""
48
"""Start the GTK+ main loop."""
52
"""Stop the GTK+ main loop."""