From 2d76b0ba7f6d0040c42e53df87f1ffbcbbe2cba1 Mon Sep 17 00:00:00 2001 From: necoro <> Date: Tue, 10 Apr 2007 20:09:37 +0000 Subject: Some more functionality for the Qt-Frontend (complete emerge) --- portato/gui/qt/terminal.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'portato/gui/qt/terminal.py') 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 -- cgit v1.2.3-70-g09d2