Ctrl+Enter on a tag name now opens the file in the view pane

This commit is contained in:
Veronica K. B. Olsen
2019-10-30 21:05:28 +01:00
parent 886a67962b
commit 5a76d4982d
2 changed files with 47 additions and 2 deletions
+18
View File
@@ -115,6 +115,24 @@ class GuiDocViewer(QTextBrowser):
return True
def loadFromTag(self, theTag):
logger.debug("Loading document from tag '%s'" % theTag)
if theTag in self.theParent.theIndex.tagIndex.keys():
theTarget = self.theParent.theIndex.tagIndex[theTag]
else:
logger.debug("The tag was not found in the index")
return False
if len(theTarget) != 3:
# Just to make sure the index is not messed up
return False
self.loadText(theTarget[1])
return True
##
# Internal Functions
##