It should now be possible to navigate to positions within the documents when clicking links in various places

This commit is contained in:
Veronica K. B. Olsen
2020-05-25 23:31:41 +02:00
parent b3e4af1394
commit 4340b6b8b5
4 changed files with 40 additions and 52 deletions
+4 -11
View File
@@ -107,12 +107,10 @@ class GuiDocViewDetails(QWidget):
for tHandle in theRefs:
tItem = self.theProject.projTree[tHandle]
if tItem is not None:
theList.append("<a href='#tag=%s:%s'>%s</a>" % (
theList.append("<a href='#head_%s:%s'>%s</a>" % (
tHandle, theRefs[tHandle], tItem.itemName
))
# print(theList)
self.refList.setText(", ".join(theList))
self.refList.adjustSize()
@@ -127,14 +125,9 @@ class GuiDocViewDetails(QWidget):
class for handling.
"""
logger.verbose("Clicked link: '%s'" % theLink)
if len(theLink) == 26:
tHandle = theLink[5:18]
tLine = theLink[19:26]
if tLine[1:].isdigit():
nLine = int(tLine[1:])
else:
nLine = 1
self.theParent.viewDocument(tHandle, nLine)
if len(theLink) == 27:
tHandle = theLink[6:19]
self.theParent.viewDocument(tHandle, theLink)
return
def _doShowHide(self, chState):