Made the console output text in the proper place.
This commit is contained in:
parent
e657138dad
commit
1c647ba13c
1 changed files with 12 additions and 1 deletions
13
console.py
13
console.py
|
@ -251,12 +251,23 @@ class ConsoleText(QtGui.QTextEdit):
|
||||||
result = "{}{} {}\n"
|
result = "{}{} {}\n"
|
||||||
result = result.format(timestamp, prefix, msg)
|
result = result.format(timestamp, prefix, msg)
|
||||||
#~self.append(result)
|
#~self.append(result)
|
||||||
self.insertPlainText(result)
|
self.appendPlainText(result)
|
||||||
|
|
||||||
# Direction doesn't matter here - it's the console.
|
# Direction doesn't matter here - it's the console.
|
||||||
self.lastmsg = datetime.datetime.now()
|
self.lastmsg = datetime.datetime.now()
|
||||||
# This needs to finish being rewritten....
|
# 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):
|
def changeTheme(self, theme):
|
||||||
self.initTheme(theme)
|
self.initTheme(theme)
|
||||||
sb = self.verticalScrollBar()
|
sb = self.verticalScrollBar()
|
||||||
|
|
Loading…
Reference in a new issue