[qt] links in fancy view opens browser (closes #76254)

authorAlain Leufroy <alain.leufroy@logilab.fr>
changesete449146a687d
branchdefault
phasepublic
hiddenno
parent revision#46242942780f [packaging] update FSF address in py files (closes #75295)
child revision#104e38611e6b [qt] replace text in description for fancy display (closes #84465)
files modified by this revision
hgviewlib/qt4/hgrepoview.py
# HG changeset patch
# User Alain Leufroy <alain.leufroy@logilab.fr>
# Date 1323618623 -3600
# Sun Dec 11 16:50:23 2011 +0100
# Node ID e449146a687d7ca73520fc60e23c5e70b3eca92a
# Parent 46242942780f34b4679ec5d5c2b8918d3cf8e58e
[qt] links in fancy view opens browser (closes #76254)

diff --git a/hgviewlib/qt4/hgrepoview.py b/hgviewlib/qt4/hgrepoview.py
@@ -361,12 +361,15 @@
1          if rev.startswith('diff_'):
2              self.diffrev = int(rev[5:])
3              self.refreshDisplay()
4              # TODO: emit a signal to recompute the diff
5              self.emit(SIGNAL('parentRevisionSelected'), self.diffrev)
6 +        elif rev.isdigit():
7 +            self.emit(SIGNAL('revisionSelected'), rev)
8          else:
9 -            self.emit(SIGNAL('revisionSelected'), rev)
10 +            QtGui.QDesktopServices.openUrl(qurl)
11 +            self.refreshDisplay()
12 
13      def setDiffRevision(self, rev):
14          if rev != self.diffrev:
15              self.diffrev = rev
16              self.refreshDisplay()
@@ -530,11 +533,11 @@
17      view = HgRepoView(w)
18      view.setModel(model)
19      view.setWindowTitle("Simple Hg List Model")
20 
21      disp = RevDisplay(w)
22 -    connect(view, SIGNAL('revisionSelected'), lambda rev: disp.displayRevision(repo.changectx(int(rev) if rev.isdigit() else rev)))
23 +    connect(view, SIGNAL('revisionSelected'), lambda rev: disp.displayRevision(repo.changectx(rev)))
24      connect(disp, SIGNAL('revisionSelected'), view.goto)
25      #connect(view, SIGNAL('revisionActivated'), rev_act)
26 
27      l.addWidget(view, 2)
28      l.addWidget(disp)