From 1c647ba13cc59092509e5a8424654878032f3685 Mon Sep 17 00:00:00 2001 From: karxi Date: Fri, 23 Dec 2016 13:22:11 -0500 Subject: [PATCH] Made the console output text in the proper place. --- console.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/console.py b/console.py index 764e53d..905757a 100644 --- a/console.py +++ b/console.py @@ -251,12 +251,23 @@ class ConsoleText(QtGui.QTextEdit): result = "{}{} {}\n" result = result.format(timestamp, prefix, msg) #~self.append(result) - self.insertPlainText(result) + self.appendPlainText(result) # Direction doesn't matter here - it's the console. self.lastmsg = datetime.datetime.now() # This needs to finish being rewritten.... + def appendPlainText(self, text): + """Add plain text to the end of the document, a la insertPlainText.""" + # Save the old cursor + oldcur = self.textCursor() + # Move the cursor to the end of the document for insertion + self.moveCursor(QtGui.QTextCursor.End) + # Insert the text + self.insertPlainText(text) + # Return the cursor to wherever it was prior + self.setTextCursor(oldcur) + def changeTheme(self, theme): self.initTheme(theme) sb = self.verticalScrollBar()