Implemented the auto-replace code in the doc viewer.

This commit is contained in:
Veronica K. B. Olsen
2019-06-08 20:44:10 +02:00
parent 2d55ec06cc
commit dcf4903c64
6 changed files with 43 additions and 11 deletions
+2 -2
View File
@@ -246,6 +246,7 @@ class GuiMain(QMainWindow):
self.docEditor.setSpellCheck(self.theProject.spellCheck)
self.statusBar.setRefTime(self.theProject.projOpened)
self.mainMenu.updateMenu()
self.hasProject = True
# Restore previously open documents, if any
if self.theProject.lastEdited is not None:
@@ -253,8 +254,6 @@ class GuiMain(QMainWindow):
if self.theProject.lastViewed is not None:
self.viewDocument(self.theProject.lastViewed)
self.hasProject = True
return True
def saveProject(self):
@@ -329,6 +328,7 @@ class GuiMain(QMainWindow):
logger.debug("Generating preview for item %s" % tHandle)
aDoc = ToHtml(self.theProject, self)
aDoc.setText(tHandle)
aDoc.doAutoReplace()
aDoc.tokenizeText()
aDoc.doConvert()
self.docViewer.setHtml(aDoc.theResult)