changeset 13349:a88e98b714d9

Terminal relaunches on exit.
author Jacob Dawid <jacob.dawid@googlemail.com>
date Thu, 07 Apr 2011 10:44:04 +0200
parents 0a5619ea17a6
children 5a13d25ce389
files gui//qtermwidget/lib/Makefile gui//qtermwidget/lib/Makefile.Debug gui//qtermwidget/lib/Makefile.Release gui//terminal.cpp gui//terminal.h
diffstat 5 files changed, 22 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/gui//qtermwidget/lib/Makefile
+++ b/gui//qtermwidget/lib/Makefile
@@ -1,6 +1,6 @@
 #############################################################################
 # Makefile for building: libqtermwidget.a
-# Generated by qmake (2.01a) (Qt 4.7.2) on: Do. Apr 7 10:08:11 2011
+# Generated by qmake (2.01a) (Qt 4.7.2) on: Do. Apr 7 10:32:32 2011
 # Project:  lib.pro
 # Template: lib
 # Command: /usr/bin/qmake -o Makefile lib.pro
--- a/gui//qtermwidget/lib/Makefile.Debug
+++ b/gui//qtermwidget/lib/Makefile.Debug
@@ -1,6 +1,6 @@
 #############################################################################
 # Makefile for building: libqtermwidget_d.a
-# Generated by qmake (2.01a) (Qt 4.7.2) on: Do. Apr 7 10:08:11 2011
+# Generated by qmake (2.01a) (Qt 4.7.2) on: Do. Apr 7 10:32:32 2011
 # Project:  lib.pro
 # Template: lib
 #############################################################################
--- a/gui//qtermwidget/lib/Makefile.Release
+++ b/gui//qtermwidget/lib/Makefile.Release
@@ -1,6 +1,6 @@
 #############################################################################
 # Makefile for building: libqtermwidget.a
-# Generated by qmake (2.01a) (Qt 4.7.2) on: Do. Apr 7 10:08:11 2011
+# Generated by qmake (2.01a) (Qt 4.7.2) on: Do. Apr 7 10:32:32 2011
 # Project:  lib.pro
 # Template: lib
 #############################################################################
--- a/gui//terminal.cpp
+++ b/gui//terminal.cpp
@@ -1,6 +1,16 @@
 #include "terminal.h"
 
 Terminal::Terminal()
-    : QMdiSubWindow() {
-    setWidget(new QTermWidget(1, this));
+    : QMdiSubWindow(),
+      m_terminalWidget(0) {
+    launchTerminal();
 }
+
+void Terminal::launchTerminal() {
+    delete m_terminalWidget;
+    m_terminalWidget = new QTermWidget(1, this);
+    m_terminalWidget->setScrollBarPosition(QTermWidget::ScrollBarRight);
+    setWidget(m_terminalWidget);
+
+    connect(m_terminalWidget, SIGNAL(finished()), this, SLOT(launchTerminal()));
+}
--- a/gui//terminal.h
+++ b/gui//terminal.h
@@ -5,8 +5,15 @@
 #include "qtermwidget.h"
 
 class Terminal : public QMdiSubWindow {
+    Q_OBJECT
 public:
     Terminal();
+
+private slots:
+    void launchTerminal();
+
+private:
+    QTermWidget *m_terminalWidget;
 };
 
 #endif // TERMINAL_H