/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 revisionview.py

  • Committer: rodney.dawes at canonical
  • Date: 2008-10-25 06:02:09 UTC
  • Revision ID: rodney.dawes@canonical.com-20081025060209-irlizouino63cs1m
        * preferences/__init__.py:
        Remove the dialog separator
        Remove useless extra call to self._create_pages()
        Make the default window size smaller
        Set the default border width on various widgets
        Set the current notebook page to the first one

        * preferences/identity.py:
        Set various border widths appropriately
        Align the labels to the left
        Remove the unneeded bold markup from the labels
        Change the "User Id" label to "E-Mail"
        Align the radio group labels to the top of the groups

        * preferences/plugins.py:
        Set various border widths appropriately
        Set the default paned position to something more sensible
        Set the shadow type on the treeview's scrolled window to in
        Align the Author and Version labels to the left

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
import gobject
23
23
import webbrowser
24
24
 
25
 
from bzrlib.plugins.gtk import icon_path
26
25
from bzrlib.osutils import format_date
27
26
from bzrlib.util.bencode import bdecode
 
27
from bzrlib.testament import Testament
 
28
 
 
29
from bzrlib.plugins.gtk import icon_path
28
30
 
29
31
try:
30
32
    from bzrlib.plugins.gtk import seahorse
220
222
                                        "This revision has not been signed.")
221
223
 
222
224
    def show_signature(self, crypttext):
223
 
        key = seahorse.verify(crypttext)
 
225
        (cleartext, key) = seahorse.verify(crypttext)
 
226
 
 
227
        assert cleartext is not None
 
228
 
 
229
        inv = self.repository.get_inventory(self.revision.revision_id)
 
230
        expected_testament = Testament(self.revision, inv).as_short_text()
 
231
        if expected_testament != cleartext:
 
232
            self.signature_image.set_from_file(icon_path("sign-bad.png"))
 
233
            self.signature_label.set_markup("<b>Signature does not match repository data</b>\n" +
 
234
                        "The signature plaintext is different from the expected testament plaintext.")
 
235
            return
224
236
 
225
237
        if key and key.is_available():
226
238
            if key.is_trusted():
497
509
        table.resize(max(len(revids), 1), 2)
498
510
 
499
511
        for idx, revid in enumerate(revids):
500
 
            align = gtk.Alignment(0.0, 0.0)
 
512
            align = gtk.Alignment(0.0, 0.0, 1, 1)
501
513
            widgets.append(align)
502
514
            table.attach(align, 1, 2, idx, idx + 1,
503
515
                                      gtk.EXPAND | gtk.FILL, gtk.FILL)
520
532
                hbox.pack_start(button, expand=False, fill=True)
521
533
                button.show()
522
534
 
523
 
            button = gtk.Button(revid)
 
535
            button = gtk.Button()
 
536
            revid_label = gtk.Label(str(revid))
 
537
            revid_label.set_ellipsize(pango.ELLIPSIZE_MIDDLE)
 
538
            revid_label.set_alignment(0.0, 0.5)
 
539
            button.add(revid_label)
524
540
            button.connect("clicked",
525
541
                    lambda w, r: self.set_revision(self._repository.get_revision(r)), revid)
526
542
            button.set_use_underline(False)
527
 
            hbox.pack_start(button, expand=False, fill=True)
528
 
            button.show()
 
543
            hbox.pack_start(button, expand=True, fill=True)
 
544
            button.show_all()
529
545
 
530
546
    def _create_general(self):
531
547
        vbox = gtk.VBox(False, 6)
554
570
        self.table.set_col_spacings(6)
555
571
        self.table.show()
556
572
 
557
 
        align = gtk.Alignment(1.0, 0.5)
 
573
        row = 0
 
574
 
558
575
        label = gtk.Label()
 
576
        label.set_alignment(1.0, 0.5)
559
577
        label.set_markup("<b>Revision Id:</b>")
560
 
        align.add(label)
561
 
        self.table.attach(align, 0, 1, 0, 1, gtk.FILL, gtk.FILL)
562
 
        align.show()
 
578
        self.table.attach(label, 0, 1, row, row+1, gtk.FILL, gtk.FILL)
563
579
        label.show()
564
580
 
565
 
        align = gtk.Alignment(0.0, 0.5)
566
581
        revision_id = gtk.Label()
 
582
        revision_id.set_ellipsize(pango.ELLIPSIZE_MIDDLE)
 
583
        revision_id.set_alignment(0.0, 0.5)
567
584
        revision_id.set_selectable(True)
568
585
        self.connect('notify::revision', 
569
586
                lambda w, p: revision_id.set_text(self._revision.revision_id))
570
 
        align.add(revision_id)
571
 
        self.table.attach(align, 1, 2, 0, 1, gtk.EXPAND | gtk.FILL, gtk.FILL)
572
 
        align.show()
 
587
        self.table.attach(revision_id, 1, 2, row, row+1, gtk.EXPAND | gtk.FILL, gtk.FILL)
573
588
        revision_id.show()
574
589
 
575
 
        align = gtk.Alignment(1.0, 0.5)
 
590
        row += 1
576
591
        self.author_label = gtk.Label()
 
592
        self.author_label.set_alignment(1.0, 0.5)
577
593
        self.author_label.set_markup("<b>Author:</b>")
578
 
        align.add(self.author_label)
579
 
        self.table.attach(align, 0, 1, 1, 2, gtk.FILL, gtk.FILL)
580
 
        align.show()
 
594
        self.table.attach(self.author_label, 0, 1, row, row+1, gtk.FILL, gtk.FILL)
581
595
        self.author_label.show()
582
596
 
583
 
        align = gtk.Alignment(0.0, 0.5)
584
597
        self.author = gtk.Label()
 
