summaryrefslogtreecommitdiff
path: root/portato/gui/qt/terminal.py
diff options
context:
space:
mode:
authornecoro <>2007-04-10 20:09:37 +0000
committernecoro <>2007-04-10 20:09:37 +0000
commit2d76b0ba7f6d0040c42e53df87f1ffbcbbe2cba1 (patch)
tree1afe0cf0ba9bf2316c007635eeabb4029568a1de /portato/gui/qt/terminal.py
parentf6b57b91d9af93a463b9549a6977feb48169c765 (diff)
downloadportato-2d76b0ba7f6d0040c42e53df87f1ffbcbbe2cba1.tar.gz
portato-2d76b0ba7f6d0040c42e53df87f1ffbcbbe2cba1.tar.bz2
portato-2d76b0ba7f6d0040c42e53df87f1ffbcbbe2cba1.zip
Some more functionality for the Qt-Frontend (complete emerge)
Diffstat (limited to 'portato/gui/qt/terminal.py')
-rw-r--r--portato/gui/qt/terminal.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/portato/gui/qt/terminal.py b/portato/gui/qt/terminal.py
index 9fbc39c..eabe467 100644
--- a/portato/gui/qt/terminal.py
+++ b/portato/gui/qt/terminal.py
@@ -99,21 +99,29 @@ class QtConsole (Console, QtGui.QTextEdit):
def write(self, text):
self.emit(QtCore.SIGNAL("doSomeWriting"), text)
+ def start_new_thread (self):
+ self.run = True
+ self.current = Thread(target=self.__run)
+ self.current.setDaemon(True) # close application even if this thread is running
+ self.current.start()
+
def set_pty (self, pty):
if not self.running:
self.pty = pty
-
- t = Thread(target=self.__run)
- t.setDaemon(True) # close application even if this thread is running
- t.start()
-
+ self.start_new_thread()
self.running = True
+
else:
+ # quit current thread
+ self.run = False
+ # self.current.join()
self.clear()
+
self.pty = pty # set this after clearing to lose no chars :)
+ self.start_new_thread()
def __run (self):
- while True:
+ while self.run:
s = read(self.pty, 1)
if s == "": break