/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 nautilus-bzr.py

  • Committer: Jelmer Vernooij
  • Date: 2006-10-08 21:57:40 UTC
  • Revision ID: jelmer@samba.org-20061008215740-bfff224681da2d64
Some update to TODO.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Trivial Bazaar plugin for Nautilus
2
 
#
3
 
# Copyright (C) 2006 Jeff Bailey
4
 
# Copyright (C) 2006 Wouter van Heyst
5
 
# Copyright (C) 2006 Jelmer Vernooij
6
 
#
7
 
# Published under the GNU GPL
8
 
 
9
1
import nautilus
10
2
import bzrlib
11
3
from bzrlib.bzrdir import BzrDir
78
70
        except NotBranchError:
79
71
            return
80
72
 
81
 
        from bzrlib.plugins.gtk.viz.diff import DiffWindow
 
73
        from bzrlib.plugins.gtk.viz.diffwin import DiffWindow
82
74
        window = DiffWindow()
83
75
        window.set_diff(tree.branch.nick, tree, tree.branch.basis_tree())
84
76
        window.show()
126
118
        if vfs_file.get_uri_scheme() != 'file':
127
119
            return
128
120
 
129
 
        from bzrlib.plugins.gtk.branch import BranchDialog
 
121
        from bzrlib.plugins.gtk.olive.branch import BranchDialog
130
122
        
131
123
        dialog = BranchDialog(vfs_file.get_name())
132
124
        dialog.display()
142
134
        except NotBranchError:
143
135
            return
144
136
 
145
 
        from bzrlib.plugins.gtk.commit import CommitDialog
 
137
        from bzrlib.plugins.gtk.olive.commit import CommitDialog
146
138
        dialog = CommitDialog(tree, path)
147
139
        dialog.display()
148
140
        gtk.main()
165
157
 
166
158
        return
167
159
 
168
 
    def pull_cb(self, menu, vfs_file):
169
 
        # We can only cope with local files
170
 
        if vfs_file.get_uri_scheme() != 'file':
171
 
            return
172
 
 
173
 
        file = vfs_file.get_uri()
174
 
 
175
 
        # We only want to continue here if we get a NotBranchError
176
 
        try:
177
 
            tree, path = WorkingTree.open_containing(file)
178
 
        except NotBranchError:
179
 
            return
180
 
 
181
 
        from bzrlib.plugins.gtk.pull import PullDialog
182
 
        dialog = PullDialog(tree, path)
183
 
        dialog.display()
184
 
        gtk.main()
185
 
 
186
 
    def merge_cb(self, menu, vfs_file):
187
 
        # We can only cope with local files
188
 
        if vfs_file.get_uri_scheme() != 'file':
189
 
            return
190
 
 
191
 
        file = vfs_file.get_uri()
192
 
 
193
 
        # We only want to continue here if we get a NotBranchError
194
 
        try:
195
 
            tree, path = WorkingTree.open_containing(file)
196
 
        except NotBranchError:
197
 
            return
198
 
 
199
 
        from bzrlib.plugins.gtk.merge import MergeDialog
200
 
        dialog = MergeDialog(tree, path)
201
 
        dialog.display()
202
 
        gtk.main()
203
 
 
204
160
    def get_background_items(self, window, vfs_file):
205
161
        items = []
206
162
        file = vfs_file.get_uri()
227
183
        item.connect('activate', self.log_cb, vfs_file)
228
184
        items.append(item)
229
185
 
230
 
        item = nautilus.MenuItem('BzrNautilus::pull',
231
 
                             'Pull',
232
 
                             'Pull from another branch')
233
 
        item.connect('activate', self.pull_cb, vfs_file)
234
 
        items.append(item)
235
 
 
236
 
        item = nautilus.MenuItem('BzrNautilus::merge',
237
 
                             'Merge',
238
 
                             'Merge from another branch')
239
 
        item.connect('activate', self.merge_cb, vfs_file)
240
 
        items.append(item)
241
 
 
242
186
        item = nautilus.MenuItem('BzrNautilus::commit',
243
187
                             'Commit',
244
188
                             'Commit Changes')