/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: 2008-06-29 19:07:23 UTC
  • mto: This revision was merged to the branch mainline in revision 515.
  • Revision ID: jelmer@samba.org-20080629190723-l8mzg9x4oec0lhsl
Return cleartext from seahorse module

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
from bzrlib.plugin import load_plugins
20
20
load_plugins()
21
21
 
22
 
from bzrlib.plugins.gtk import _i18n, cmd_gannotate, start_viz_window
23
 
 
24
 
print "Bazaar nautilus module initialized"
25
 
 
 
22
from bzrlib.plugins.gtk import _i18n, cmd_visualise, cmd_gannotate
26
23
 
27
24
class BzrExtension(nautilus.MenuProvider, nautilus.ColumnProvider, nautilus.InfoProvider):
28
25
    def __init__(self):
177
174
 
178
175
        # We only want to continue here if we get a NotBranchError
179
176
        try:
180
 
            branch, path = Branch.open_containing(file)
 
177
            tree, path = WorkingTree.open_containing(file)
181
178
        except NotBranchError:
182
179
            return
183
180
 
184
 
        pp = start_viz_window(branch, [branch.last_revision()])
185
 
        pp.show()
186
 
        gtk.main()
 
181
        vis = cmd_visualise()
 
182
        vis.run(file)
 
183
 
 
184
        return
187
185
 
188
186
    def pull_cb(self, menu, vfs_file):
189
187
        # We can only cope with local files
218
216
 
219
217
        from bzrlib.plugins.gtk.merge import MergeDialog
220
218
        dialog = MergeDialog(tree, path)
221
 
        dialog.run()
222
 
        dialog.destroy()
 
219
        dialog.display()
 
220
        gtk.main()
223
221
 
224
222
    def get_background_items(self, window, vfs_file):
225
223
        items = []
239
237
            items.append(item)
240
238
 
241
239
            item = nautilus.MenuItem('BzrNautilus::clone',
242
 
                                 'Checkout Bazaar branch ...',
 
240
                                 'Checkout Bazaar branch',
243
241
                                 'Checkout Existing Bazaar Branch')
244
242
            item.connect('activate', self.clone_cb, vfs_file)
245
243
            items.append(item)
256
254
            return item,
257
255
        else:
258
256
            item = nautilus.MenuItem('BzrNautilus::disable',
259
 
                                      'Disable Bazaar Plugin this Branch',
 
257
                                      'Disable Bazaar Plugin for the Branch',
260
258
                                      'Disable Bazaar plugin for nautilus')
261
259
            item.connect('activate', self.toggle_integration, 'False', vfs_file)
262
260
            items.append(item)
263
261
 
264
262
        item = nautilus.MenuItem('BzrNautilus::log',
265
 
                             'History ...',
 
263
                             'Log',
266
264
                             'Show Bazaar history')
267
265
        item.connect('activate', self.log_cb, vfs_file)
268
266
        items.append(item)
269
267
 
270
268
        item = nautilus.MenuItem('BzrNautilus::pull',
271
 
                             'Pull ...',
 
269
                             'Pull',
272
270
                             'Pull from another branch')
273
271
        item.connect('activate', self.pull_cb, vfs_file)
274
272
        items.append(item)
275
273
 
276
274
        item = nautilus.MenuItem('BzrNautilus::merge',
277
 
                             'Merge ...',
 
275
                             'Merge',
278
276
                             'Merge from another branch')
279
277
        item.connect('activate', self.merge_cb, vfs_file)
280
278
        items.append(item)
281
279
 
282
280
        item = nautilus.MenuItem('BzrNautilus::commit',
283
 
                             'Commit ...',
 
281
                             'Commit',
284
282
                             'Commit Changes')
285
283
        item.connect('activate', self.commit_cb, vfs_file)
286
284
        items.append(item)
343
341
                items.append(item)
344
342
            elif wtfiles[path] == 'V':
345
343
                item = nautilus.MenuItem('BzrNautilus::log',
346
 
                                 'History ...',
 
344
                                 'Log',
347
345
                                 'List changes')
348
346
                item.connect('activate', self.log_cb, vfs_file)
349
347
                items.append(item)
350
348
 
351
349
                item = nautilus.MenuItem('BzrNautilus::diff',
352
 
                                 'View Changes ...',
 
350
                                 'Diff',
353
351
                                 'Show differences')
354
352
                item.connect('activate', self.diff_cb, vfs_file)
355
353
                items.append(item)
361
359
                items.append(item)
362
360
 
363
361
                item = nautilus.MenuItem('BzrNautilus::annotate',
364
 
                             'Annotate ...',
 
362
                             'Annotate',
365
363
                             'Annotate File Data')
366
364
                item.connect('activate', self.annotate_cb, vfs_file)
367
365
                items.append(item)
368
366
 
369
367
                item = nautilus.MenuItem('BzrNautilus::commit',
370
 
                             'Commit ...',
 
368
                             'Commit',
371
369
                             'Commit Changes')
372
370
                item.connect('activate', self.commit_cb, vfs_file)
373
371
                items.append(item)