Added the code needed for opening documentation in the viewer
This commit is contained in:
+14
-1
@@ -13,7 +13,7 @@
|
||||
import logging
|
||||
import nw
|
||||
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtCore import Qt, QUrl
|
||||
from PyQt5.QtWidgets import QTextBrowser
|
||||
from PyQt5.QtGui import QTextOption
|
||||
|
||||
@@ -59,6 +59,7 @@ class GuiDocViewer(QTextBrowser):
|
||||
|
||||
def clearViewer(self):
|
||||
self.clear()
|
||||
self.setSearchPaths([""])
|
||||
return True
|
||||
|
||||
def initEditor(self):
|
||||
@@ -74,6 +75,10 @@ class GuiDocViewer(QTextBrowser):
|
||||
|
||||
def loadText(self, tHandle):
|
||||
|
||||
if tHandle == "Help":
|
||||
self.loadHelp()
|
||||
return True
|
||||
|
||||
tItem = self.theProject.getItem(tHandle)
|
||||
if tItem is None:
|
||||
logger.warning("Item not found")
|
||||
@@ -94,4 +99,12 @@ class GuiDocViewer(QTextBrowser):
|
||||
|
||||
return True
|
||||
|
||||
def loadHelp(self):
|
||||
|
||||
self.clearViewer()
|
||||
self.setSearchPaths([self.mainConf.helpPath])
|
||||
self.setSource(QUrl("index.html"))
|
||||
|
||||
return True
|
||||
|
||||
# END Class GuiDocViewer
|
||||
|
||||
Reference in New Issue
Block a user