/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 16:11:12 UTC
  • mfrom: (475.2.2 gtk)
  • mto: This revision was merged to the branch mainline in revision 519.
  • Revision ID: jelmer@samba.org-20080629161112-3j4zp0r0e7cv6cds
Merge Chad's progress bar in viz patch.

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