/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: Martin Albisetti
  • Date: 2008-03-28 03:38:15 UTC
  • Revision ID: argentina@gmail.com-20080328033815-d5ontsl2bw9hz9mv
Add enable/disable options to contexts menu

Show diffs side-by-side

added added

removed removed

Lines of Context:
224
224
 
225
225
    def get_background_items(self, window, vfs_file):
226
226
        if disabled_flag == 'False':
227
 
            return
 
227
            item = nautilus.MenuItem('BzrNautilus::enable',
 
228
                                     'Enable Bazaar Plugin',
 
229
                                     'Enable Bazaar plugin for nautilus')
 
230
            item.connect('activate', self.enable_integration, vfs_file)
 
231
            return item,
228
232
 
229
233
        items = []
230
234
        file = vfs_file.get_uri()
 
235
 
 
236
        item = nautilus.MenuItem('BzrNautilus::disable',
 
237
                                  'Disable Bazaar Plugin',
 
238
                                  'Disable Bazaar plugin for nautilus')
 
239
        item.connect('activate', self.disable_integration, vfs_file)
 
240
        items.append(item)
 
241
 
231
242
        try:
232
243
            tree, path = WorkingTree.open_containing(file)
233
244
        except UnsupportedProtocol:
276
287
        return items
277
288
 
278
289
    def get_file_items(self, window, files):
 
290
 
279
291
        if disabled_flag == 'False':
280
292
            return
281
293
 
282
294
        items = []
283
 
 
284
295
        wtfiles = {}
285
296
        for vfs_file in files:
286
297
            # We can only cope with local files
411
422
            file.add_emblem(emblem)
412
423
        file.add_string_attribute('bzr_status', status)
413
424
 
414
 
    def enable_integration(self):
 
425
    def enable_integration(self, menu, vfs_file=None):
415
426
        config.set_user_option('nautilus_integration','True')
416
427
 
417
 
    def disable_integration(self):
 
428
    def disable_integration(self, menu, vfs_file=None):
418
429
        config.set_user_option('nautilus_integration','False')