clear window on ctrl-L

This commit is contained in:
ThomasV 2013-02-01 18:32:56 +01:00
parent 8bb4628f11
commit 326ddaf410
1 changed files with 6 additions and 2 deletions

View File

@ -26,6 +26,10 @@ class Console(QtGui.QPlainTextEdit):
self.appendPlainText(message)
self.newPrompt()
def clear(self):
self.setPlainText('')
self.newPrompt()
def newPrompt(self):
if self.construct:
prompt = '.' * len(self.prompt)
@ -160,8 +164,8 @@ class Console(QtGui.QPlainTextEdit):
elif event.key() == QtCore.Qt.Key_Down:
self.setCommand(self.getNextHistoryEntry())
return
#elif event.key() == QtCore.Qt.Key_D and event.modifiers() == QtCore.Qt.ControlModifier:
# self.close()
elif event.key() == QtCore.Qt.Key_L and event.modifiers() == QtCore.Qt.ControlModifier:
self.clear()
super(Console, self).keyPressEvent(event)