/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: 2012-07-09 15:23:26 UTC
  • mto: This revision was merged to the branch mainline in revision 794.
  • Revision ID: jelmer@samba.org-20120709152326-dzxb8zoz0btull7n
Remove bzr-notify.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
from bzrlib.plugin import load_plugins
38
38
load_plugins()
39
39
 
 
40
from bzrlib.plugins.gtk.i18n import _i18n
 
41
 
40
42
 
41
43
class BazaarExtension(Nautilus.MenuProvider, Nautilus.ColumnProvider,
42
44
        Nautilus.InfoProvider, Nautilus.PropertyPageProvider,
122
124
        dialog.display()
123
125
        Gtk.main()
124
126
 
 
127
    def push_cb(self, menu, controldir, path=None):
 
128
        from bzrlib.plugins.gtk.push import PushDialog
 
129
        dialog = PushDialog(branch=controldir.open_workingtree().branch)
 
130
        dialog.display()
 
131
        Gtk.main()
 
132
 
125
133
    def merge_cb(self, menu, tree, path=None):
126
134
        from bzrlib.plugins.gtk.merge import MergeDialog
127
135
        dialog = MergeDialog(tree, path)
237
245
            item.connect('activate', self.unignore_cb, tree, path)
238
246
            yield item
239
247
        else:
 
248
            kind = tree.kind(file_id)
240
249
            item = Nautilus.MenuItem(name='BzrNautilus::log',
241
250
                             label='History ...',
242
251
                             tip='List changes',
266
275
            item.connect('activate', self.remove_cb, tree, path)
267
276
            yield item
268
277
 
269
 
            item = Nautilus.MenuItem(name='BzrNautilus::annotate',
270
 
                         label='Annotate ...',
271
 
                         tip='Annotate File Data',
272
 
                         icon='')
273
 
            item.connect('activate', self.annotate_cb, tree, path, file_id)
274
 
            yield item
 
278
            if kind == 'file':
 
279
                item = Nautilus.MenuItem(name='BzrNautilus::annotate',
 
280
                             label='Annotate ...',
 
281
                             tip='Annotate File Data',
 
282
                             icon='')
 
283
                item.connect('activate', self.annotate_cb, tree, path, file_id)
 
284
                yield item
275
285
 
276
286
    def get_file_items(self, window, files):
277
287
        items = []
455
465
    def _create_table(self):
456
466
        table = Gtk.Table(homogeneous=False, columns=2, rows=3)
457
467
 
458
 
        table.attach(Gtk.Label('File id:'), 0, 1, 0, 1)
 
468
        table.attach(Gtk.Label(_i18n('File id:')), 0, 1, 0, 1)
459
469
        table.attach(Gtk.Label(self.file_id), 1, 2, 0, 1)
460
470
 
461
 
        table.attach(Gtk.Label('SHA1Sum:'), 0, 1, 1, 2)
 
471
        table.attach(Gtk.Label(_i18n('SHA1Sum:')), 0, 1, 1, 2)
462
472
        table.attach(Gtk.Label(self.tree.get_file_sha1(self.file_id, self.path)), 1, 1, 1, 2)
463
473
 
464
474
        basis_tree = self.tree.revision_tree(self.tree.last_revision())
465
475
        last_revision = basis_tree.get_file_revision(self.file_id)
466
476
 
467
 
        table.attach(Gtk.Label('Last Change Revision:'), 0, 1, 2, 3)
 
477
        table.attach(Gtk.Label(_i18n('Last Change Revision:')), 0, 1, 2, 3)
468
478
        revno = ".".join([str(x) for x in
469
479
            self.tree.branch.revision_id_to_dotted_revno(last_revision)])
470
480
        table.attach(Gtk.Label(revno), 1, 1, 2, 3)
471
481
 
472
 
        table.attach(Gtk.Label('Last Change Author:'), 0, 1, 3, 4)
 
482
        table.attach(Gtk.Label(_i18n('Last Change Author:')), 0, 1, 3, 4)
473
483
        rev = self.tree.branch.repository.get_revision(last_revision)
474
484
        table.attach(Gtk.Label("\n".join(rev.get_apparent_authors())), 1, 1, 3, 4)
475
485
 
510
520
        self._submit_location_entry = self._create_location_entry(
511
521
            self.branch.get_submit_branch, self.branch.set_submit_branch)
512
522
 
513
 
        table.attach(Gtk.Label('Push location:'), 0, 1, 0, 1)
 
523
        table.attach(Gtk.Label(_i18n('Push location:')), 0, 1, 0, 1)
514
524
        table.attach(self._push_location_entry, 1, 2, 0, 1)
515
525
 
516
 
        table.attach(Gtk.Label('Parent location:'), 0, 1, 1, 2)
 
526
        table.attach(Gtk.Label(_i18n('Parent location:')), 0, 1, 1, 2)
517
527
        table.attach(self._parent_location_entry, 1, 1, 1, 2)
518
528
 
519
 
        table.attach(Gtk.Label('Bound location:'), 0, 1, 2, 3)
 
529
        table.attach(Gtk.Label(_i18n('Bound location:')), 0, 1, 2, 3)
520
530
        table.attach(self._bound_location_entry, 1, 1, 2, 3)
521
531
 
522
 
        table.attach(Gtk.Label('Public location:'), 0, 1, 3, 4)
 
532
        table.attach(Gtk.Label(_i18n('Public location:')), 0, 1, 3, 4)
523
533
        table.attach(self._public_location_entry, 1, 1, 3, 4)
524
534
 
525
 
        table.attach(Gtk.Label('Submit location:'), 0, 1, 4, 5)
 
535
        table.attach(Gtk.Label(_i18n('Submit location:')), 0, 1, 4, 5)
526
536
        table.attach(self._submit_location_entry, 1, 1, 4, 5)
527
537
 
528
 
        self._append_revisions_only = Gtk.CheckButton('Append revisions only')
 
538
        self._append_revisions_only = Gtk.CheckButton(_i18n('Append revisions only'))
529
539
        value = self.branch.get_append_revisions_only()
530
540
        if value is None:
531
541
            value = False