/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: 2008-06-29 19:34:29 UTC
  • mto: This revision was merged to the branch mainline in revision 520.
  • Revision ID: jelmer@samba.org-20080629193429-ir2ilmbko6qkubg5
Add Branch/Index option if bzr-search is available.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import gtk
21
21
import pango
22
22
import gobject
23
 
import subprocess
 
23
import webbrowser
24
24
 
25
25
from bzrlib.plugins.gtk import icon_path
26
26
from bzrlib.osutils import format_date
38
38
PAGE_SIGNATURE = 2
39
39
PAGE_BUGS = 3
40
40
 
 
41
 
41
42
def _open_link(widget, uri):
42
 
    subprocess.Popen(['sensible-browser', uri], close_fds=True)
 
43
    for cmd in ['sensible-browser', 'xdg-open']:
 
44
        if webbrowser._iscommand(cmd):
 
45
            webbrowser._tryorder.insert(0, '%s "%%s"' % cmd)
 
46
    webbrowser.open(uri)
43
47
 
44
48
gtk.link_button_set_uri_hook(_open_link)
45
49
 
305
309
        )
306
310
    }
307
311
 
308
 
    def __init__(self, branch=None):
 
312
    def __init__(self, branch=None, repository=None):
309
313
        gtk.Notebook.__init__(self)
310
314
 
311
315
        self._revision = None
312
316
        self._branch = branch
 
317
        if branch is not None:
 
318
            self._repository = branch.repository
 
319
        else:
 
320
            self._repository = repository
313
321
 
314
322
        self._create_general()
315
323
        self._create_relations()
316
 
        if has_seahorse:
317
 
            self._create_signature()
 
324
        # Disabled because testaments aren't verified yet:
 
325
        # if has_seahorse:
 
326
        #    self._create_signature()
318
327
        self._create_file_info_view()
319
328
        self._create_bugs()
320
329
 
513
522
 
514
523
            button = gtk.Button(revid)
515
524
            button.connect("clicked",
516
 
                    lambda w, r: self.set_revision(self._branch.repository.get_revision(r)), revid)
 
525
                    lambda w, r: self.set_revision(self._repository.get_revision(r)), revid)
517
526
            button.set_use_underline(False)
518
527
            hbox.pack_start(button, expand=False, fill=True)
519
528
            button.show()
535
544
        vbox.show()
536
545
 
537
546
    def _create_signature(self):
538
 
        self.signature_table = SignatureTab(self._branch.repository)
 
547
        self.signature_table = SignatureTab(self._repository)
539
548
        self.append_page(self.signature_table, tab_label=gtk.Label('Signature'))
540
549
        self.connect_after('notify::revision', self._update_signature)
541
550