Make sure the document isn't overwritten if it exists, but we have an error loading it due to encoding, or otherwise

This commit is contained in:
Veronica K. B. Olsen
2019-10-28 14:12:26 +01:00
parent f760eeb544
commit 4fcff94b05
3 changed files with 25 additions and 6 deletions
+6 -4
View File
@@ -332,10 +332,12 @@ class GuiMain(QMainWindow):
def openDocument(self, tHandle):
if self.hasProject:
self.closeDocument()
self.docEditor.loadText(tHandle)
self.docEditor.setFocus()
self.docEditor.changeWidth()
self.theProject.setLastEdited(tHandle)
if self.docEditor.loadText(tHandle):
self.docEditor.setFocus()
self.docEditor.changeWidth()
self.theProject.setLastEdited(tHandle)
else:
return False
return True
def saveDocument(self):