Commits

Angel Ezquerra committed 181088c

manifest: handle revision links in dialog mode

This makes it possible to click on the revision links on the revision details
on the manifest dialog to update the dialog to the selected revision.

Up until now a "linkActivated" signal would be emitted, but if the manifest
dialog was open in stand alone mode there was no one to catch it.

It seems that the manifest dialog is never opened from the workbench, which
means that it is ok to handle the link right on the manifest dialog.

Comments (0)

Files changed (1)

tortoisehg/hgqt/manifestdialog.py

 
         self.setStatusBar(QStatusBar())
         self._manifest_widget.showMessage.connect(self.statusBar().showMessage)
-        self._manifest_widget.linkActivated.connect(self.linkActivated)
+        self._manifest_widget.linkActivated.connect(self._linkHandler)
 
         self._readsettings()
         self._updatewindowtitle()
         from tortoisehg.hgqt import run
         run.grep(self._repo.ui, hglib.fromunicode(pattern), **opts)
 
+    @pyqtSlot(QString)
+    def _linkHandler(self, link):
+        ulink = unicode(link)
+        if ulink.startswith('cset:'):
+            rev = ulink[len('cset:'):]
+            self._manifest_widget.setRev(rev)
+        else:
+            self.linkActivated.emit(link)
+
+
 class ManifestWidget(QWidget, qtlib.TaskWidget):
     """Display file tree and contents at the specified revision"""