/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: Curtis Hovey
  • Date: 2011-08-12 20:25:28 UTC
  • mto: This revision was merged to the branch mainline in revision 741.
  • Revision ID: sinzui.is@verizon.net-20110812202528-4xf4a2t23urx50d2
Updated gst to gtk3.

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