/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-08-04 18:51:44 UTC
  • Revision ID: jelmer@samba.org-20080804185144-c1v0efzz63zhf790
Remove check for glade.

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