/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-07-25 22:29:51 UTC
  • mto: This revision was merged to the branch mainline in revision 578.
  • Revision ID: jelmer@samba.org-20080725222951-9x51jo0tc1q39vo1
Use ... notation for options that lead to dialogs, fix some nautilus-bzr menu items that had regressed.

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()
221
222
 
222
223
    def get_background_items(self, window, vfs_file):
223
224
        items = []
237
238
            items.append(item)
238
239
 
239
240
            item = nautilus.MenuItem('BzrNautilus::clone',
240
 
                                 'Checkout Bazaar branch',
 
241
                                 'Checkout Bazaar branch ...',
241
242
                                 'Checkout Existing Bazaar Branch')
242
243
            item.connect('activate', self.clone_cb, vfs_file)
243
244
            items.append(item)
254
255
            return item,
255
256
        else:
256
257
            item = nautilus.MenuItem('BzrNautilus::disable',
257
 
                                      'Disable Bazaar Plugin for the Branch',
 
258
                                      'Disable Bazaar Plugin this Branch',
258
259
                                      'Disable Bazaar plugin for nautilus')
259
260
            item.connect('activate', self.toggle_integration, 'False', vfs_file)
260
261
            items.append(item)
261
262
 
262
263
        item = nautilus.MenuItem('BzrNautilus::log',
263
 
                             'Log',
 
264
                             'History ...',
264
265
                             'Show Bazaar history')
265
266
        item.connect('activate', self.log_cb, vfs_file)
266
267
        items.append(item)
267
268
 
268
269
        item = nautilus.MenuItem('BzrNautilus::pull',
269
 
                             'Pull',
 
270
                             'Pull ...',
270
271
                             'Pull from another branch')
271
272
        item.connect('activate', self.pull_cb, vfs_file)
272
273
        items.append(item)
273
274
 
274
275
        item = nautilus.MenuItem('BzrNautilus::merge',
275
 
                             'Merge',
 
276
                             'Merge ...',
276
277
                             'Merge from another branch')
277
278
        item.connect('activate', self.merge_cb, vfs_file)
278
279
        items.append(item)
279
280
 
280
281
        item = nautilus.MenuItem('BzrNautilus::commit',
281
 
                             'Commit',
 
282
                             'Commit ...',
282
283
                             'Commit Changes')
283
284
        item.connect('activate', self.commit_cb, vfs_file)
284
285
        items.append(item)
341
342
                items.append(item)
342
343
            elif wtfiles[path] == 'V':
343
344
                item = nautilus.MenuItem('BzrNautilus::log',
344
 
                                 'Log',
 
345
                                 'History ...',
345
346
                                 'List changes')
346
347
                item.connect('activate', self.log_cb, vfs_file)
347
348
                items.append(item)
348
349
 
349
350
                item = nautilus.MenuItem('BzrNautilus::diff',
350
 
                                 'Diff',
 
351
                                 'View Changes ...',
351
352
                                 'Show differences')
352
353
                item.connect('activate', self.diff_cb, vfs_file)
353
354
                items.append(item)
359
360
                items.append(item)
360
361
 
361
362
                item = nautilus.MenuItem('BzrNautilus::annotate',
362
 
                             'Annotate',
 
363
                             'Annotate ...',
363
364
                             'Annotate File Data')
364
365
                item.connect('activate', self.annotate_cb, vfs_file)
365
366
                items.append(item)
366
367
 
367
368
                item = nautilus.MenuItem('BzrNautilus::commit',
368
 
                             'Commit',
 
369
                             'Commit ...',
369
370
                             'Commit Changes')
370
371
                item.connect('activate', self.commit_cb, vfs_file)
371
372
                items.append(item)