598
        self.author.set_ellipsize(pango.ELLIPSIZE_END)
 
599
        self.author.set_alignment(0.0, 0.5)
585
600
        self.author.set_selectable(True)
586
 
        align.add(self.author)
587
 
        self.table.attach(align, 1, 2, 1, 2, gtk.EXPAND | gtk.FILL, gtk.FILL)
588
 
        align.show()
 
601
        self.table.attach(self.author, 1, 2, row, row+1, gtk.EXPAND | gtk.FILL, gtk.FILL)
589
602
        self.author.show()
590
603
        self.author.hide()
591
604
 
592
 
        align = gtk.Alignment(1.0, 0.5)
 
605
        row += 1
593
606
        label = gtk.Label()
 
607
        label.set_alignment(1.0, 0.5)
594
608
        label.set_markup("<b>Committer:</b>")
595
 
        align.add(label)
596
 
        self.table.attach(align, 0, 1, 2, 3, gtk.FILL, gtk.FILL)
597
 
        align.show()
 
609
        self.table.attach(label, 0, 1, row, row+1, gtk.FILL, gtk.FILL)
598
610
        label.show()
599
611
 
600
 
        align = gtk.Alignment(0.0, 0.5)
601
612
        self.committer = gtk.Label()
 
613
        self.committer.set_ellipsize(pango.ELLIPSIZE_END)
 
614
        self.committer.set_alignment(0.0, 0.5)
602
615
        self.committer.set_selectable(True)
603
 
        align.add(self.committer)
604
 
        self.table.attach(align, 1, 2, 2, 3, gtk.EXPAND | gtk.FILL, gtk.FILL)
605
 
        align.show()
 
616
        self.table.attach(self.committer, 1, 2, row, row+1, gtk.EXPAND | gtk.FILL, gtk.FILL)
606
617
        self.committer.show()
607
618
 
608
 
        align = gtk.Alignment(0.0, 0.5)
 
619
        row += 1
609
620
        label = gtk.Label()
 
621
        label.set_alignment(1.0, 0.5)
610
622
        label.set_markup("<b>Branch nick:</b>")
611
 
        align.add(label)
612
 
        self.table.attach(align, 0, 1, 3, 4, gtk.FILL, gtk.FILL)
 
623
        self.table.attach(label, 0, 1, row, row+1, gtk.FILL, gtk.FILL)
613
624
        label.show()
614
 
        align.show()
615
625
 
616
 
        align = gtk.Alignment(0.0, 0.5)
617
626
        self.branchnick_label = gtk.Label()
 
627
        self.branchnick_label.set_ellipsize(pango.ELLIPSIZE_MIDDLE)
 
628
        self.branchnick_label.set_alignment(0.0, 0.5)
618
629
        self.branchnick_label.set_selectable(True)
619
 
        align.add(self.branchnick_label)
620
 
        self.table.attach(align, 1, 2, 3, 4, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
630
        self.table.attach(self.branchnick_label, 1, 2, row, row+1, gtk.EXPAND | gtk.FILL, gtk.FILL)
621
631
        self.branchnick_label.show()
622
 
        align.show()
623
632
 
624
 
        align = gtk.Alignment(1.0, 0.5)
 
633
        row += 1
625
634
        label = gtk.Label()
 
635
        label.set_alignment(1.0, 0.5)
626
636
        label.set_markup("<b>Timestamp:</b>")
627
 
        align.add(label)
628
 
        self.table.attach(align, 0, 1, 4, 5, gtk.FILL, gtk.FILL)
629
 
        align.show()
 
637
        self.table.attach(label, 0, 1, row, row+1, gtk.FILL, gtk.FILL)
630
638
        label.show()
631
639
 
632
 
        align = gtk.Alignment(0.0, 0.5)
633
640
        self.timestamp = gtk.Label()
 
641
        self.timestamp.set_ellipsize(pango.ELLIPSIZE_END)
 
642
        self.timestamp.set_alignment(0.0, 0.5)
634
643
        self.timestamp.set_selectable(True)
635
 
        align.add(self.timestamp)
636
 
        self.table.attach(align, 1, 2, 4, 5, gtk.EXPAND | gtk.FILL, gtk.FILL)
637
 
        align.show()
 
644
        self.table.attach(self.timestamp, 1, 2, row, row+1, gtk.EXPAND | gtk.FILL, gtk.FILL)
638
645
        self.timestamp.show()
639
646
 
640
 
        align = gtk.Alignment(1.0, 0.5)
 
647
        row += 1
641
648
        self.tags_label = gtk.Label()
 
649
        self.tags_label.set_alignment(1.0, 0.5)
642
650
        self.tags_label.set_markup("<b>Tags:</b>")
643
 
        align.add(self.tags_label)
644
 
        align.show()
645
 
        self.table.attach(align, 0, 1, 5, 6, gtk.FILL, gtk.FILL)
 
651
        self.table.attach(self.tags_label, 0, 1, row, row+1, gtk.FILL, gtk.FILL)
646
652
        self.tags_label.show()
647
653
 
648
 
        align = gtk.Alignment(0.0, 0.5)
649
654
        self.tags_list = gtk.Label()
650
 
        align.add(self.tags_list)
651
 
        self.table.attach(align, 1, 2, 5, 6, gtk.EXPAND | gtk.FILL, gtk.FILL)
652
 
        align.show()
 
655
        self.tags_list.set_ellipsize(pango.ELLIPSIZE_MIDDLE)
 
656
        self.tags_list.set_alignment(0.0, 0.5)
 
657
        self.table.attach(self.tags_list, 1, 2, row, row+1, gtk.EXPAND | gtk.FILL, gtk.FILL)
653
658
        self.tags_list.show()
654
659
 
655
660
        self.connect('notify::revision', self._add_tags)