/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: 2011-11-30 21:45:54 UTC
  • Revision ID: jelmer@samba.org-20111130214554-5kfx0b5y7t5zh033
Extend branch preferences, show location widget.

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