/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: 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:
22
22
 
23
23
from bzrlib import trace
24
24
from bzrlib.osutils import format_date
25
 
try:
26
 
    from bzrlib.bencode import bdecode
27
 
except ImportError:
28
 
    from bzrlib.util.bencode import bdecode
 
25
from bzrlib.bencode import bdecode
29
26
from bzrlib.testament import Testament
30
27
 
31
28
from bzrlib.plugins.gtk import icon_path
51
48
            webbrowser._tryorder.insert(0, '%s "%%s"' % cmd)
52
49
    webbrowser.open(uri)
53
50
 
54
 
if getattr(Gtk, 'link_button_set_uri_hook', None) is not None:
55
 
    Gtk.link_button_set_uri_hook(_open_link)
56
51
 
57
52
class BugsTab(Gtk.VBox):
58
53
 
148
143
        self.revision = None
149
144
        self.repository = repository
150
145
 
151
 
        super(SignatureTab, self).__init__(False, 6)
 
146
        super(SignatureTab, self).__init__(homogeneous=False, spacing=6)
152
147
        signature_box = Gtk.Table(rows=3, columns=3)
153
148
        signature_box.set_col_spacing(0, 16)
154
149
        signature_box.set_col_spacing(1, 12)
157
152
        self.signature_image = Gtk.Image()
158
153
        signature_box.attach(self.signature_image, 0, 1, 0, 1, Gtk.AttachOptions.FILL)
159
154
 
160
 
        align = Gtk.Alignment.new(0.0, 0.1)
 
155
        align = Gtk.Alignment.new(0.0, 0.1, 0.0, 0.0)
161
156
        self.signature_label = Gtk.Label()
162
157
        align.add(self.signature_label)
163
158
        signature_box.attach(align, 1, 3, 0, 1, Gtk.AttachOptions.FILL)
164
159
 
165
 
        align = Gtk.Alignment.new(0.0, 0.5)
 
160
        align = Gtk.Alignment.new(0.0, 0.5, 0.0, 0.0)
166
161
        self.signature_key_id_label = Gtk.Label()
167
162
        self.signature_key_id_label.set_markup("<b>Key Id:</b>")
168
163
        align.add(self.signature_key_id_label)
169
164
        signature_box.attach(align, 1, 2, 1, 2, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
170
165
 
171
 
        align = Gtk.Alignment.new(0.0, 0.5)
 
166
        align = Gtk.Alignment.new(0.0, 0.5, 0.0, 0.0)
172
167
        self.signature_key_id = Gtk.Label()
173
168
        self.signature_key_id.set_selectable(True)
174
169
        align.add(self.signature_key_id)
175
170
        signature_box.attach(align, 2, 3, 1, 2, Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
176
171
 
177
 
        align = Gtk.Alignment.new(0.0, 0.5)
 
172
        align = Gtk.Alignment.new(0.0, 0.5, 0.0, 0.0)
178
173
        self.signature_fingerprint_label = Gtk.Label()
179
174
        self.signature_fingerprint_label.set_markup("<b>Fingerprint:</b>")
180
175
        align.add(self.signature_fingerprint_label)
181
176
        signature_box.attach(align, 1, 2, 2, 3, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
182
177
 
183
 
        align = Gtk.Alignment.new(0.0, 0.5)
 
178
        align = Gtk.Alignment.new(0.0, 0.5, 0.0, 0.0)
184
179
        self.signature_fingerprint = Gtk.Label()
185
180
        self.signature_fingerprint.set_selectable(True)
186
181
        align.add(self.signature_fingerprint)
187
182
        signature_box.attach(align, 2, 3, 2, 3, Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
188
183
 
189
 
        align = Gtk.Alignment.new(0.0, 0.5)
 
184
        align = Gtk.Alignment.new(0.0, 0.5, 0.0, 0.0)
190
185
        self.signature_trust_label = Gtk.Label()
191
186
        self.signature_trust_label.set_markup("<b>Trust:</b>")
192
187
        align.add(self.signature_trust_label)
193
188
        signature_box.attach(align, 1, 2, 3, 4, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
194
189
 
195
 
        align = Gtk.Alignment.new(0.0, 0.5)
 
190
        align = Gtk.Alignment.new(0.0, 0.5, 0.0, 0.0)
196
191
        self.signature_trust = Gtk.Label()
197
192
        self.signature_trust.set_selectable(True)
198
193
        align.add(self.signature_trust)
327
322
    }
328
323
 
329
324
    def __init__(self, branch=None, repository=None):
330
 
        GObject.GObject.__init__(self)
 
325
        super(RevisionView, self).__init__()
331
326
 
332
327
        self._revision = None
333
328
        self._branch = branch
335
330
            self._repository = branch.repository
336
331
        else:
337
332
            self._repository = repository
 
333
        self.signature_table = None
338
334
 
339
335
        self._create_general()
340
336
        self._create_relations()
474
470
        self._add_tags()
475
471
 
476
472
    def _update_signature(self, widget, param):
 
473
        if not has_seahorse:
 
474
            return
477
475
        if self.get_current_page() == PAGE_SIGNATURE:
478
476
            self.signature_table.set_revision(self._revision)
479
477
 
488
486
                                      self.children_table)
489
487
 
490
488
    def _switch_page_cb(self, notebook, page, page_num):
 
489
        if not has_seahorse:
 
490
            return
491
491
        if page_num == PAGE_SIGNATURE:
492
492
            self.signature_table.set_revision(self._revision)
493
493
 
547
547
                button.add(image)
548
548
                button.connect("clicked", self._show_clicked_cb,
549
549
                               self._revision.revision_id, revid)
550
 
                hbox.pack_start(button, expand=False, fill=True)
 
550
                hbox.pack_start(button, False, True, 0)
551
551
                button.show()
552
552
 
553
553
            button = Gtk.Button()
559
559
                    lambda w, r: self.set_revision(
560
560
                        self._repository.get_revision(r)), revid)
561
561
            button.set_use_underline(False)
562
 
            hbox.pack_start(button, expand=True, fill=True)
 
562
            hbox.pack_start(button, True, True, 0)
563
563
            button.show_all()
564
564
 
565
565
    def _create_general(self):
581
581
    def _create_signature(self):
582
582
        self.signature_table = SignatureTab(self._repository)
583
583
        self.append_page(
584
 
            self.signature_table, tab_label=Gtk.Label(label='Signature'))
 
584
            self.signature_table, Gtk.Label(label='Signature'))
585
585
        self.connect_after('notify::revision', self._update_signature)
586
586
 
587
587
    def _create_headers(self):
684
684
 
685
685
        self.connect('notify::revision', self._add_tags)
686
686
 
687
 
        self.avatarsbox.show()
688
687
        return self.avatarsbox
689
688
    
690
689
    def _create_parents(self):