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

  • Committer: Jelmer Vernooij
  • Date: 2007-01-29 23:42:57 UTC
  • Revision ID: jelmer@samba.org-20070129234257-2hwjsa2un4hg0ztv
Actually use the ui factory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
    return pygtk
36
36
 
37
37
 
 
38
def set_ui_factory():
 
39
    pygtk = import_pygtk()
 
40
    from olive.ui import GtkUIFactory
 
41
    import bzrlib.ui
 
42
    bzrlib.ui.ui_factory = GtkUIFactory()
 
43
 
 
44
 
38
45
class cmd_gbranch(Command):
39
46
    """GTK+ branching.
40
47
    
50
57
 
51
58
        from bzrlib.plugins.gtk.olive.branch import BranchDialog
52
59
 
 
60
        set_ui_factory()
53
61
        window = BranchDialog('.')
54
62
        window.display()
55
63
 
65
73
 
66
74
    @display_command
67
75
    def run(self, revision=None, filename=None):
 
76
        set_ui_factory()
68
77
        wt = WorkingTree.open_containing(".")[0]
69
78
        branch = wt.branch
70
79
        if revision is not None:
119
128
    aliases = [ "visualize", "vis", "viz" ]
120
129
 
121
130
    def run(self, location=".", revision=None, limit=None):
 
131
        set_ui_factory()
122
132
        (branch, path) = Branch.open_containing(location)
123
133
        branch.lock_read()
124
134
        branch.repository.lock_read()
166
176
        except RuntimeError, e:
167
177
            if str(e) == "could not open display":
168
178
                raise NoDisplayError
 
179
        set_ui_factory()
169
180
 
170
181
        try:
171
182
            line = int(line)
229
240
            if str(e) == "could not open display":
230
241
                raise NoDisplayError
231
242
 
 
243
        set_ui_factory()
232
244
        from olive.commit import CommitDialog
233
245
        from bzrlib.commit import Commit
234
246
        from bzrlib.errors import (BzrCommandError,
263
275
    """gtk could not find a proper display"""
264
276
 
265
277
    def __str__(self):
266
 
        return "No DISPLAY. gannotate is disabled."
 
278
        return "No DISPLAY. Unable to run GTK+ application."
 
279
 
 
280