Mercurial > hg > octave-lyh
annotate gui/src/terminal/QTerminalWidget.cpp @ 13506:c70511cf64ee
Reformatted to GNU Style.
author | Jacob Dawid <jacob.dawid@googlemail.com> |
---|---|
date | Sun, 17 Jul 2011 22:59:28 +0200 |
parents | 86d6c3b90ad7 |
children | 7eb8cd35454c |
rev | line source |
---|---|
13501 | 1 /* Copyright (C) 2008 e_k (e_k@users.sourceforge.net) |
2 | |
3 This library is free software; you can redistribute it and/or | |
4 modify it under the terms of the GNU Library General Public | |
5 License as published by the Free Software Foundation; either | |
6 version 2 of the License, or (at your option) any later version. | |
7 | |
8 This library is distributed in the hope that it will be useful, | |
9 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
11 Library General Public License for more details. | |
12 | |
13 You should have received a copy of the GNU Library General Public License | |
14 along with this library; see the file COPYING.LIB. If not, write to | |
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
16 Boston, MA 02110-1301, USA. | |
17 */ | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
18 |
13501 | 19 #include "QTerminalWidget.h" |
20 #include "Session.h" | |
21 #include "TerminalDisplay.h" | |
22 | |
23 struct TermWidgetImpl | |
24 { | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
25 TermWidgetImpl (QWidget * parent = 0); |
13501 | 26 |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
27 TerminalDisplay *m_terminalDisplay; |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
28 Session *m_session; |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
29 Session *createSession (); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
30 TerminalDisplay *createTerminalDisplay (Session * session, |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
31 QWidget * parent); |
13501 | 32 }; |
33 | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
34 TermWidgetImpl::TermWidgetImpl (QWidget * parent) |
13501 | 35 { |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
36 QPalette palette = QApplication::palette (); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
37 m_session = createSession (); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
38 m_terminalDisplay = createTerminalDisplay (this->m_session, parent); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
39 m_terminalDisplay->setBackgroundColor (palette.color (QPalette::Base)); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
40 m_terminalDisplay->setForegroundColor (palette.color (QPalette::Text)); |
13501 | 41 } |
42 | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
43 Session * |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
44 TermWidgetImpl::createSession () |
13501 | 45 { |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
46 Session *session = new Session (); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
47 session->setTitle (Session::NameRole, "QTerminalWidget"); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
48 session->setProgram ("/bin/bash"); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
49 session->setArguments (QStringList ()); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
50 session->setAutoClose (true); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
51 session->setCodec (QTextCodec::codecForName ("UTF-8")); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
52 session->setFlowControlEnabled (true); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
53 session->setHistoryType (HistoryTypeBuffer (1000)); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
54 session->setDarkBackground (true); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
55 session->setKeyBindings (""); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
56 return session; |
13501 | 57 } |
58 | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
59 TerminalDisplay * |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
60 TermWidgetImpl::createTerminalDisplay (Session * session, QWidget * parent) |
13501 | 61 { |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
62 TerminalDisplay *display = new TerminalDisplay (parent); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
63 display->setBellMode (TerminalDisplay::NotifyBell); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
64 display->setTerminalSizeHint (true); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
65 display->setTripleClickMode (TerminalDisplay::SelectWholeLine); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
66 display->setTerminalSizeStartup (true); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
67 display->setRandomSeed (session->sessionId () * 31); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
68 return display; |
13501 | 69 } |
70 | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
71 QTerminalWidget::QTerminalWidget (int startnow, QWidget * parent):QWidget |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
72 (parent) |
13501 | 73 { |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
74 m_impl = new TermWidgetImpl (this); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
75 |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
76 initialize (); |
13501 | 77 |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
78 if (startnow && m_impl->m_session) |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
79 { |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
80 m_impl->m_session->run (); |
13501 | 81 } |
82 | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
83 setFocus (Qt::OtherFocusReason); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
84 m_impl->m_terminalDisplay->resize (this->size ()); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
85 setFocusProxy (m_impl->m_terminalDisplay); |
13501 | 86 } |
87 | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
88 void |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
89 QTerminalWidget::startShellProgram () |
13501 | 90 { |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
91 if (m_impl->m_session->isRunning ()) |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
92 return; |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
93 |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
94 m_impl->m_session->run (); |
13501 | 95 } |
96 | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
97 void |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
98 QTerminalWidget::initialize () |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
99 { |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
100 m_impl->m_terminalDisplay->setSize (80, 40); |
13501 | 101 |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
102 QFont font = QApplication::font (); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
103 font.setFamily ("Monospace"); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
104 font.setPointSize (10); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
105 font.setStyleHint (QFont::TypeWriter); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
106 setTerminalFont (font); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
107 setScrollBarPosition (NoScrollBar); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
108 |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
109 m_impl->m_session->addView (m_impl->m_terminalDisplay); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
110 |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
111 connect (m_impl->m_session, SIGNAL (finished ()), this, |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
112 SLOT (sessionFinished ())); |
13501 | 113 } |
114 | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
115 QTerminalWidget::~QTerminalWidget () |
13501 | 116 { |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
117 emit destroyed (); |
13501 | 118 } |
119 | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
120 void |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
121 QTerminalWidget::setTerminalFont (QFont & font) |
13501 | 122 { |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
123 if (!m_impl->m_terminalDisplay) |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
124 return; |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
125 m_impl->m_terminalDisplay->setVTFont (font); |
13501 | 126 } |
127 | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
128 void |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
129 QTerminalWidget::setShellProgram (QString progname) |
13501 | 130 { |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
131 if (!m_impl->m_session) |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
132 return; |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
133 m_impl->m_session->setProgram (progname); |
13501 | 134 } |
135 | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
136 void |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
137 QTerminalWidget::openTeletype (int fd) |
13501 | 138 { |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
139 if (m_impl->m_session->isRunning ()) |
13501 | 140 return; |
141 | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
142 m_impl->m_session->openTeletype (fd); |
13501 | 143 } |
144 | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
145 void |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
146 QTerminalWidget::setArgs (QStringList & args) |
13501 | 147 { |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
148 if (!m_impl->m_session) |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
149 return; |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
150 m_impl->m_session->setArguments (args); |
13501 | 151 } |
152 | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
153 void |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
154 QTerminalWidget::setTextCodec (QTextCodec * codec) |
13501 | 155 { |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
156 if (!m_impl->m_session) |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
157 return; |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
158 m_impl->m_session->setCodec (codec); |
13501 | 159 } |
160 | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
161 void |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
162 QTerminalWidget::setSize (int h, int v) |
13501 | 163 { |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
164 if (!m_impl->m_terminalDisplay) |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
165 return; |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
166 m_impl->m_terminalDisplay->setSize (h, v); |
13501 | 167 } |
168 | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
169 void |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
170 QTerminalWidget::setHistorySize (int lines) |
13501 | 171 { |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
172 if (lines < 0) |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
173 m_impl->m_session->setHistoryType (HistoryTypeFile ()); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
174 else |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
175 m_impl->m_session->setHistoryType (HistoryTypeBuffer (lines)); |
13501 | 176 } |
177 | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
178 void |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
179 QTerminalWidget::setScrollBarPosition (ScrollBarPosition pos) |
13501 | 180 { |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
181 if (!m_impl->m_terminalDisplay) |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
182 return; |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
183 m_impl->m_terminalDisplay-> |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
184 setScrollBarPosition ((TerminalDisplay::ScrollBarPosition) pos); |
13501 | 185 } |
186 | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
187 void |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
188 QTerminalWidget::sendText (const QString & text) |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
189 { |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
190 m_impl->m_session->sendText (text); |
13501 | 191 } |
192 | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
193 void |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
194 QTerminalWidget::installEventFilterOnDisplay (QObject * object) |
13501 | 195 { |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
196 m_impl->m_terminalDisplay->installEventFilter (object); |
13501 | 197 } |
198 | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
199 void |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
200 QTerminalWidget::resizeEvent (QResizeEvent *) |
13501 | 201 { |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
202 m_impl->m_terminalDisplay->resize (this->size ()); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
203 m_impl->m_terminalDisplay->update (); |
13501 | 204 } |
205 | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
206 void |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
207 QTerminalWidget::sessionFinished () |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
208 { |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
209 emit finished (); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
210 } |