1
# -*- coding: UTF-8 -*-
4
This module contains the application object that manages the windows
5
on screen, and can be used to create new windows of various types.
8
__copyright__ = "Copyright © 2005 Canonical Ltd."
9
__author__ = "Scott James Remnant <scott@ubuntu.com>"
17
from branchwin import BranchWindow
18
from diffwin import DiffWindow
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.
29
def show(self, branch, start, maxnum):
30
"""Open a new window to show the given branch."""
31
window = BranchWindow(self)
32
window.set_branch(branch, start, maxnum)
33
window.connect("destroy", self._destroy_cb)
36
def show_diff(self, branch, revid, parentid):
37
"""Open a new window to show a diff between the given revisions."""
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)
45
def _destroy_cb(self, widget):
46
"""Callback for when a window we manage is destroyed."""
50
"""Start the GTK+ main loop."""
54
"""Stop the GTK+ main loop."""