Added a noticeBar to the top of the document editor that can display notifications

This commit is contained in:
Veronica K. B. Olsen
2019-10-31 14:45:00 +01:00
parent 6f893bf321
commit c815a9ce01
5 changed files with 80 additions and 6 deletions
+7 -3
View File
@@ -116,6 +116,7 @@ class GuiDocEditor(QTextEdit):
self.hasSelection = False
self.setDocumentChanged(False)
self.theParent.noticeBar.hideNote()
return True
@@ -201,6 +202,8 @@ class GuiDocEditor(QTextEdit):
if self.nwDocument.docEditable:
self.setReadOnly(False)
else:
self.theParent.noticeBar.showNote("This document is read only.")
return True
@@ -244,9 +247,10 @@ class GuiDocEditor(QTextEdit):
return theText
def setCursorPosition(self, thePosition):
theCursor = self.textCursor()
theCursor.setPosition(thePosition)
self.setTextCursor(theCursor)
if thePosition > 0:
theCursor = self.textCursor()
theCursor.setPosition(thePosition)
self.setTextCursor(theCursor)
return True
def getCursorPosition(self):