/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: Vincent Ladeuil
  • Date: 2008-05-05 18:16:46 UTC
  • mto: (487.1.1 gtk)
  • mto: This revision was merged to the branch mainline in revision 490.
  • Revision ID: v.ladeuil+lp@free.fr-20080505181646-n95l8ltw2u6jtr26
Fix bug #187283 fix replacing _() by _i18n().

* genpot.sh 
Remove duplication. Add the ability to specify the genrated pot
file on command-line for debugging purposes.

* po/olive-gtk.pot:
Regenerated.

* __init__.py, branch.py, branchview/treeview.py, checkout.py,
commit.py, conflicts.py, diff.py, errors.py, initialize.py,
merge.py, nautilus-bzr.py, olive/__init__.py, olive/add.py,
olive/bookmark.py, olive/guifiles.py, olive/info.py,
olive/menu.py, olive/mkdir.py, olive/move.py, olive/remove.py,
olive/rename.py, push.py, revbrowser.py, status.py, tags.py:
Replace all calls to _() by calls to _i18n(), the latter being
defined in __init__.py and imported in the other modules from
there. This fix the problem encountered countless times when
running bzr selftest and getting silly error messages about
boolean not being callables.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*- coding: UTF-8 -*-
2
 
"""Application object.
3
 
 
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.
6
 
"""
7
 
 
8
 
__copyright__ = "Copyright © 2005 Canonical Ltd."
9
 
__author__    = "Scott James Remnant <scott@ubuntu.com>"
10
 
 
11
 
 
12
 
import pygtk
13
 
pygtk.require("2.0")
14
 
 
15
 
import gtk
16
 
 
17
 
from branchwin import BranchWindow
18
 
from diffwin import DiffWindow
19
 
 
20
 
 
21
 
class BzrkApp(object):
22
 
    """Application manager.
23
 
 
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.
27
 
    """
28
 
 
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)
34
 
        window.show()
35
 
 
36
 
    def show_diff(self, branch, revid, parentid):
37
 
        """Open a new window to show a diff between the given revisions."""
38
 
        window = DiffWindow()
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)
43
 
        window.show()
44
 
 
45
 
    def _destroy_cb(self, widget):
46
 
        """Callback for when a window we manage is destroyed."""
47
 
        self.quit()
48
 
 
49
 
    def main(self):
50
 
        """Start the GTK+ main loop."""
51
 
        gtk.main()
52
 
 
53
 
    def quit(self):
54
 
        """Stop the GTK+ main loop."""
55
 
        gtk.main_quit()