The editable flag for files is now respected by the editor, and trash files are not editable

This commit is contained in:
Veronica K. B. Olsen
2019-10-31 13:37:27 +01:00
parent 7969c58351
commit 9fea45b7df
6 changed files with 67 additions and 34 deletions
+4 -1
View File
@@ -164,6 +164,7 @@ class GuiDocEditor(QTextEdit):
# If we have a document open, we should reload it in case the font changed, otherwise
# we just clear the editor entirely, which makes it read only.
if self.theHandle is not None:
# We must save the current handle as clearEditor() sets it to None
tHandle = self.theHandle
self.clearEditor()
self.loadText(tHandle)
@@ -194,9 +195,11 @@ class GuiDocEditor(QTextEdit):
self._runCounter()
self.wcTimer.start()
self.setDocumentChanged(False)
self.setReadOnly(False)
self.theHandle = tHandle
if self.nwDocument.docEditable:
self.setReadOnly(False)
return True
def saveText(self):