author | llornkcor <llornkcor> | 2002-10-31 20:10:52 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-10-31 20:10:52 (UTC) |
commit | ab5a63544deead5206ca47ff8bf94123aa032281 (patch) (unidiff) | |
tree | b28514032d605dc28a5bffbd6918066c81fff74f | |
parent | 16d3fac9169e400f5542ca0e3aa993cc5c5db574 (diff) | |
download | opie-ab5a63544deead5206ca47ff8bf94123aa032281.zip opie-ab5a63544deead5206ca47ff8bf94123aa032281.tar.gz opie-ab5a63544deead5206ca47ff8bf94123aa032281.tar.bz2 |
no wrap and horz scroll should work, thanks to console
-rw-r--r-- | core/apps/embeddedkonsole/TEHistory.h | 6 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/TEScreen.h | 14 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/TEWidget.cpp | 5 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/TEmulation.h | 7 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/konsole.cpp | 90 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/konsole.h | 1 |
6 files changed, 83 insertions, 40 deletions
diff --git a/core/apps/embeddedkonsole/TEHistory.h b/core/apps/embeddedkonsole/TEHistory.h index 8339ec6..11eb150 100644 --- a/core/apps/embeddedkonsole/TEHistory.h +++ b/core/apps/embeddedkonsole/TEHistory.h | |||
@@ -1,75 +1,75 @@ | |||
1 | /* -------------------------------------------------------------------------- */ | 1 | /* -------------------------------------------------------------------------- */ |
2 | /* */ | 2 | /* */ |
3 | /* [TEHistory.H] History Buffer */ | 3 | /* [TEHistory.H] History Buffer */ |
4 | /* */ | 4 | /* */ |
5 | /* -------------------------------------------------------------------------- */ | 5 | /* -------------------------------------------------------------------------- */ |
6 | /* */ | 6 | /* */ |
7 | /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ | 7 | /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ |
8 | /* */ | 8 | /* */ |
9 | /* This file is part of Konsole - an X terminal for KDE */ | 9 | /* This file is part of Konsole - an X terminal for KDE */ |
10 | /* */ | 10 | /* */ |
11 | /* -------------------------------------------------------------------------- */ | 11 | /* -------------------------------------------------------------------------- */ |
12 | /* */ | 12 | /* */ |
13 | /* Ported Konsole to Qt/Embedded */ | 13 | /* Ported Konsole to Qt/Embedded */ |
14 | /* */ | 14 | /* */ |
15 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ | 15 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ |
16 | /* */ | 16 | /* */ |
17 | /* -------------------------------------------------------------------------- */ | 17 | /* -------------------------------------------------------------------------- */ |
18 | 18 | ||
19 | #ifndef TEHISTORY_H | 19 | #ifndef TEHISTORY_H |
20 | #define TEHISTORY_H | 20 | #define TEHISTORY_H |
21 | 21 | ||
22 | #include "TECommon.h" | 22 | #include "TECommon.h" |
23 | 23 | ||
24 | /* | 24 | /* |
25 | An extendable tmpfile(1) based buffer. | 25 | An extendable tmpfile(1) based buffer. |
26 | */ | 26 | */ |
27 | class HistoryBuffer | 27 | class HistoryBuffer |
28 | { | 28 | { |
29 | public: | 29 | public: |
30 | HistoryBuffer(); | 30 | HistoryBuffer(); |
31 | ~HistoryBuffer(); | 31 | ~HistoryBuffer(); |
32 | 32 | ||
33 | public: | 33 | public: |
34 | void setScroll(bool on); | 34 | void setScroll(bool on); |
35 | bool hasScroll(); | 35 | bool hasScroll(); |
36 | 36 | ||
37 | public: | 37 | public: |
38 | void add(const unsigned char* bytes, int len); | 38 | void add(const unsigned char* bytes, int len); |
39 | void get(unsigned char* bytes, int len, int loc); | 39 | void get(unsigned char* bytes, int len, int loc); |
40 | int len(); | 40 | int len(); |
41 | 41 | ||
42 | private: | 42 | private: |
43 | int ion; | 43 | int ion; |
44 | int length; | 44 | int length; |
45 | }; | 45 | }; |
46 | 46 | ||
47 | class HistoryScroll | 47 | class HistoryScroll |
48 | { | 48 | { |
49 | public: | 49 | public: |
50 | HistoryScroll(); | 50 | HistoryScroll(); |
51 | ~HistoryScroll(); | 51 | ~HistoryScroll(); |
52 | 52 | ||
53 | public: | 53 | public: |
54 | void setScroll(bool on); | 54 | void setScroll(bool on); |
55 | bool hasScroll(); | 55 | bool hasScroll(); |
56 | 56 | ||
57 | public: // access to history | 57 | public: // access to history |
58 | int getLines(); | 58 | int getLines(); |
59 | int getLineLen(int lineno); | 59 | int getLineLen(int lineno); |
60 | void getCells(int lineno, int colno, int count, ca res[]); | 60 | void getCells(int lineno, int colno, int count, ca res[]); |
61 | 61 | ||
62 | public: // backward compatibility (obsolete) | 62 | public: // backward compatibility (obsolete) |
63 | ca getCell(int lineno, int colno) { ca res; getCells(lineno,colno,1,&res); return res; } | 63 | ca getCell(int lineno, int colno) { ca res; getCells(lineno,colno,1,&res); return res; } |
64 | 64 | ||
65 | public: // adding lines. | 65 | public: // adding lines. |
66 | void addCells(ca a[], int count); | 66 | void addCells(ca a[], int count); |
67 | void addLine(); | 67 | void addLine(); |
68 | 68 | ||
69 | private: | 69 | private: |
70 | int startOfLine(int lineno); | 70 | int startOfLine(int lineno); |
71 | HistoryBuffer index; // lines Row(int) | 71 | HistoryBuffer index; // lines Row(int) |
72 | HistoryBuffer cells; // text Row(ca) | 72 | HistoryBuffer cells; // text Row(ca) |
73 | }; | 73 | }; |
74 | 74 | ||
75 | #endif // TEHISTORY_H | 75 | #endif // TEHISTORY_H |
diff --git a/core/apps/embeddedkonsole/TEScreen.h b/core/apps/embeddedkonsole/TEScreen.h index ba47ee5..a28f7c5 100644 --- a/core/apps/embeddedkonsole/TEScreen.h +++ b/core/apps/embeddedkonsole/TEScreen.h | |||
@@ -1,259 +1,267 @@ | |||
1 | /* -------------------------------------------------------------------------- */ | 1 | /* -------------------------------------------------------------------------- */ |
2 | /* */ | 2 | /* */ |
3 | /* [te_screen.h] Screen Data Type */ | 3 | /* [te_screen.h] Screen Data Type */ |
4 | /* */ | 4 | /* */ |
5 | /* -------------------------------------------------------------------------- */ | 5 | /* -------------------------------------------------------------------------- */ |
6 | /* */ | 6 | /* */ |
7 | /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ | 7 | /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ |
8 | /* */ | 8 | /* */ |
9 | /* This file is part of Konsole - an X terminal for KDE */ | 9 | /* This file is part of Konsole - an X terminal for KDE */ |
10 | /* */ | 10 | /* */ |
11 | /* -------------------------------------------------------------------------- */ | 11 | /* -------------------------------------------------------------------------- */ |
12 | /* */ | 12 | /* */ |
13 | /* Ported Konsole to Qt/Embedded */ | 13 | /* Ported Konsole to Qt/Embedded */ |
14 | /* */ | 14 | /* */ |
15 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ | 15 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ |
16 | /* */ | 16 | /* */ |
17 | /* -------------------------------------------------------------------------- */ | 17 | /* -------------------------------------------------------------------------- */ |
18 | 18 | ||
19 | #ifndef TESCREEN_H | 19 | #ifndef TESCREEN_H |
20 | #define TESCREEN_H | 20 | #define TESCREEN_H |
21 | 21 | ||
22 | /*! \file | 22 | /*! \file |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "TECommon.h" | 25 | #include "TECommon.h" |
26 | #include "TEHistory.h" | 26 | #include "TEHistory.h" |
27 | 27 | ||
28 | #define MODE_Origin 0 | 28 | #define MODE_Origin 0 |
29 | #define MODE_Wrap 1 | 29 | #define MODE_Wrap 1 |
30 | #define MODE_Insert 2 | 30 | #define MODE_Insert 2 |
31 | #define MODE_Screen 3 | 31 | #define MODE_Screen 3 |
32 | #define MODE_Cursor 4 | 32 | #define MODE_Cursor 4 |
33 | #define MODE_NewLine 5 | 33 | #define MODE_NewLine 5 |
34 | #define MODES_SCREEN 6 | 34 | #define MODES_SCREEN 6 |
35 | 35 | ||
36 | /*! | 36 | /*! |
37 | */ | 37 | */ |
38 | struct ScreenParm | 38 | struct ScreenParm |
39 | { | 39 | { |
40 | int mode[MODES_SCREEN]; | 40 | int mode[MODES_SCREEN]; |
41 | }; | 41 | }; |
42 | 42 | ||
43 | 43 | ||
44 | class TEScreen | 44 | class TEScreen |
45 | { | 45 | { |
46 | public: | 46 | public: |
47 | TEScreen(int lines, int columns); | 47 | TEScreen(int lines, int columns); |
48 | ~TEScreen(); | 48 | ~TEScreen(); |
49 | 49 | ||
50 | public: // these are all `Screen' operations | 50 | public: // these are all `Screen' operations |
51 | // | 51 | // |
52 | // VT100/2 Operations ------------------ | 52 | // VT100/2 Operations ------------------ |
53 | // | 53 | // |
54 | // Cursor Movement | 54 | // Cursor Movement |
55 | // | 55 | // |
56 | void cursorUp (int n); | 56 | void cursorUp (int n); |
57 | void cursorDown (int n); | 57 | void cursorDown (int n); |
58 | void cursorLeft (int n); | 58 | void cursorLeft (int n); |
59 | void cursorRight (int n); | 59 | void cursorRight (int n); |
60 | void setCursorY (int y); | 60 | void setCursorY (int y); |
61 | void setCursorX (int x); | 61 | void setCursorX (int x); |
62 | void setCursorYX (int y, int x); | 62 | void setCursorYX (int y, int x); |
63 | void setMargins (int t, int b); | 63 | void setMargins (int t, int b); |
64 | // | 64 | // |
65 | // Cursor Movement with Scrolling | 65 | // Cursor Movement with Scrolling |
66 | // | 66 | // |
67 | void NewLine (); | 67 | void NewLine (); |
68 | void NextLine (); | 68 | void NextLine (); |
69 | void index (); | 69 | void index (); |
70 | void reverseIndex(); | 70 | void reverseIndex(); |
71 | // | 71 | // |
72 | void Return (); | 72 | void Return (); |
73 | void BackSpace (); | 73 | void BackSpace (); |
74 | void Tabulate (); | 74 | void Tabulate (); |
75 | // | 75 | // |
76 | // Editing | 76 | // Editing |
77 | // | 77 | // |
78 | void eraseChars (int n); | 78 | void eraseChars (int n); |
79 | void deleteChars (int n); | 79 | void deleteChars (int n); |
80 | void insertChars (int n); | 80 | void insertChars (int n); |
81 | void deleteLines (int n); | 81 | void deleteLines (int n); |
82 | void insertLines (int n); | 82 | void insertLines (int n); |
83 | // | 83 | // |
84 | // ------------------------------------- | 84 | // ------------------------------------- |
85 | // | 85 | // |
86 | void clearTabStops(); | 86 | void clearTabStops(); |
87 | void changeTabStop(bool set); | 87 | void changeTabStop(bool set); |
88 | // | 88 | // |
89 | void resetMode (int n); | 89 | void resetMode (int n); |
90 | void setMode (int n); | 90 | void setMode (int n); |
91 | void saveMode (int n); | 91 | void saveMode (int n); |
92 | void restoreMode (int n); | 92 | void restoreMode (int n); |
93 | // | 93 | // |
94 | void saveCursor (); | 94 | void saveCursor (); |
95 | void restoreCursor(); | 95 | void restoreCursor(); |
96 | // | 96 | // |
97 | // ------------------------------------- | 97 | // ------------------------------------- |
98 | // | 98 | // |
99 | void clearEntireScreen(); | 99 | void clearEntireScreen(); |
100 | void clearToEndOfScreen(); | 100 | void clearToEndOfScreen(); |
101 | void clearToBeginOfScreen(); | 101 | void clearToBeginOfScreen(); |
102 | // | 102 | // |
103 | void clearEntireLine(); | 103 | void clearEntireLine(); |
104 | void clearToEndOfLine(); | 104 | void clearToEndOfLine(); |
105 | void clearToBeginOfLine(); | 105 | void clearToBeginOfLine(); |
106 | // | 106 | // |
107 | void helpAlign (); | 107 | void helpAlign (); |
108 | // | 108 | // |
109 | // ------------------------------------- | 109 | // ------------------------------------- |
110 | // | 110 | // |
111 | void setRendition (int rendition); | 111 | void setRendition (int rendition); |
112 | void resetRendition(int rendition); | 112 | void resetRendition(int rendition); |
113 | void setForeColor (int fgcolor); | 113 | void setForeColor (int fgcolor); |
114 | void setBackColor (int bgcolor); | 114 | void setBackColor (int bgcolor); |
115 | // | 115 | // |
116 | void setDefaultRendition(); | 116 | void setDefaultRendition(); |
117 | void setForeColorToDefault(); | 117 | void setForeColorToDefault(); |
118 | void setBackColorToDefault(); | 118 | void setBackColorToDefault(); |
119 | // | 119 | // |
120 | // ------------------------------------- | 120 | // ------------------------------------- |
121 | // | 121 | // |
122 | BOOL getMode (int n); | 122 | BOOL getMode (int n); |
123 | // | 123 | // |
124 | // only for report cursor position | 124 | // only for report cursor position |
125 | // | 125 | // |
126 | int getCursorX(); | 126 | int getCursorX(); |
127 | int getCursorY(); | 127 | int getCursorY(); |
128 | // | 128 | // |
129 | // ------------------------------------- | 129 | // ------------------------------------- |
130 | // | 130 | // |
131 | void clear(); | 131 | void clear(); |
132 | void home(); | 132 | void home(); |
133 | void reset(); | 133 | void reset(); |
134 | // | 134 | // |
135 | void ShowCharacter(unsigned short c); | 135 | void ShowCharacter(unsigned short c); |
136 | // | 136 | // |
137 | void resizeImage(int new_lines, int new_columns); | 137 | void resizeImage(int new_lines, int new_columns); |
138 | // | 138 | // |
139 | ca* getCookedImage(); | 139 | ca* getCookedImage(); |
140 | 140 | ||
141 | /*! return the number of lines. */ | 141 | /*! return the number of lines. */ |
142 | int getLines() { return lines; } | 142 | int getLines() { return lines; } |
143 | |||
143 | /*! return the number of columns. */ | 144 | /*! return the number of columns. */ |
144 | int getColumns() { return columns; } | 145 | int getColumns() { return columns; } |
145 | 146 | ||
146 | /*! set the position of the history cursor. */ | 147 | /*! set the position of the history cursor. */ |
147 | void setHistCursor(int cursor); | 148 | void setHistCursor(int cursor); |
148 | /*! return the position of the history cursor. */ | 149 | /*! return the position of the history cursor. */ |
149 | int getHistCursor(); | 150 | int getHistCursor(); |
150 | 151 | ||
152 | /*! set the position of the horizontal cursor. */ | ||
153 | void setHorzCursor(int cursor); | ||
154 | /*! return the position of the horizontal cursor. */ | ||
155 | int getHorzCursor(); | ||
156 | |||
151 | int getHistLines (); | 157 | int getHistLines (); |
152 | void setScroll(bool on); | 158 | void setScroll(bool on); |
153 | bool hasScroll(); | 159 | bool hasScroll(); |
154 | 160 | ||
155 | // | 161 | // |
156 | // Selection | 162 | // Selection |
157 | // | 163 | // |
158 | void setSelBeginXY(const int x, const int y); | 164 | void setSelBeginXY(const int x, const int y); |
159 | void setSelExtentXY(const int x, const int y); | 165 | void setSelExtentXY(const int x, const int y); |
160 | void clearSelection(); | 166 | void clearSelection(); |
161 | QString getSelText(const BOOL preserve_line_breaks); | 167 | QString getSelText(const BOOL preserve_line_breaks); |
162 | 168 | ||
163 | void checkSelection(int from, int to); | 169 | void checkSelection(int from, int to); |
164 | 170 | ||
165 | private: // helper | 171 | private: // helper |
166 | 172 | ||
167 | void clearImage(int loca, int loce, char c); | 173 | void clearImage(int loca, int loce, char c); |
168 | void moveImage(int dst, int loca, int loce); | 174 | void moveImage(int dst, int loca, int loce); |
169 | 175 | ||
170 | void scrollUp(int from, int i); | 176 | void scrollUp(int from, int i); |
171 | void scrollDown(int from, int i); | 177 | void scrollDown(int from, int i); |
172 | 178 | ||
173 | void addHistLine(); | 179 | void addHistLine(); |
174 | 180 | ||
175 | void initTabStops(); | 181 | void initTabStops(); |
176 | 182 | ||
177 | void effectiveRendition(); | 183 | void effectiveRendition(); |
178 | void reverseRendition(ca* p); | 184 | void reverseRendition(ca* p); |
179 | 185 | ||
180 | private: | 186 | private: |
181 | 187 | ||
182 | /* | 188 | /* |
183 | The state of the screen is more complex as one would | 189 | The state of the screen is more complex as one would |
184 | expect first. The screem does really do part of the | 190 | expect first. The screem does really do part of the |
185 | emulation providing state informations in form of modes, | 191 | emulation providing state informations in form of modes, |
186 | margins, tabulators, cursor etc. | 192 | margins, tabulators, cursor etc. |
187 | 193 | ||
188 | Even more unexpected are variables to save and restore | 194 | Even more unexpected are variables to save and restore |
189 | parts of the state. | 195 | parts of the state. |
190 | */ | 196 | */ |
191 | 197 | ||
192 | // screen image ---------------- | 198 | // screen image ---------------- |
193 | 199 | ||
194 | int lines; | 200 | int lines; |
195 | int columns; | 201 | int columns; |
196 | ca *image; // [lines][columns] | 202 | ca *image; // [lines][columns] |
197 | 203 | ||
198 | // history buffer --------------- | 204 | // history buffer --------------- |
199 | 205 | ||
200 | int histCursor; // display position relative to start of the history buffer | 206 | int histCursor; // display position relative to start of the history buffer |
201 | HistoryScroll hist; | 207 | HistoryScroll hist; |
208 | |||
209 | int horzCursor; | ||
202 | 210 | ||
203 | // cursor location | 211 | // cursor location |
204 | 212 | ||
205 | int cuX; | 213 | int cuX; |
206 | int cuY; | 214 | int cuY; |
207 | 215 | ||
208 | // cursor color and rendition info | 216 | // cursor color and rendition info |
209 | 217 | ||
210 | UINT8 cu_fg; // foreground | 218 | UINT8 cu_fg; // foreground |
211 | UINT8 cu_bg; // background | 219 | UINT8 cu_bg; // background |
212 | UINT8 cu_re; // rendition | 220 | UINT8 cu_re; // rendition |
213 | 221 | ||
214 | // margins ---------------- | 222 | // margins ---------------- |
215 | 223 | ||
216 | int tmargin; // top margin | 224 | int tmargin; // top margin |
217 | int bmargin; // bottom margin | 225 | int bmargin; // bottom margin |
218 | 226 | ||
219 | // states ---------------- | 227 | // states ---------------- |
220 | 228 | ||
221 | ScreenParm currParm; | 229 | ScreenParm currParm; |
222 | 230 | ||
223 | // ---------------------------- | 231 | // ---------------------------- |
224 | 232 | ||
225 | bool* tabstops; | 233 | bool* tabstops; |
226 | 234 | ||
227 | // selection ------------------- | 235 | // selection ------------------- |
228 | 236 | ||
229 | int sel_begin; // The first location selected. | 237 | int sel_begin; // The first location selected. |
230 | int sel_TL; // TopLeft Location. | 238 | int sel_TL; // TopLeft Location. |
231 | int sel_BR; // Bottom Right Location. | 239 | int sel_BR; // Bottom Right Location. |
232 | 240 | ||
233 | // effective colors and rendition ------------ | 241 | // effective colors and rendition ------------ |
234 | 242 | ||
235 | UINT8 ef_fg; // These are derived from | 243 | UINT8 ef_fg; // These are derived from |
236 | UINT8 ef_bg; // the cu_* variables above | 244 | UINT8 ef_bg; // the cu_* variables above |
237 | UINT8 ef_re; // to speed up operation | 245 | UINT8 ef_re; // to speed up operation |
238 | 246 | ||
239 | // | 247 | // |
240 | // save cursor, rendition & states ------------ | 248 | // save cursor, rendition & states ------------ |
241 | // | 249 | // |
242 | 250 | ||
243 | // cursor location | 251 | // cursor location |
244 | 252 | ||
245 | int sa_cuX; | 253 | int sa_cuX; |
246 | int sa_cuY; | 254 | int sa_cuY; |
247 | 255 | ||
248 | // rendition info | 256 | // rendition info |
249 | 257 | ||
250 | UINT8 sa_cu_re; | 258 | UINT8 sa_cu_re; |
251 | UINT8 sa_cu_fg; | 259 | UINT8 sa_cu_fg; |
252 | UINT8 sa_cu_bg; | 260 | UINT8 sa_cu_bg; |
253 | 261 | ||
254 | // modes | 262 | // modes |
255 | 263 | ||
256 | ScreenParm saveParm; | 264 | ScreenParm saveParm; |
257 | }; | 265 | }; |
258 | 266 | ||
259 | #endif // TESCREEN_H | 267 | #endif // TESCREEN_H |
diff --git a/core/apps/embeddedkonsole/TEWidget.cpp b/core/apps/embeddedkonsole/TEWidget.cpp index c10c7a8..60021f4 100644 --- a/core/apps/embeddedkonsole/TEWidget.cpp +++ b/core/apps/embeddedkonsole/TEWidget.cpp | |||
@@ -239,193 +239,194 @@ static QChar identicalMap(QChar c) | |||
239 | { | 239 | { |
240 | return c; | 240 | return c; |
241 | } | 241 | } |
242 | 242 | ||
243 | void TEWidget::fontChange(const QFont &) | 243 | void TEWidget::fontChange(const QFont &) |
244 | { | 244 | { |
245 | QFontMetrics fm(font()); | 245 | QFontMetrics fm(font()); |
246 | font_h = fm.height(); | 246 | font_h = fm.height(); |
247 | font_w = fm.maxWidth(); | 247 | font_w = fm.maxWidth(); |
248 | font_a = fm.ascent(); | 248 | font_a = fm.ascent(); |
249 | //printf("font_h: %d\n",font_h); | 249 | //printf("font_h: %d\n",font_h); |
250 | //printf("font_w: %d\n",font_w); | 250 | //printf("font_w: %d\n",font_w); |
251 | //printf("font_a: %d\n",font_a); | 251 | //printf("font_a: %d\n",font_a); |
252 | //printf("charset: %s\n",QFont::encodingName(font().charSet()).ascii()); | 252 | //printf("charset: %s\n",QFont::encodingName(font().charSet()).ascii()); |
253 | //printf("rawname: %s\n",font().rawName().ascii()); | 253 | //printf("rawname: %s\n",font().rawName().ascii()); |
254 | fontMap = | 254 | fontMap = |
255 | #if QT_VERSION < 300 | 255 | #if QT_VERSION < 300 |
256 | strcmp(QFont::encodingName(font().charSet()).ascii(),"iso10646") | 256 | strcmp(QFont::encodingName(font().charSet()).ascii(),"iso10646") |
257 | ? vt100extended | 257 | ? vt100extended |
258 | : | 258 | : |
259 | #endif | 259 | #endif |
260 | identicalMap; | 260 | identicalMap; |
261 | propagateSize(); | 261 | propagateSize(); |
262 | update(); | 262 | update(); |
263 | } | 263 | } |
264 | 264 | ||
265 | void TEWidget::setVTFont(const QFont& f) | 265 | void TEWidget::setVTFont(const QFont& f) |
266 | { | 266 | { |
267 | QFrame::setFont(f); | 267 | QFrame::setFont(f); |
268 | } | 268 | } |
269 | 269 | ||
270 | QFont TEWidget::getVTFont() { | 270 | QFont TEWidget::getVTFont() { |
271 | return font(); | 271 | return font(); |
272 | } | 272 | } |
273 | 273 | ||
274 | void TEWidget::setFont(const QFont &) | 274 | void TEWidget::setFont(const QFont &) |
275 | { | 275 | { |
276 | // ignore font change request if not coming from konsole itself | 276 | // ignore font change request if not coming from konsole itself |
277 | } | 277 | } |
278 | 278 | ||
279 | /* ------------------------------------------------------------------------- */ | 279 | /* ------------------------------------------------------------------------- */ |
280 | /* */ | 280 | /* */ |
281 | /* Constructor / Destructor */ | 281 | /* Constructor / Destructor */ |
282 | /* */ | 282 | /* */ |
283 | /* ------------------------------------------------------------------------- */ | 283 | /* ------------------------------------------------------------------------- */ |
284 | 284 | ||
285 | TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name) | 285 | TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name) |
286 | { | 286 | { |
287 | #ifndef QT_NO_CLIPBOARD | 287 | #ifndef QT_NO_CLIPBOARD |
288 | cb = QApplication::clipboard(); | 288 | cb = QApplication::clipboard(); |
289 | QObject::connect( (QObject*)cb, SIGNAL(dataChanged()), | 289 | QObject::connect( (QObject*)cb, SIGNAL(dataChanged()), |
290 | this, SLOT(onClearSelection()) ); | 290 | this, SLOT(onClearSelection()) ); |
291 | #endif | 291 | #endif |
292 | 292 | ||
293 | scrollbar = new QScrollBar(this); | 293 | scrollbar = new QScrollBar(this); |
294 | scrollbar->setCursor( arrowCursor ); | 294 | scrollbar->setCursor( arrowCursor ); |
295 | connect(scrollbar, SIGNAL(valueChanged(int)), this, SLOT(scrollChanged(int))); | 295 | connect(scrollbar, SIGNAL(valueChanged(int)), this, SLOT(scrollChanged(int))); |
296 | 296 | ||
297 | hScrollbar = new QScrollBar(this); | 297 | hScrollbar = new QScrollBar(this); |
298 | hScrollbar->setCursor( arrowCursor ); | 298 | hScrollbar->setCursor( arrowCursor ); |
299 | hScrollbar->setOrientation(QScrollBar::Horizontal); | 299 | hScrollbar->setOrientation(QScrollBar::Horizontal); |
300 | hScrollbar->setMaximumHeight(16); | 300 | hScrollbar->setMaximumHeight(16); |
301 | 301 | ||
302 | connect( hScrollbar, SIGNAL(valueChanged(int)), this, SLOT( hScrollChanged(int))); | 302 | connect( hScrollbar, SIGNAL(valueChanged(int)), this, SLOT( hScrollChanged(int))); |
303 | 303 | ||
304 | Config cfg("Konsole"); | 304 | Config cfg("Konsole"); |
305 | cfg.setGroup("ScrollBar"); | 305 | cfg.setGroup("ScrollBar"); |
306 | switch( cfg.readNumEntry("Position",2)){ | 306 | switch( cfg.readNumEntry("Position",2)){ |
307 | case 0: | 307 | case 0: |
308 | scrollLoc = SCRNONE; | 308 | scrollLoc = SCRNONE; |
309 | break; | 309 | break; |
310 | case 1: | 310 | case 1: |
311 | scrollLoc = SCRLEFT; | 311 | scrollLoc = SCRLEFT; |
312 | break; | 312 | break; |
313 | case 2: | 313 | case 2: |
314 | scrollLoc = SCRRIGHT; | 314 | scrollLoc = SCRRIGHT; |
315 | break; | 315 | break; |
316 | }; | 316 | }; |
317 | 317 | ||
318 | useHorzScroll=cfg.readBoolEntry("HorzScroll",0); | 318 | useHorzScroll=cfg.readBoolEntry("HorzScroll",0); |
319 | 319 | ||
320 | blinkT = new QTimer(this); | 320 | blinkT = new QTimer(this); |
321 | connect(blinkT, SIGNAL(timeout()), this, SLOT(blinkEvent())); | 321 | connect(blinkT, SIGNAL(timeout()), this, SLOT(blinkEvent())); |
322 | // blinking = FALSE; | 322 | // blinking = FALSE; |
323 | blinking = TRUE; | 323 | blinking = TRUE; |
324 | 324 | ||
325 | resizing = FALSE; | 325 | resizing = FALSE; |
326 | actSel = 0; | 326 | actSel = 0; |
327 | image = 0; | 327 | image = 0; |
328 | lines = 1; | 328 | lines = 1; |
329 | columns = 1; | 329 | columns = 1; |
330 | font_w = 1; | 330 | font_w = 1; |
331 | font_h = 1; | 331 | font_h = 1; |
332 | font_a = 1; | 332 | font_a = 1; |
333 | word_selection_mode = FALSE; | 333 | word_selection_mode = FALSE; |
334 | hposition = 0; | 334 | hposition = 0; |
335 | 335 | vcolumns = 0; | |
336 | |||
336 | setMouseMarks(TRUE); | 337 | setMouseMarks(TRUE); |
337 | setVTFont( QFont("fixed") ); | 338 | setVTFont( QFont("fixed") ); |
338 | setColorTable(base_color_table); // init color table | 339 | setColorTable(base_color_table); // init color table |
339 | 340 | ||
340 | qApp->installEventFilter( this ); //FIXME: see below | 341 | qApp->installEventFilter( this ); //FIXME: see below |
341 | // KCursor::setAutoHideCursor( this, true ); | 342 | // KCursor::setAutoHideCursor( this, true ); |
342 | 343 | ||
343 | // Init DnD //////////////////////////////////////////////////////////////// | 344 | // Init DnD //////////////////////////////////////////////////////////////// |
344 | currentSession = NULL; | 345 | currentSession = NULL; |
345 | // setAcceptDrops(true); // attempt | 346 | // setAcceptDrops(true); // attempt |
346 | // m_drop = new QPopupMenu(this); | 347 | // m_drop = new QPopupMenu(this); |
347 | // m_drop->insertItem( QString("Paste"), 0); | 348 | // m_drop->insertItem( QString("Paste"), 0); |
348 | // m_drop->insertItem( QString("cd"), 1); | 349 | // m_drop->insertItem( QString("cd"), 1); |
349 | // connect(m_drop, SIGNAL(activated(int)), SLOT(drop_menu_activated(int))); | 350 | // connect(m_drop, SIGNAL(activated(int)), SLOT(drop_menu_activated(int))); |
350 | 351 | ||
351 | // we need focus so that the auto-hide cursor feature works | 352 | // we need focus so that the auto-hide cursor feature works |
352 | setFocus(); | 353 | setFocus(); |
353 | setFocusPolicy( WheelFocus ); | 354 | setFocusPolicy( WheelFocus ); |
354 | } | 355 | } |
355 | 356 | ||
356 | //FIXME: make proper destructor | 357 | //FIXME: make proper destructor |
357 | // Here's a start (David) | 358 | // Here's a start (David) |
358 | TEWidget::~TEWidget() | 359 | TEWidget::~TEWidget() |
359 | { | 360 | { |
360 | qApp->removeEventFilter( this ); | 361 | qApp->removeEventFilter( this ); |
361 | if (image) free(image); | 362 | if (image) free(image); |
362 | } | 363 | } |
363 | 364 | ||
364 | /* ------------------------------------------------------------------------- */ | 365 | /* ------------------------------------------------------------------------- */ |
365 | /* */ | 366 | /* */ |
366 | /* Display Operations */ | 367 | /* Display Operations */ |
367 | /* */ | 368 | /* */ |
368 | /* ------------------------------------------------------------------------- */ | 369 | /* ------------------------------------------------------------------------- */ |
369 | 370 | ||
370 | /*! | 371 | /*! |
371 | attributed string draw primitive | 372 | attributed string draw primitive |
372 | */ | 373 | */ |
373 | 374 | ||
374 | void TEWidget::drawAttrStr(QPainter &paint, QRect rect, | 375 | void TEWidget::drawAttrStr(QPainter &paint, QRect rect, |
375 | QString& str, ca attr, BOOL pm, BOOL clear) | 376 | QString& str, ca attr, BOOL pm, BOOL clear) |
376 | { | 377 | { |
377 | if (pm && color_table[attr.b].transparent) | 378 | if (pm && color_table[attr.b].transparent) |
378 | { | 379 | { |
379 | paint.setBackgroundMode( TransparentMode ); | 380 | paint.setBackgroundMode( TransparentMode ); |
380 | if (clear) erase(rect); | 381 | if (clear) erase(rect); |
381 | } | 382 | } |
382 | else | 383 | else |
383 | { | 384 | { |
384 | if (blinking) | 385 | if (blinking) |
385 | paint.fillRect(rect, color_table[attr.b].color); | 386 | paint.fillRect(rect, color_table[attr.b].color); |
386 | else | 387 | else |
387 | { | 388 | { |
388 | paint.setBackgroundMode( OpaqueMode ); | 389 | paint.setBackgroundMode( OpaqueMode ); |
389 | paint.setBackgroundColor( color_table[attr.b].color ); | 390 | paint.setBackgroundColor( color_table[attr.b].color ); |
390 | } | 391 | } |
391 | } | 392 | } |
392 | 393 | ||
393 | if (color_table[attr.f].bold) | 394 | if (color_table[attr.f].bold) |
394 | paint.setPen(QColor( 0x8F, 0x00, 0x00 )); | 395 | paint.setPen(QColor( 0x8F, 0x00, 0x00 )); |
395 | else | 396 | else |
396 | paint.setPen(color_table[attr.f].color); | 397 | paint.setPen(color_table[attr.f].color); |
397 | 398 | ||
398 | paint.drawText(rect.x(),rect.y()+font_a, str); | 399 | paint.drawText(rect.x(),rect.y()+font_a, str); |
399 | 400 | ||
400 | if (attr.r & RE_UNDERLINE) | 401 | if (attr.r & RE_UNDERLINE) |
401 | paint.drawLine(rect.left(), rect.y()+font_a+1, rect.right(),rect.y()+font_a+1 ); | 402 | paint.drawLine(rect.left(), rect.y()+font_a+1, rect.right(),rect.y()+font_a+1 ); |
402 | } | 403 | } |
403 | 404 | ||
404 | /*! | 405 | /*! |
405 | The image can only be set completely. | 406 | The image can only be set completely. |
406 | 407 | ||
407 | The size of the new image may or may not match the size of the widget. | 408 | The size of the new image may or may not match the size of the widget. |
408 | */ | 409 | */ |
409 | 410 | ||
410 | void TEWidget::setImage(const ca* const newimg, int lines, int columns) | 411 | void TEWidget::setImage(const ca* const newimg, int lines, int columns) |
411 | { int y,x,len; | 412 | { int y,x,len; |
412 | const QPixmap* pm = backgroundPixmap(); | 413 | const QPixmap* pm = backgroundPixmap(); |
413 | QPainter paint; | 414 | QPainter paint; |
414 | setUpdatesEnabled(FALSE); | 415 | setUpdatesEnabled(FALSE); |
415 | paint.begin( this ); | 416 | paint.begin( this ); |
416 | HCNT("setImage"); | 417 | HCNT("setImage"); |
417 | 418 | ||
418 | QPoint tL = contentsRect().topLeft(); | 419 | QPoint tL = contentsRect().topLeft(); |
419 | int tLx = tL.x(); | 420 | int tLx = tL.x(); |
420 | int tLy = tL.y(); | 421 | int tLy = tL.y(); |
421 | hasBlinker = FALSE; | 422 | hasBlinker = FALSE; |
422 | 423 | ||
423 | int cf = -1; // undefined | 424 | int cf = -1; // undefined |
424 | int cb = -1; // undefined | 425 | int cb = -1; // undefined |
425 | int cr = -1; // undefined | 426 | int cr = -1; // undefined |
426 | 427 | ||
427 | int lins = QMIN(this->lines, QMAX(0,lines )); | 428 | int lins = QMIN(this->lines, QMAX(0,lines )); |
428 | int cols = QMIN(this->columns,QMAX(0,columns)); | 429 | int cols = QMIN(this->columns,QMAX(0,columns)); |
429 | QChar *disstrU = new QChar[cols]; | 430 | QChar *disstrU = new QChar[cols]; |
430 | for (y = 0; y < lins; y++) { | 431 | for (y = 0; y < lins; y++) { |
431 | const ca* lcl = &image[y*this->columns]; | 432 | const ca* lcl = &image[y*this->columns]; |
@@ -1310,98 +1311,96 @@ void TEWidget::dragEnterEvent(QDragEnterEvent* e) | |||
1310 | QUriDrag::canDecode(e)); | 1311 | QUriDrag::canDecode(e)); |
1311 | } | 1312 | } |
1312 | 1313 | ||
1313 | void TEWidget::dropEvent(QDropEvent* event) | 1314 | void TEWidget::dropEvent(QDropEvent* event) |
1314 | { | 1315 | { |
1315 | // The current behaviour when url(s) are dropped is | 1316 | // The current behaviour when url(s) are dropped is |
1316 | // * if there is only ONE url and if it's a LOCAL one, ask for paste or cd | 1317 | // * if there is only ONE url and if it's a LOCAL one, ask for paste or cd |
1317 | // * in all other cases, just paste | 1318 | // * in all other cases, just paste |
1318 | // (for non-local ones, or for a list of URLs, 'cd' is nonsense) | 1319 | // (for non-local ones, or for a list of URLs, 'cd' is nonsense) |
1319 | QStrList strlist; | 1320 | QStrList strlist; |
1320 | int file_count = 0; | 1321 | int file_count = 0; |
1321 | dropText = ""; | 1322 | dropText = ""; |
1322 | bool bPopup = true; | 1323 | bool bPopup = true; |
1323 | 1324 | ||
1324 | if(QUriDrag::decode(event, strlist)) { | 1325 | if(QUriDrag::decode(event, strlist)) { |
1325 | if (strlist.count()) { | 1326 | if (strlist.count()) { |
1326 | for(const char* p = strlist.first(); p; p = strlist.next()) { | 1327 | for(const char* p = strlist.first(); p; p = strlist.next()) { |
1327 | if(file_count++ > 0) { | 1328 | if(file_count++ > 0) { |
1328 | dropText += " "; | 1329 | dropText += " "; |
1329 | bPopup = false; // more than one file, don't popup | 1330 | bPopup = false; // more than one file, don't popup |
1330 | } | 1331 | } |
1331 | 1332 | ||
1332 | /* | 1333 | /* |
1333 | KURL url(p); | 1334 | KURL url(p); |
1334 | if (url.isLocalFile()) { | 1335 | if (url.isLocalFile()) { |
1335 | dropText += url.path(); // local URL : remove protocol | 1336 | dropText += url.path(); // local URL : remove protocol |
1336 | } | 1337 | } |
1337 | else { | 1338 | else { |
1338 | dropText += url.prettyURL(); | 1339 | dropText += url.prettyURL(); |
1339 | bPopup = false; // a non-local file, don't popup | 1340 | bPopup = false; // a non-local file, don't popup |
1340 | } | 1341 | } |
1341 | */ | 1342 | */ |
1342 | 1343 | ||
1343 | } | 1344 | } |
1344 | 1345 | ||
1345 | if (bPopup) | 1346 | if (bPopup) |
1346 | // m_drop->popup(pos() + event->pos()); | 1347 | // m_drop->popup(pos() + event->pos()); |
1347 | m_drop->popup(mapToGlobal(event->pos())); | 1348 | m_drop->popup(mapToGlobal(event->pos())); |
1348 | else | 1349 | else |
1349 | { | 1350 | { |
1350 | if (currentSession) { | 1351 | if (currentSession) { |
1351 | currentSession->getEmulation()->sendString(dropText.local8Bit()); | 1352 | currentSession->getEmulation()->sendString(dropText.local8Bit()); |
1352 | } | 1353 | } |
1353 | // kdDebug() << "Drop:" << dropText.local8Bit() << "\n"; | 1354 | // kdDebug() << "Drop:" << dropText.local8Bit() << "\n"; |
1354 | } | 1355 | } |
1355 | } | 1356 | } |
1356 | } | 1357 | } |
1357 | else if(QTextDrag::decode(event, dropText)) { | 1358 | else if(QTextDrag::decode(event, dropText)) { |
1358 | // kdDebug() << "Drop:" << dropText.local8Bit() << "\n"; | 1359 | // kdDebug() << "Drop:" << dropText.local8Bit() << "\n"; |
1359 | if (currentSession) { | 1360 | if (currentSession) { |
1360 | currentSession->getEmulation()->sendString(dropText.local8Bit()); | 1361 | currentSession->getEmulation()->sendString(dropText.local8Bit()); |
1361 | } | 1362 | } |
1362 | // Paste it | 1363 | // Paste it |
1363 | } | 1364 | } |
1364 | } | 1365 | } |
1365 | #endif | 1366 | #endif |
1366 | 1367 | ||
1367 | 1368 | ||
1368 | void TEWidget::drop_menu_activated(int item) | 1369 | void TEWidget::drop_menu_activated(int item) |
1369 | { | 1370 | { |
1370 | #ifndef QT_NO_DRAGANDDROP | 1371 | #ifndef QT_NO_DRAGANDDROP |
1371 | switch (item) | 1372 | switch (item) |
1372 | { | 1373 | { |
1373 | case 0: // paste | 1374 | case 0: // paste |
1374 | currentSession->getEmulation()->sendString(dropText.local8Bit()); | 1375 | currentSession->getEmulation()->sendString(dropText.local8Bit()); |
1375 | // KWM::activate((Window)this->winId()); | 1376 | // KWM::activate((Window)this->winId()); |
1376 | break; | 1377 | break; |
1377 | case 1: // cd ... | 1378 | case 1: // cd ... |
1378 | currentSession->getEmulation()->sendString("cd "); | 1379 | currentSession->getEmulation()->sendString("cd "); |
1379 | struct stat statbuf; | 1380 | struct stat statbuf; |
1380 | if ( ::stat( QFile::encodeName( dropText ), &statbuf ) == 0 ) | 1381 | if ( ::stat( QFile::encodeName( dropText ), &statbuf ) == 0 ) |
1381 | { | 1382 | { |
1382 | if ( !S_ISDIR(statbuf.st_mode) ) | 1383 | if ( !S_ISDIR(statbuf.st_mode) ) |
1383 | { | 1384 | { |
1384 | /* | 1385 | /* |
1385 | KURL url; | 1386 | KURL url; |
1386 | url.setPath( dropText ); | 1387 | url.setPath( dropText ); |
1387 | dropText = url.directory( true, false ); // remove filename | 1388 | dropText = url.directory( true, false ); // remove filename |
1388 | */ | 1389 | */ |
1389 | } | 1390 | } |
1390 | } | 1391 | } |
1391 | dropText.replace(QRegExp(" "), "\\ "); // escape spaces | 1392 | dropText.replace(QRegExp(" "), "\\ "); // escape spaces |
1392 | currentSession->getEmulation()->sendString(dropText.local8Bit()); | 1393 | currentSession->getEmulation()->sendString(dropText.local8Bit()); |
1393 | currentSession->getEmulation()->sendString("\n"); | 1394 | currentSession->getEmulation()->sendString("\n"); |
1394 | // KWM::activate((Window)this->winId()); | 1395 | // KWM::activate((Window)this->winId()); |
1395 | break; | 1396 | break; |
1396 | } | 1397 | } |
1397 | #endif | 1398 | #endif |
1398 | } | 1399 | } |
1399 | 1400 | ||
1400 | void TEWidget::setWrapAt(int columns) | 1401 | void TEWidget::setWrapAt(int columns) |
1401 | { | 1402 | { |
1402 | vcolumns = columns; | 1403 | vcolumns = columns; |
1403 | propagateSize(); | 1404 | propagateSize(); |
1404 | update(); | 1405 | update(); |
1405 | } | 1406 | } |
1406 | |||
1407 | |||
diff --git a/core/apps/embeddedkonsole/TEmulation.h b/core/apps/embeddedkonsole/TEmulation.h index ec15e7a..bf43f11 100644 --- a/core/apps/embeddedkonsole/TEmulation.h +++ b/core/apps/embeddedkonsole/TEmulation.h | |||
@@ -1,117 +1,118 @@ | |||
1 | /* -------------------------------------------------------------------------- */ | 1 | /* -------------------------------------------------------------------------- */ |
2 | /* */ | 2 | /* */ |
3 | /* [emulation.h] Fundamental Terminal Emulation */ | 3 | /* [emulation.h] Fundamental Terminal Emulation */ |
4 | /* */ | 4 | /* */ |
5 | /* -------------------------------------------------------------------------- */ | 5 | /* -------------------------------------------------------------------------- */ |
6 | /* */ | 6 | /* */ |
7 | /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ | 7 | /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ |
8 | /* */ | 8 | /* */ |
9 | /* This file is part of Konsole - an X terminal for KDE */ | 9 | /* This file is part of Konsole - an X terminal for KDE */ |
10 | /* */ | 10 | /* */ |
11 | /* -------------------------------------------------------------------------- */ | 11 | /* -------------------------------------------------------------------------- */ |
12 | /* */ | 12 | /* */ |
13 | /* Ported Konsole to Qt/Embedded */ | 13 | /* Ported Konsole to Qt/Embedded */ |
14 | /* */ | 14 | /* */ |
15 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ | 15 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ |
16 | /* */ | 16 | /* */ |
17 | /* -------------------------------------------------------------------------- */ | 17 | /* -------------------------------------------------------------------------- */ |
18 | 18 | ||
19 | #ifndef EMULATION_H | 19 | #ifndef EMULATION_H |
20 | #define EMULATION_H | 20 | #define EMULATION_H |
21 | 21 | ||
22 | #include "TEWidget.h" | 22 | #include "TEWidget.h" |
23 | #include "TEScreen.h" | 23 | #include "TEScreen.h" |
24 | #include <qtimer.h> | 24 | #include <qtimer.h> |
25 | #include <stdio.h> | 25 | #include <stdio.h> |
26 | #include <qtextcodec.h> | 26 | #include <qtextcodec.h> |
27 | #include "keytrans.h" | 27 | #include "keytrans.h" |
28 | 28 | ||
29 | class TEmulation : public QObject | 29 | class TEmulation : public QObject |
30 | { Q_OBJECT | 30 | { Q_OBJECT |
31 | 31 | ||
32 | public: | 32 | public: |
33 | 33 | ||
34 | TEmulation(TEWidget* gui); | 34 | TEmulation(TEWidget* gui); |
35 | ~TEmulation(); | 35 | ~TEmulation(); |
36 | 36 | ||
37 | public: | 37 | public: |
38 | virtual void setHistory(bool on); | 38 | virtual void setHistory(bool on); |
39 | virtual bool history(); | 39 | virtual bool history(); |
40 | 40 | ||
41 | public slots: // signals incoming from TEWidget | 41 | public slots: // signals incoming from TEWidget |
42 | 42 | ||
43 | virtual void onImageSizeChange(int lines, int columns); | 43 | virtual void onImageSizeChange(int lines, int columns); |
44 | virtual void onHistoryCursorChange(int cursor); | 44 | virtual void onHistoryCursorChange(int cursor); |
45 | virtual void onHorzCursorChange(int cursor); | ||
45 | virtual void onKeyPress(QKeyEvent*); | 46 | virtual void onKeyPress(QKeyEvent*); |
46 | 47 | ||
47 | virtual void clearSelection(); | 48 | virtual void clearSelection(); |
48 | virtual void onSelectionBegin(const int x, const int y); | 49 | virtual void onSelectionBegin(const int x, const int y); |
49 | virtual void onSelectionExtend(const int x, const int y); | 50 | virtual void onSelectionExtend(const int x, const int y); |
50 | virtual void setSelection(const BOOL preserve_line_breaks); | 51 | virtual void setSelection(const BOOL preserve_line_breaks); |
51 | 52 | ||
52 | public slots: // signals incoming from data source | 53 | public slots: // signals incoming from data source |
53 | 54 | ||
54 | void onRcvBlock(const char* txt,int len); | 55 | void onRcvBlock(const char* txt,int len); |
55 | 56 | ||
56 | signals: | 57 | signals: |
57 | 58 | ||
58 | void sndBlock(const char* txt,int len); | 59 | void sndBlock(const char* txt,int len); |
59 | void ImageSizeChanged(int lines, int columns); | 60 | void ImageSizeChanged(int lines, int columns); |
60 | void changeColumns(int columns); | 61 | void changeColumns(int columns); |
61 | void changeTitle(int arg, const char* str); | 62 | void changeTitle(int arg, const char* str); |
62 | 63 | ||
63 | public: | 64 | public: |
64 | 65 | ||
65 | virtual void onRcvChar(int); | 66 | virtual void onRcvChar(int); |
66 | 67 | ||
67 | virtual void setMode (int) = 0; | 68 | virtual void setMode (int) = 0; |
68 | virtual void resetMode(int) = 0; | 69 | virtual void resetMode(int) = 0; |
69 | 70 | ||
70 | virtual void sendString(const char*) = 0; | 71 | virtual void sendString(const char*) = 0; |
71 | 72 | ||
72 | virtual void setConnect(bool r); | 73 | virtual void setConnect(bool r); |
73 | void setColumns(int columns); | 74 | void setColumns(int columns); |
74 | 75 | ||
75 | void setKeytrans(int no); | 76 | void setKeytrans(int no); |
76 | void setKeytrans(const char * no); | 77 | void setKeytrans(const char * no); |
77 | 78 | ||
78 | protected: | 79 | protected: |
79 | 80 | ||
80 | TEWidget* gui; | 81 | TEWidget* gui; |
81 | TEScreen* scr; // referes to one `screen' | 82 | TEScreen* scr; // referes to one `screen' |
82 | TEScreen* screen[2]; // 0 = primary, 1 = alternate | 83 | TEScreen* screen[2]; // 0 = primary, 1 = alternate |
83 | void setScreen(int n); // set `scr' to `screen[n]' | 84 | void setScreen(int n); // set `scr' to `screen[n]' |
84 | 85 | ||
85 | bool connected; // communicate with widget | 86 | bool connected; // communicate with widget |
86 | 87 | ||
87 | void setCodec(int c); // codec number, 0 = locale, 1=utf8 | 88 | void setCodec(int c); // codec number, 0 = locale, 1=utf8 |
88 | 89 | ||
89 | QTextCodec* codec; | 90 | QTextCodec* codec; |
90 | QTextCodec* localeCodec; | 91 | QTextCodec* localeCodec; |
91 | QTextDecoder* decoder; | 92 | QTextDecoder* decoder; |
92 | 93 | ||
93 | KeyTrans* keytrans; | 94 | KeyTrans* keytrans; |
94 | 95 | ||
95 | // refreshing related material. | 96 | // refreshing related material. |
96 | // this is localized in the class. | 97 | // this is localized in the class. |
97 | private slots: // triggered by timer | 98 | private slots: // triggered by timer |
98 | 99 | ||
99 | void showBulk(); | 100 | void showBulk(); |
100 | 101 | ||
101 | private: | 102 | private: |
102 | 103 | ||
103 | void bulkNewline(); | 104 | void bulkNewline(); |
104 | void bulkStart(); | 105 | void bulkStart(); |
105 | void bulkEnd(); | 106 | void bulkEnd(); |
106 | 107 | ||
107 | private: | 108 | private: |
108 | 109 | ||
109 | QTimer bulk_timer; | 110 | QTimer bulk_timer; |
110 | int bulk_nlcnt; // bulk newline counter | 111 | int bulk_nlcnt; // bulk newline counter |
111 | char* SelectedText; | 112 | char* SelectedText; |
112 | int bulk_incnt; // bulk counter | 113 | int bulk_incnt; // bulk counter |
113 | 114 | ||
114 | 115 | ||
115 | }; | 116 | }; |
116 | 117 | ||
117 | #endif // ifndef EMULATION_H | 118 | #endif // ifndef EMULATION_H |
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp index 3c87ad4..16db0ea 100644 --- a/core/apps/embeddedkonsole/konsole.cpp +++ b/core/apps/embeddedkonsole/konsole.cpp | |||
@@ -265,233 +265,237 @@ void Konsole::init(const char* _pgm, QStrList & _args) | |||
265 | listHidden=TRUE; | 265 | listHidden=TRUE; |
266 | } else { | 266 | } else { |
267 | editCommandListMenu->insertItem( tr( "Hide command list" )); | 267 | editCommandListMenu->insertItem( tr( "Hide command list" )); |
268 | listHidden=FALSE; | 268 | listHidden=FALSE; |
269 | } | 269 | } |
270 | 270 | ||
271 | cfg.setGroup("Tabs"); | 271 | cfg.setGroup("Tabs"); |
272 | tmp=cfg.readEntry("Position","Bottom"); | 272 | tmp=cfg.readEntry("Position","Bottom"); |
273 | if(tmp=="Top") { | 273 | if(tmp=="Top") { |
274 | tab->setTabPosition(QTabWidget::Top); | 274 | tab->setTabPosition(QTabWidget::Top); |
275 | configMenu->insertItem( tr( "Tabs on Bottom" ) ); | 275 | configMenu->insertItem( tr( "Tabs on Bottom" ) ); |
276 | } else { | 276 | } else { |
277 | tab->setTabPosition(QTabWidget::Bottom); | 277 | tab->setTabPosition(QTabWidget::Bottom); |
278 | configMenu->insertItem("Tabs on Top"); | 278 | configMenu->insertItem("Tabs on Top"); |
279 | } | 279 | } |
280 | configMenu->insertSeparator(2); | 280 | configMenu->insertSeparator(2); |
281 | 281 | ||
282 | colorMenu->insertItem(tr( "Green on Black")); | 282 | colorMenu->insertItem(tr( "Green on Black")); |
283 | colorMenu->insertItem(tr( "Black on White")); | 283 | colorMenu->insertItem(tr( "Black on White")); |
284 | colorMenu->insertItem(tr( "White on Black")); | 284 | colorMenu->insertItem(tr( "White on Black")); |
285 | colorMenu->insertItem(tr( "Black on Transparent")); | 285 | colorMenu->insertItem(tr( "Black on Transparent")); |
286 | colorMenu->insertItem(tr( "Black on Red")); | 286 | colorMenu->insertItem(tr( "Black on Red")); |
287 | colorMenu->insertItem(tr( "Red on Black")); | 287 | colorMenu->insertItem(tr( "Red on Black")); |
288 | colorMenu->insertItem(tr( "Green on Yellow")); | 288 | colorMenu->insertItem(tr( "Green on Yellow")); |
289 | colorMenu->insertItem(tr( "Blue on Magenta")); | 289 | colorMenu->insertItem(tr( "Blue on Magenta")); |
290 | colorMenu->insertItem(tr( "Magenta on Blue")); | 290 | colorMenu->insertItem(tr( "Magenta on Blue")); |
291 | colorMenu->insertItem(tr( "Cyan on White")); | 291 | colorMenu->insertItem(tr( "Cyan on White")); |
292 | colorMenu->insertItem(tr( "White on Cyan")); | 292 | colorMenu->insertItem(tr( "White on Cyan")); |
293 | colorMenu->insertItem(tr( "Blue on Black")); | 293 | colorMenu->insertItem(tr( "Blue on Black")); |
294 | colorMenu->insertItem(tr( "Amber on Black")); | 294 | colorMenu->insertItem(tr( "Amber on Black")); |
295 | colorMenu->insertItem(tr( "Custom")); | 295 | colorMenu->insertItem(tr( "Custom")); |
296 | configMenu->insertItem(tr( "Colors") ,colorMenu); | 296 | configMenu->insertItem(tr( "Colors") ,colorMenu); |
297 | 297 | ||
298 | connect( fontList, SIGNAL( activated(int) ), this, SLOT( fontChanged(int) )); | 298 | connect( fontList, SIGNAL( activated(int) ), this, SLOT( fontChanged(int) )); |
299 | connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) )); | 299 | connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) )); |
300 | connect( colorMenu, SIGNAL( activated(int) ), this, SLOT( colorMenuIsSelected(int) )); | 300 | connect( colorMenu, SIGNAL( activated(int) ), this, SLOT( colorMenuIsSelected(int) )); |
301 | connect( scrollMenu, SIGNAL(activated(int)),this,SLOT(scrollMenuSelected(int))); | 301 | connect( scrollMenu, SIGNAL(activated(int)),this,SLOT(scrollMenuSelected(int))); |
302 | connect(editCommandListMenu,SIGNAL(activated(int)),this,SLOT(editCommandListMenuSelected(int))); | 302 | connect(editCommandListMenu,SIGNAL(activated(int)),this,SLOT(editCommandListMenuSelected(int))); |
303 | menuBar->insertItem( tr("Font"), fontList ); | 303 | menuBar->insertItem( tr("Font"), fontList ); |
304 | menuBar->insertItem( tr("Options"), configMenu ); | 304 | menuBar->insertItem( tr("Options"), configMenu ); |
305 | 305 | ||
306 | QPEToolBar *toolbar = new QPEToolBar( this ); | 306 | QPEToolBar *toolbar = new QPEToolBar( this ); |
307 | 307 | ||
308 | QAction *a; | 308 | QAction *a; |
309 | 309 | ||
310 | // Button Commands | 310 | // Button Commands |
311 | a = new QAction( tr("New"), Resource::loadPixmap( "konsole" ), QString::null, 0, this, 0 ); | 311 | a = new QAction( tr("New"), Resource::loadPixmap( "konsole" ), QString::null, 0, this, 0 ); |
312 | connect( a, SIGNAL( activated() ), this, SLOT( newSession() ) ); a->addTo( toolbar ); | 312 | connect( a, SIGNAL( activated() ), this, SLOT( newSession() ) ); a->addTo( toolbar ); |
313 | a = new QAction( tr("Enter"), Resource::loadPixmap( "konsole/enter" ), QString::null, 0, this, 0 ); | 313 | a = new QAction( tr("Enter"), Resource::loadPixmap( "konsole/enter" ), QString::null, 0, this, 0 ); |
314 | connect( a, SIGNAL( activated() ), this, SLOT( hitEnter() ) ); a->addTo( toolbar ); | 314 | connect( a, SIGNAL( activated() ), this, SLOT( hitEnter() ) ); a->addTo( toolbar ); |
315 | a = new QAction( tr("Space"), Resource::loadPixmap( "konsole/space" ), QString::null, 0, this, 0 ); | 315 | a = new QAction( tr("Space"), Resource::loadPixmap( "konsole/space" ), QString::null, 0, this, 0 ); |
316 | connect( a, SIGNAL( activated() ), this, SLOT( hitSpace() ) ); a->addTo( toolbar ); | 316 | connect( a, SIGNAL( activated() ), this, SLOT( hitSpace() ) ); a->addTo( toolbar ); |
317 | a = new QAction( tr("Tab"), Resource::loadPixmap( "konsole/tab" ), QString::null, 0, this, 0 ); | 317 | a = new QAction( tr("Tab"), Resource::loadPixmap( "konsole/tab" ), QString::null, 0, this, 0 ); |
318 | connect( a, SIGNAL( activated() ), this, SLOT( hitTab() ) ); a->addTo( toolbar ); | 318 | connect( a, SIGNAL( activated() ), this, SLOT( hitTab() ) ); a->addTo( toolbar ); |
319 | a = new QAction( tr("Up"), Resource::loadPixmap( "konsole/up" ), QString::null, 0, this, 0 ); | 319 | a = new QAction( tr("Up"), Resource::loadPixmap( "konsole/up" ), QString::null, 0, this, 0 ); |
320 | connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar ); | 320 | connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar ); |
321 | a = new QAction( tr("Down"), Resource::loadPixmap( "konsole/down" ), QString::null, 0, this, 0 ); | 321 | a = new QAction( tr("Down"), Resource::loadPixmap( "konsole/down" ), QString::null, 0, this, 0 ); |
322 | connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar ); | 322 | connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar ); |
323 | a = new QAction( tr("Paste"), Resource::loadPixmap( "paste" ), QString::null, 0, this, 0 ); | 323 | a = new QAction( tr("Paste"), Resource::loadPixmap( "paste" ), QString::null, 0, this, 0 ); |
324 | connect( a, SIGNAL( activated() ), this, SLOT( hitPaste() ) ); a->addTo( toolbar ); | 324 | connect( a, SIGNAL( activated() ), this, SLOT( hitPaste() ) ); a->addTo( toolbar ); |
325 | /* | 325 | /* |
326 | a = new QAction( tr("Up"), Resource::loadPixmap( "up" ), QString::null, 0, this, 0 ); | 326 | a = new QAction( tr("Up"), Resource::loadPixmap( "up" ), QString::null, 0, this, 0 ); |
327 | connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar ); | 327 | connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar ); |
328 | a = new QAction( tr("Down"), Resource::loadPixmap( "down" ), QString::null, 0, this, 0 ); | 328 | a = new QAction( tr("Down"), Resource::loadPixmap( "down" ), QString::null, 0, this, 0 ); |
329 | connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar ); | 329 | connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar ); |
330 | */ | 330 | */ |
331 | 331 | ||
332 | secondToolBar = new QPEToolBar( this ); | 332 | secondToolBar = new QPEToolBar( this ); |
333 | secondToolBar->setHorizontalStretchable( TRUE ); | 333 | secondToolBar->setHorizontalStretchable( TRUE ); |
334 | 334 | ||
335 | commonCombo = new QComboBox( secondToolBar ); | 335 | commonCombo = new QComboBox( secondToolBar ); |
336 | commonCombo->setMaximumWidth(236); | 336 | commonCombo->setMaximumWidth(236); |
337 | 337 | ||
338 | editCommandListMenu->insertItem( tr( "Quick Edit" ) ); | 338 | editCommandListMenu->insertItem( tr( "Quick Edit" ) ); |
339 | if( listHidden) { | 339 | if( listHidden) { |
340 | secondToolBar->hide(); | 340 | secondToolBar->hide(); |
341 | editCommandListMenu->setItemEnabled(-23 ,FALSE); | 341 | editCommandListMenu->setItemEnabled(-23 ,FALSE); |
342 | } | 342 | } |
343 | editCommandListMenu->insertItem(tr( "Edit" ) ); | 343 | editCommandListMenu->insertItem(tr( "Edit" ) ); |
344 | 344 | ||
345 | cfg.setGroup("Commands"); | 345 | cfg.setGroup("Commands"); |
346 | commonCombo->setInsertionPolicy(QComboBox::AtCurrent); | 346 | commonCombo->setInsertionPolicy(QComboBox::AtCurrent); |
347 | 347 | ||
348 | initCommandList(); | 348 | initCommandList(); |
349 | // for (int i = 0; commonCmds[i] != NULL; i++) { | 349 | // for (int i = 0; commonCmds[i] != NULL; i++) { |
350 | // commonCombo->insertItem( commonCmds[i], i ); | 350 | // commonCombo->insertItem( commonCmds[i], i ); |
351 | // tmp = cfg.readEntry( QString::number(i),""); | 351 | // tmp = cfg.readEntry( QString::number(i),""); |
352 | // if(tmp != "") | 352 | // if(tmp != "") |
353 | // commonCombo->changeItem( tmp,i ); | 353 | // commonCombo->changeItem( tmp,i ); |
354 | // } | 354 | // } |
355 | 355 | ||
356 | connect( commonCombo, SIGNAL( activated(int) ), this, SLOT( enterCommand(int) )); | 356 | connect( commonCombo, SIGNAL( activated(int) ), this, SLOT( enterCommand(int) )); |
357 | 357 | ||
358 | scrollMenu->insertItem(tr( "None" )); | 358 | scrollMenu->insertItem(tr( "None" )); |
359 | scrollMenu->insertItem(tr( "Left" )); | 359 | scrollMenu->insertItem(tr( "Left" )); |
360 | scrollMenu->insertItem(tr( "Right" )); | 360 | scrollMenu->insertItem(tr( "Right" )); |
361 | scrollMenu->insertSeparator(4); | 361 | // scrollMenu->insertSeparator(4); |
362 | scrollMenu->insertItem(tr( "Horizontal" )); | 362 | // scrollMenu->insertItem(tr( "Horizontal" )); |
363 | 363 | ||
364 | configMenu->insertItem(tr( "ScrollBar" ),scrollMenu); | 364 | configMenu->insertItem(tr( "ScrollBar" ),scrollMenu); |
365 | |||
366 | configMenu->insertItem(tr( "Wrap" )); | ||
367 | |||
365 | //scrollMenuSelected(-29); | 368 | //scrollMenuSelected(-29); |
366 | // cfg.setGroup("ScrollBar"); | 369 | // cfg.setGroup("ScrollBar"); |
367 | // if(cfg.readBoolEntry("HorzScroll",0)) { | 370 | // if(cfg.readBoolEntry("HorzScroll",0)) { |
368 | // if(cfg.readNumEntry("Position",2) == 0) | 371 | // if(cfg.readNumEntry("Position",2) == 0) |
369 | // te->setScrollbarLocation(1); | 372 | // te->setScrollbarLocation(1); |
370 | // else | 373 | // else |
371 | // te->setScrollbarLocation(0); | 374 | // te->setScrollbarLocation(0); |
372 | // te->setScrollbarLocation( cfg.readNumEntry("Position",2)); | 375 | // te->setScrollbarLocation( cfg.readNumEntry("Position",2)); |
373 | // te->setWrapAt(120); | 376 | // te->setWrapAt(120); |
374 | // } | 377 | // } |
375 | // create applications ///////////////////////////////////////////////////// | 378 | // create applications ///////////////////////////////////////////////////// |
376 | setCentralWidget(tab); | 379 | setCentralWidget(tab); |
377 | 380 | ||
378 | // load keymaps //////////////////////////////////////////////////////////// | 381 | // load keymaps //////////////////////////////////////////////////////////// |
379 | KeyTrans::loadAll(); | 382 | KeyTrans::loadAll(); |
380 | for (int i = 0; i < KeyTrans::count(); i++) | 383 | for (int i = 0; i < KeyTrans::count(); i++) |
381 | { KeyTrans* s = KeyTrans::find(i); | 384 | { KeyTrans* s = KeyTrans::find(i); |
382 | assert( s ); | 385 | assert( s ); |
383 | } | 386 | } |
384 | 387 | ||
385 | se_pgm = _pgm; | 388 | se_pgm = _pgm; |
386 | se_args = _args; | 389 | se_args = _args; |
387 | se_args.prepend("--login"); | 390 | se_args.prepend("--login"); |
388 | parseCommandLine(); | 391 | parseCommandLine(); |
389 | // read and apply default values /////////////////////////////////////////// | 392 | // read and apply default values /////////////////////////////////////////// |
390 | resize(321, 321); // Dummy. | 393 | resize(321, 321); // Dummy. |
391 | QSize currentSize = size(); | 394 | QSize currentSize = size(); |
392 | if (currentSize != size()) | 395 | if (currentSize != size()) |
393 | defaultSize = size(); | 396 | defaultSize = size(); |
394 | } | 397 | } |
395 | 398 | ||
396 | void Konsole::show() | 399 | void Konsole::show() |
397 | { | 400 | { |
398 | if ( !nsessions ) { | 401 | if ( !nsessions ) { |
399 | newSession(); | 402 | newSession(); |
400 | } | 403 | } |
401 | QMainWindow::show(); | 404 | QMainWindow::show(); |
405 | |||
402 | } | 406 | } |
403 | 407 | ||
404 | void Konsole::initSession(const char*, QStrList &) | 408 | void Konsole::initSession(const char*, QStrList &) |
405 | { | 409 | { |
406 | QMainWindow::show(); | 410 | QMainWindow::show(); |
407 | } | 411 | } |
408 | 412 | ||
409 | Konsole::~Konsole() | 413 | Konsole::~Konsole() |
410 | { | 414 | { |
411 | while (nsessions > 0) { | 415 | while (nsessions > 0) { |
412 | doneSession(getTe()->currentSession, 0); | 416 | doneSession(getTe()->currentSession, 0); |
413 | } | 417 | } |
414 | 418 | ||
415 | Config cfg("Konsole"); | 419 | Config cfg("Konsole"); |
416 | cfg.setGroup("Konsole"); | 420 | cfg.setGroup("Konsole"); |
417 | cfg.writeEntry("FontID", cfont); | 421 | cfg.writeEntry("FontID", cfont); |
418 | } | 422 | } |
419 | 423 | ||
420 | void Konsole::fontChanged(int f) | 424 | void Konsole::fontChanged(int f) |
421 | { | 425 | { |
422 | VTFont* font = fonts.at(f); | 426 | VTFont* font = fonts.at(f); |
423 | if (font != 0) { | 427 | if (font != 0) { |
424 | for(uint i = 0; i < fonts.count(); i++) { | 428 | for(uint i = 0; i < fonts.count(); i++) { |
425 | fontList->setItemChecked(i, (i == (uint) f) ? TRUE : FALSE); | 429 | fontList->setItemChecked(i, (i == (uint) f) ? TRUE : FALSE); |
426 | } | 430 | } |
427 | 431 | ||
428 | cfont = f; | 432 | cfont = f; |
429 | 433 | ||
430 | TEWidget* te = getTe(); | 434 | TEWidget* te = getTe(); |
431 | if (te != 0) { | 435 | if (te != 0) { |
432 | te->setVTFont(font->getFont()); | 436 | te->setVTFont(font->getFont()); |
433 | } | 437 | } |
434 | } | 438 | } |
435 | } | 439 | } |
436 | 440 | ||
437 | 441 | ||
438 | void Konsole::enterCommand(int c) | 442 | void Konsole::enterCommand(int c) |
439 | { | 443 | { |
440 | TEWidget* te = getTe(); | 444 | TEWidget* te = getTe(); |
441 | if (te != 0) { | 445 | if (te != 0) { |
442 | if(!commonCombo->editable()) { | 446 | if(!commonCombo->editable()) { |
443 | QString text = commonCombo->text(c); //commonCmds[c]; | 447 | QString text = commonCombo->text(c); //commonCmds[c]; |
444 | te->emitText(text); | 448 | te->emitText(text); |
445 | } else { | 449 | } else { |
446 | changeCommand( commonCombo->text(c), c); | 450 | changeCommand( commonCombo->text(c), c); |
447 | } | 451 | } |
448 | } | 452 | } |
449 | } | 453 | } |
450 | 454 | ||
451 | void Konsole::hitEnter() | 455 | void Konsole::hitEnter() |
452 | { | 456 | { |
453 | TEWidget* te = getTe(); | 457 | TEWidget* te = getTe(); |
454 | if (te != 0) { | 458 | if (te != 0) { |
455 | te->emitText(QString("\r")); | 459 | te->emitText(QString("\r")); |
456 | } | 460 | } |
457 | } | 461 | } |
458 | 462 | ||
459 | void Konsole::hitSpace() | 463 | void Konsole::hitSpace() |
460 | { | 464 | { |
461 | TEWidget* te = getTe(); | 465 | TEWidget* te = getTe(); |
462 | if (te != 0) { | 466 | if (te != 0) { |
463 | te->emitText(QString(" ")); | 467 | te->emitText(QString(" ")); |
464 | } | 468 | } |
465 | } | 469 | } |
466 | 470 | ||
467 | void Konsole::hitTab() | 471 | void Konsole::hitTab() |
468 | { | 472 | { |
469 | TEWidget* te = getTe(); | 473 | TEWidget* te = getTe(); |
470 | if (te != 0) { | 474 | if (te != 0) { |
471 | te->emitText(QString("\t")); | 475 | te->emitText(QString("\t")); |
472 | } | 476 | } |
473 | } | 477 | } |
474 | 478 | ||
475 | void Konsole::hitPaste() | 479 | void Konsole::hitPaste() |
476 | { | 480 | { |
477 | TEWidget* te = getTe(); | 481 | TEWidget* te = getTe(); |
478 | if (te != 0) { | 482 | if (te != 0) { |
479 | te->pasteClipboard(); | 483 | te->pasteClipboard(); |
480 | } | 484 | } |
481 | } | 485 | } |
482 | 486 | ||
483 | void Konsole::hitUp() | 487 | void Konsole::hitUp() |
484 | { | 488 | { |
485 | TEWidget* te = getTe(); | 489 | TEWidget* te = getTe(); |
486 | if (te != 0) { | 490 | if (te != 0) { |
487 | QKeyEvent ke( QKeyEvent::KeyPress, Qt::Key_Up, 0, 0); | 491 | QKeyEvent ke( QKeyEvent::KeyPress, Qt::Key_Up, 0, 0); |
488 | QApplication::sendEvent( te, &ke ); | 492 | QApplication::sendEvent( te, &ke ); |
489 | } | 493 | } |
490 | } | 494 | } |
491 | 495 | ||
492 | void Konsole::hitDown() | 496 | void Konsole::hitDown() |
493 | { | 497 | { |
494 | TEWidget* te = getTe(); | 498 | TEWidget* te = getTe(); |
495 | if (te != 0) { | 499 | if (te != 0) { |
496 | QKeyEvent ke( QKeyEvent::KeyPress, Qt::Key_Down, 0, 0); | 500 | QKeyEvent ke( QKeyEvent::KeyPress, Qt::Key_Down, 0, 0); |
497 | QApplication::sendEvent( te, &ke ); | 501 | QApplication::sendEvent( te, &ke ); |
@@ -505,469 +509,499 @@ void Konsole::hitDown() | |||
505 | QSize Konsole::calcSize(int columns, int lines) { | 509 | QSize Konsole::calcSize(int columns, int lines) { |
506 | TEWidget* te = getTe(); | 510 | TEWidget* te = getTe(); |
507 | if (te != 0) { | 511 | if (te != 0) { |
508 | QSize size = te->calcSize(columns, lines); | 512 | QSize size = te->calcSize(columns, lines); |
509 | return size; | 513 | return size; |
510 | } else { | 514 | } else { |
511 | QSize size; | 515 | QSize size; |
512 | return size; | 516 | return size; |
513 | } | 517 | } |
514 | } | 518 | } |
515 | 519 | ||
516 | /** | 520 | /** |
517 | sets application window to a size based on columns X lines of the te | 521 | sets application window to a size based on columns X lines of the te |
518 | guest widget. Call with (0,0) for setting default size. | 522 | guest widget. Call with (0,0) for setting default size. |
519 | */ | 523 | */ |
520 | 524 | ||
521 | void Konsole::setColLin(int columns, int lines) | 525 | void Konsole::setColLin(int columns, int lines) |
522 | { | 526 | { |
523 | qDebug("konsole::setColLin:: Columns %d", columns); | 527 | qDebug("konsole::setColLin:: Columns %d", columns); |
524 | 528 | ||
525 | if ((columns==0) || (lines==0)) | 529 | if ((columns==0) || (lines==0)) |
526 | { | 530 | { |
527 | if (defaultSize.isEmpty()) // not in config file : set default value | 531 | if (defaultSize.isEmpty()) // not in config file : set default value |
528 | { | 532 | { |
529 | defaultSize = calcSize(80,24); | 533 | defaultSize = calcSize(80,24); |
530 | // notifySize(24,80); // set menu items (strange arg order !) | 534 | // notifySize(24,80); // set menu items (strange arg order !) |
531 | } | 535 | } |
532 | resize(defaultSize); | 536 | resize(defaultSize); |
533 | } else { | 537 | } else { |
534 | resize(calcSize(columns, lines)); | 538 | resize(calcSize(columns, lines)); |
535 | // notifySize(lines,columns); // set menu items (strange arg order !) | 539 | // notifySize(lines,columns); // set menu items (strange arg order !) |
536 | } | 540 | } |
537 | } | 541 | } |
538 | 542 | ||
539 | /* | 543 | /* |
540 | void Konsole::setFont(int fontno) | 544 | void Konsole::setFont(int fontno) |
541 | { | 545 | { |
542 | QFont f; | 546 | QFont f; |
543 | if (fontno == 0) | 547 | if (fontno == 0) |
544 | f = defaultFont = QFont( "Helvetica", 12 ); | 548 | f = defaultFont = QFont( "Helvetica", 12 ); |
545 | else | 549 | else |
546 | if (fonts[fontno][0] == '-') | 550 | if (fonts[fontno][0] == '-') |
547 | f.setRawName( fonts[fontno] ); | 551 | f.setRawName( fonts[fontno] ); |
548 | else | 552 | else |
549 | { | 553 | { |
550 | f.setFamily(fonts[fontno]); | 554 | f.setFamily(fonts[fontno]); |
551 | f.setRawMode( TRUE ); | 555 | f.setRawMode( TRUE ); |
552 | } | 556 | } |
553 | if ( !f.exactMatch() && fontno != 0) | 557 | if ( !f.exactMatch() && fontno != 0) |
554 | { | 558 | { |
555 | QString msg = i18n("Font `%1' not found.\nCheck README.linux.console for help.").arg(fonts[fontno]); | 559 | QString msg = i18n("Font `%1' not found.\nCheck README.linux.console for help.").arg(fonts[fontno]); |
556 | QMessageBox(this, msg); | 560 | QMessageBox(this, msg); |
557 | return; | 561 | return; |
558 | } | 562 | } |
559 | if (se) se->setFontNo(fontno); | 563 | if (se) se->setFontNo(fontno); |
560 | te->setVTFont(f); | 564 | te->setVTFont(f); |
561 | n_font = fontno; | 565 | n_font = fontno; |
562 | } | 566 | } |
563 | */ | 567 | */ |
564 | 568 | ||
565 | // --| color selection |------------------------------------------------------- | 569 | // --| color selection |------------------------------------------------------- |
566 | 570 | ||
567 | void Konsole::changeColumns(int columns) | 571 | void Konsole::changeColumns(int columns) |
568 | { | 572 | { |
569 | qDebug("change columns"); | 573 | qDebug("change columns"); |
570 | TEWidget* te = getTe(); | 574 | TEWidget* te = getTe(); |
571 | if (te != 0) { | 575 | if (te != 0) { |
572 | setColLin(columns,te->Lines()); | 576 | setColLin(columns,te->Lines()); |
573 | te->update(); | 577 | te->update(); |
574 | } | 578 | } |
575 | } | 579 | } |
576 | 580 | ||
577 | //FIXME: If a child dies during session swap, | 581 | //FIXME: If a child dies during session swap, |
578 | // this routine might be called before | 582 | // this routine might be called before |
579 | // session swap is completed. | 583 | // session swap is completed. |
580 | 584 | ||
581 | void Konsole::doneSession(TESession*, int ) | 585 | void Konsole::doneSession(TESession*, int ) |
582 | { | 586 | { |
583 | TEWidget *te = getTe(); | 587 | TEWidget *te = getTe(); |
584 | if (te != 0) { | 588 | if (te != 0) { |
585 | te->currentSession->setConnect(FALSE); | 589 | te->currentSession->setConnect(FALSE); |
586 | tab->removeTab(te); | 590 | tab->removeTab(te); |
587 | delete te->currentSession; | 591 | delete te->currentSession; |
588 | delete te; | 592 | delete te; |
589 | nsessions--; | 593 | nsessions--; |
590 | } | 594 | } |
591 | 595 | ||
592 | if (nsessions == 0) { | 596 | if (nsessions == 0) { |
593 | close(); | 597 | close(); |
594 | } | 598 | } |
595 | } | 599 | } |
596 | 600 | ||
597 | void Konsole::newSession() { | 601 | void Konsole::newSession() { |
598 | if(nsessions < 15) { // seems to be something weird about 16 tabs on the Zaurus.... memory? | 602 | if(nsessions < 15) { // seems to be something weird about 16 tabs on the Zaurus.... memory? |
599 | TEWidget* te = new TEWidget(tab); | 603 | TEWidget* te = new TEWidget(tab); |
600 | // te->setBackgroundMode(PaletteBase); //we want transparent!! | 604 | // te->setBackgroundMode(PaletteBase); //we want transparent!! |
601 | te->setVTFont(fonts.at(cfont)->getFont()); | 605 | te->setVTFont(fonts.at(cfont)->getFont()); |
602 | tab->addTab(te); | 606 | tab->addTab(te); |
603 | TESession* se = new TESession(this, te, se_pgm, se_args, "xterm"); | 607 | TESession* se = new TESession(this, te, se_pgm, se_args, "xterm"); |
604 | te->currentSession = se; | 608 | te->currentSession = se; |
605 | connect( se, SIGNAL(done(TESession*,int)), this, SLOT(doneSession(TESession*,int)) ); | 609 | connect( se, SIGNAL(done(TESession*,int)), this, SLOT(doneSession(TESession*,int)) ); |
606 | se->run(); | 610 | se->run(); |
607 | se->setConnect(TRUE); | 611 | se->setConnect(TRUE); |
608 | se->setHistory(b_scroll); | 612 | se->setHistory(b_scroll); |
609 | tab->setCurrentPage(nsessions); | 613 | tab->setCurrentPage(nsessions); |
610 | nsessions++; | 614 | nsessions++; |
611 | setColor(); | 615 | doWrap(); |
616 | setColor(); | ||
612 | } | 617 | } |
613 | } | 618 | } |
614 | 619 | ||
615 | TEWidget* Konsole::getTe() { | 620 | TEWidget* Konsole::getTe() { |
616 | if (nsessions) { | 621 | if (nsessions) { |
617 | return (TEWidget *) tab->currentPage(); | 622 | return (TEWidget *) tab->currentPage(); |
618 | } else { | 623 | } else { |
619 | return 0; | 624 | return 0; |
620 | } | 625 | } |
621 | } | 626 | } |
622 | 627 | ||
623 | void Konsole::switchSession(QWidget* w) { | 628 | void Konsole::switchSession(QWidget* w) { |
624 | TEWidget* te = (TEWidget *) w; | 629 | TEWidget* te = (TEWidget *) w; |
625 | 630 | ||
626 | QFont teFnt = te->getVTFont(); | 631 | QFont teFnt = te->getVTFont(); |
627 | for(uint i = 0; i < fonts.count(); i++) { | 632 | for(uint i = 0; i < fonts.count(); i++) { |
628 | VTFont *fnt = fonts.at(i); | 633 | VTFont *fnt = fonts.at(i); |
629 | bool cf = fnt->getFont() == teFnt; | 634 | bool cf = fnt->getFont() == teFnt; |
630 | fontList->setItemChecked(i, cf); | 635 | fontList->setItemChecked(i, cf); |
631 | if (cf) { | 636 | if (cf) { |
632 | cfont = i; | 637 | cfont = i; |
633 | } | 638 | } |
634 | } | 639 | } |
635 | } | 640 | } |
636 | 641 | ||
637 | void Konsole::colorMenuIsSelected(int iD) { | 642 | void Konsole::colorMenuIsSelected(int iD) { |
638 | fromMenu = TRUE; | 643 | fromMenu = TRUE; |
639 | colorMenuSelected(iD); | 644 | colorMenuSelected(iD); |
640 | } | 645 | } |
641 | 646 | ||
642 | /// ------------------------------- some new stuff by L.J. Potter | 647 | /// ------------------------------- some new stuff by L.J. Potter |
643 | void Konsole::colorMenuSelected(int iD) | 648 | void Konsole::colorMenuSelected(int iD) |
644 | { // this is NOT pretty, elegant or anything else besides functional | 649 | { // this is NOT pretty, elegant or anything else besides functional |
645 | // QString temp; | 650 | // QString temp; |
646 | // qDebug( temp.sprintf("colormenu %d", iD)); | 651 | // qDebug( temp.sprintf("colormenu %d", iD)); |
647 | TEWidget* te = getTe(); | 652 | TEWidget* te = getTe(); |
648 | Config cfg("Konsole"); | 653 | Config cfg("Konsole"); |
649 | cfg.setGroup("Colors"); | 654 | cfg.setGroup("Colors"); |
650 | // QColor foreground; | 655 | // QColor foreground; |
651 | // QColor background; | 656 | // QColor background; |
652 | colorMenu->setItemChecked(lastSelectedMenu,FALSE); | 657 | colorMenu->setItemChecked(lastSelectedMenu,FALSE); |
653 | ColorEntry m_table[TABLE_COLORS]; | 658 | ColorEntry m_table[TABLE_COLORS]; |
654 | const ColorEntry * defaultCt=te->getdefaultColorTable(); | 659 | const ColorEntry * defaultCt=te->getdefaultColorTable(); |
655 | /////////// fore back | 660 | /////////// fore back |
656 | int i; | 661 | int i; |
657 | if(iD==-9) { // default default | 662 | if(iD==-9) { // default default |
658 | for (i = 0; i < TABLE_COLORS; i++) { | 663 | for (i = 0; i < TABLE_COLORS; i++) { |
659 | m_table[i].color = defaultCt[i].color; | 664 | m_table[i].color = defaultCt[i].color; |
660 | if(i==1 || i == 11) | 665 | if(i==1 || i == 11) |
661 | m_table[i].transparent=1; | 666 | m_table[i].transparent=1; |
662 | cfg.writeEntry("Schema","9"); | 667 | cfg.writeEntry("Schema","9"); |
663 | colorMenu->setItemChecked(-9,TRUE); | 668 | colorMenu->setItemChecked(-9,TRUE); |
664 | } | 669 | } |
665 | } else { | 670 | } else { |
666 | if(iD==-6) { // green black | 671 | if(iD==-6) { // green black |
667 | foreground.setRgb(0x18,255,0x18); | 672 | foreground.setRgb(0x18,255,0x18); |
668 | background.setRgb(0x00,0x00,0x00); | 673 | background.setRgb(0x00,0x00,0x00); |
669 | cfg.writeEntry("Schema","6"); | 674 | cfg.writeEntry("Schema","6"); |
670 | colorMenu->setItemChecked(-6,TRUE); | 675 | colorMenu->setItemChecked(-6,TRUE); |
671 | } | 676 | } |
672 | if(iD==-7) { // black white | 677 | if(iD==-7) { // black white |
673 | foreground.setRgb(0x00,0x00,0x00); | 678 | foreground.setRgb(0x00,0x00,0x00); |
674 | background.setRgb(0xFF,0xFF,0xFF); | 679 | background.setRgb(0xFF,0xFF,0xFF); |
675 | cfg.writeEntry("Schema","7"); | 680 | cfg.writeEntry("Schema","7"); |
676 | colorMenu->setItemChecked(-7,TRUE); | 681 | colorMenu->setItemChecked(-7,TRUE); |
677 | } | 682 | } |
678 | if(iD==-8) { // white black | 683 | if(iD==-8) { // white black |
679 | foreground.setRgb(0xFF,0xFF,0xFF); | 684 | foreground.setRgb(0xFF,0xFF,0xFF); |
680 | background.setRgb(0x00,0x00,0x00); | 685 | background.setRgb(0x00,0x00,0x00); |
681 | cfg.writeEntry("Schema","8"); | 686 | cfg.writeEntry("Schema","8"); |
682 | colorMenu->setItemChecked(-8,TRUE); | 687 | colorMenu->setItemChecked(-8,TRUE); |
683 | } | 688 | } |
684 | if(iD==-10) {// Black, Red | 689 | if(iD==-10) {// Black, Red |
685 | foreground.setRgb(0x00,0x00,0x00); | 690 | foreground.setRgb(0x00,0x00,0x00); |
686 | background.setRgb(0xB2,0x18,0x18); | 691 | background.setRgb(0xB2,0x18,0x18); |
687 | cfg.writeEntry("Schema","10"); | 692 | cfg.writeEntry("Schema","10"); |
688 | colorMenu->setItemChecked(-10,TRUE); | 693 | colorMenu->setItemChecked(-10,TRUE); |
689 | } | 694 | } |
690 | if(iD==-11) {// Red, Black | 695 | if(iD==-11) {// Red, Black |
691 | foreground.setRgb(230,31,31); //0xB2,0x18,0x18 | 696 | foreground.setRgb(230,31,31); //0xB2,0x18,0x18 |
692 | background.setRgb(0x00,0x00,0x00); | 697 | background.setRgb(0x00,0x00,0x00); |
693 | cfg.writeEntry("Schema","11"); | 698 | cfg.writeEntry("Schema","11"); |
694 | colorMenu->setItemChecked(-11,TRUE); | 699 | colorMenu->setItemChecked(-11,TRUE); |
695 | } | 700 | } |
696 | if(iD==-12) {// Green, Yellow - is ugly | 701 | if(iD==-12) {// Green, Yellow - is ugly |
697 | // foreground.setRgb(0x18,0xB2,0x18); | 702 | // foreground.setRgb(0x18,0xB2,0x18); |
698 | foreground.setRgb(36,139,10); | 703 | foreground.setRgb(36,139,10); |
699 | // background.setRgb(0xB2,0x68,0x18); | 704 | // background.setRgb(0xB2,0x68,0x18); |
700 | background.setRgb(255,255,0); | 705 | background.setRgb(255,255,0); |
701 | cfg.writeEntry("Schema","12"); | 706 | cfg.writeEntry("Schema","12"); |
702 | colorMenu->setItemChecked(-12,TRUE); | 707 | colorMenu->setItemChecked(-12,TRUE); |
703 | } | 708 | } |
704 | if(iD==-13) {// Blue, Magenta | 709 | if(iD==-13) {// Blue, Magenta |
705 | foreground.setRgb(0x18,0xB2,0xB2); | 710 | foreground.setRgb(0x18,0xB2,0xB2); |
706 | background.setRgb(0x18,0x18,0xB2); | 711 | background.setRgb(0x18,0x18,0xB2); |
707 | cfg.writeEntry("Schema","13"); | 712 | cfg.writeEntry("Schema","13"); |
708 | colorMenu->setItemChecked(-13,TRUE); | 713 | colorMenu->setItemChecked(-13,TRUE); |
709 | } | 714 | } |
710 | if(iD==-14) {// Magenta, Blue | 715 | if(iD==-14) {// Magenta, Blue |
711 | foreground.setRgb(0x18,0x18,0xB2); | 716 | foreground.setRgb(0x18,0x18,0xB2); |
712 | background.setRgb(0x18,0xB2,0xB2); | 717 | background.setRgb(0x18,0xB2,0xB2); |
713 | cfg.writeEntry("Schema","14"); | 718 | cfg.writeEntry("Schema","14"); |
714 | colorMenu->setItemChecked(-14,TRUE); | 719 | colorMenu->setItemChecked(-14,TRUE); |
715 | } | 720 | } |
716 | if(iD==-15) {// Cyan, White | 721 | if(iD==-15) {// Cyan, White |
717 | foreground.setRgb(0x18,0xB2,0xB2); | 722 | foreground.setRgb(0x18,0xB2,0xB2); |
718 | background.setRgb(0xFF,0xFF,0xFF); | 723 | background.setRgb(0xFF,0xFF,0xFF); |
719 | cfg.writeEntry("Schema","15"); | 724 | cfg.writeEntry("Schema","15"); |
720 | colorMenu->setItemChecked(-15,TRUE); | 725 | colorMenu->setItemChecked(-15,TRUE); |
721 | } | 726 | } |
722 | if(iD==-16) {// White, Cyan | 727 | if(iD==-16) {// White, Cyan |
723 | background.setRgb(0x18,0xB2,0xB2); | 728 | background.setRgb(0x18,0xB2,0xB2); |
724 | foreground.setRgb(0xFF,0xFF,0xFF); | 729 | foreground.setRgb(0xFF,0xFF,0xFF); |
725 | cfg.writeEntry("Schema","16"); | 730 | cfg.writeEntry("Schema","16"); |
726 | colorMenu->setItemChecked(-16,TRUE); | 731 | colorMenu->setItemChecked(-16,TRUE); |
727 | } | 732 | } |
728 | if(iD==-17) {// Black, Blue | 733 | if(iD==-17) {// Black, Blue |
729 | background.setRgb(0x00,0x00,0x00); | 734 | background.setRgb(0x00,0x00,0x00); |
730 | foreground.setRgb(0x18,0xB2,0xB2); | 735 | foreground.setRgb(0x18,0xB2,0xB2); |
731 | cfg.writeEntry("Schema","17"); | 736 | cfg.writeEntry("Schema","17"); |
732 | colorMenu->setItemChecked(-17,TRUE); | 737 | colorMenu->setItemChecked(-17,TRUE); |
733 | } | 738 | } |
734 | if(iD==-18) {// Black, Gold | 739 | if(iD==-18) {// Black, Gold |
735 | background.setRgb(0x00,0x00,0x00); | 740 | background.setRgb(0x00,0x00,0x00); |
736 | foreground.setRgb(255,215,0); | 741 | foreground.setRgb(255,215,0); |
737 | cfg.writeEntry("Schema","18"); | 742 | cfg.writeEntry("Schema","18"); |
738 | colorMenu->setItemChecked(-18,TRUE); | 743 | colorMenu->setItemChecked(-18,TRUE); |
739 | } | 744 | } |
740 | if(iD==-19) {// Custom | 745 | if(iD==-19) {// Custom |
741 | qDebug("do custom"); | 746 | qDebug("do custom"); |
742 | if(fromMenu) { | 747 | if(fromMenu) { |
743 | ColorPopupMenu* penColorPopupMenu = new ColorPopupMenu(Qt::black, this, "foreground color"); | 748 | ColorPopupMenu* penColorPopupMenu = new ColorPopupMenu(Qt::black, this, "foreground color"); |
744 | connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, | 749 | connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, |
745 | SLOT(changeForegroundColor(const QColor&))); | 750 | SLOT(changeForegroundColor(const QColor&))); |
746 | penColorPopupMenu->exec(); | 751 | penColorPopupMenu->exec(); |
747 | } | 752 | } |
748 | cfg.writeEntry("Schema","19"); | 753 | cfg.writeEntry("Schema","19"); |
749 | if(!fromMenu) { | 754 | if(!fromMenu) { |
750 | foreground.setNamedColor(cfg.readEntry("foreground","")); | 755 | foreground.setNamedColor(cfg.readEntry("foreground","")); |
751 | background.setNamedColor(cfg.readEntry("background","")); | 756 | background.setNamedColor(cfg.readEntry("background","")); |
752 | } | 757 | } |
753 | fromMenu=FALSE; | 758 | fromMenu=FALSE; |
754 | colorMenu->setItemChecked(-19,TRUE); | 759 | colorMenu->setItemChecked(-19,TRUE); |
755 | } | 760 | } |
756 | 761 | ||
757 | for (i = 0; i < TABLE_COLORS; i++) { | 762 | for (i = 0; i < TABLE_COLORS; i++) { |
758 | if(i==0 || i == 10) { | 763 | if(i==0 || i == 10) { |
759 | m_table[i].color = foreground; | 764 | m_table[i].color = foreground; |
760 | } | 765 | } |
761 | else if(i==1 || i == 11) { | 766 | else if(i==1 || i == 11) { |
762 | m_table[i].color = background; m_table[i].transparent=0; | 767 | m_table[i].color = background; m_table[i].transparent=0; |
763 | } | 768 | } |
764 | else | 769 | else |
765 | m_table[i].color = defaultCt[i].color; | 770 | m_table[i].color = defaultCt[i].color; |
766 | } | 771 | } |
767 | } | 772 | } |
768 | lastSelectedMenu = iD; | 773 | lastSelectedMenu = iD; |
769 | te->setColorTable(m_table); | 774 | te->setColorTable(m_table); |
770 | update(); | 775 | update(); |
771 | 776 | ||
772 | } | 777 | } |
773 | 778 | ||
774 | void Konsole::configMenuSelected(int iD) | 779 | void Konsole::configMenuSelected(int iD) |
775 | { | 780 | { |
776 | // QString temp; | 781 | QString temp; |
777 | // qDebug( temp.sprintf("configmenu %d",iD)); | 782 | qDebug( temp.sprintf("configmenu %d",iD)); |
778 | TEWidget* te = getTe(); | 783 | TEWidget* te = getTe(); |
779 | Config cfg("Konsole"); | 784 | Config cfg("Konsole"); |
780 | cfg.setGroup("Menubar"); | 785 | cfg.setGroup("Menubar"); |
781 | if( iD == -4) { | 786 | if( iD == -4) { |
782 | cfg.setGroup("Tabs"); | 787 | cfg.setGroup("Tabs"); |
783 | QString tmp=cfg.readEntry("Position","Bottom"); | 788 | QString tmp=cfg.readEntry("Position","Bottom"); |
784 | 789 | ||
785 | if(tmp=="Top") { | 790 | if(tmp=="Top") { |
786 | tab->setTabPosition(QTabWidget::Bottom); | 791 | tab->setTabPosition(QTabWidget::Bottom); |
787 | configMenu->changeItem( iD,"Tabs on Top"); | 792 | configMenu->changeItem( iD,"Tabs on Top"); |
788 | cfg.writeEntry("Position","Bottom"); | 793 | cfg.writeEntry("Position","Bottom"); |
789 | } else { | 794 | } else { |
790 | tab->setTabPosition(QTabWidget::Top); | 795 | tab->setTabPosition(QTabWidget::Top); |
791 | configMenu->changeItem( iD,"Tabs on Bottom"); | 796 | configMenu->changeItem( iD,"Tabs on Bottom"); |
792 | cfg.writeEntry("Position","Top"); | 797 | cfg.writeEntry("Position","Top"); |
793 | } | 798 | } |
794 | } | 799 | } |
800 | if( iD == -29) { | ||
801 | cfg.setGroup("ScrollBar"); | ||
802 | bool b=cfg.readBoolEntry("HorzScroll",0); | ||
803 | b=!b; | ||
804 | cfg.writeEntry("HorzScroll", b ); | ||
805 | cfg.write(); | ||
806 | doWrap(); | ||
807 | if(cfg.readNumEntry("Position",2) == 0) { | ||
808 | te->setScrollbarLocation(1); | ||
809 | } else { | ||
810 | te->setScrollbarLocation(0); | ||
811 | } | ||
812 | te->setScrollbarLocation( cfg.readNumEntry("Position",2)); | ||
813 | } | ||
795 | } | 814 | } |
796 | 815 | ||
797 | void Konsole::changeCommand(const QString &text, int c) | 816 | void Konsole::changeCommand(const QString &text, int c) |
798 | { | 817 | { |
799 | Config cfg("Konsole"); | 818 | Config cfg("Konsole"); |
800 | cfg.setGroup("Commands"); | 819 | cfg.setGroup("Commands"); |
801 | if(commonCmds[c] != text) { | 820 | if(commonCmds[c] != text) { |
802 | cfg.writeEntry(QString::number(c),text); | 821 | cfg.writeEntry(QString::number(c),text); |
803 | commonCombo->clearEdit(); | 822 | commonCombo->clearEdit(); |
804 | commonCombo->setCurrentItem(c); | 823 | commonCombo->setCurrentItem(c); |
805 | } | 824 | } |
806 | } | 825 | } |
807 | 826 | ||
808 | void Konsole::setColor() | 827 | void Konsole::setColor() |
809 | { | 828 | { |
810 | Config cfg("Konsole"); | 829 | Config cfg("Konsole"); |
811 | cfg.setGroup("Colors"); | 830 | cfg.setGroup("Colors"); |
812 | int scheme = cfg.readNumEntry("Schema",1); | 831 | int scheme = cfg.readNumEntry("Schema",1); |
813 | if(scheme != 1) colorMenuSelected( -scheme); | 832 | if(scheme != 1) colorMenuSelected( -scheme); |
814 | } | 833 | } |
815 | 834 | ||
816 | void Konsole::scrollMenuSelected(int index) | 835 | void Konsole::scrollMenuSelected(int index) |
817 | { | 836 | { |
818 | qDebug( "scrollbar menu %d",index); | 837 | qDebug( "scrollbar menu %d",index); |
819 | TEWidget* te = getTe(); | 838 | TEWidget* te = getTe(); |
820 | Config cfg("Konsole"); | 839 | Config cfg("Konsole"); |
821 | cfg.setGroup("ScrollBar"); | 840 | cfg.setGroup("ScrollBar"); |
822 | switch( index){ | 841 | switch( index){ |
823 | case -25: | 842 | case -25: |
824 | te->setScrollbarLocation(0); | 843 | te->setScrollbarLocation(0); |
825 | cfg.writeEntry("Position",0); | 844 | cfg.writeEntry("Position",0); |
826 | break; | 845 | break; |
827 | case -26: | 846 | case -26: |
828 | te->setScrollbarLocation(1); | 847 | te->setScrollbarLocation(1); |
829 | cfg.writeEntry("Position",1); | 848 | cfg.writeEntry("Position",1); |
830 | break; | 849 | break; |
831 | case -27: | 850 | case -27: |
832 | te->setScrollbarLocation(2); | 851 | te->setScrollbarLocation(2); |
833 | cfg.writeEntry("Position",2); | 852 | cfg.writeEntry("Position",2); |
834 | break; | 853 | break; |
835 | case -29: { | 854 | // case -29: { |
836 | bool b=cfg.readBoolEntry("HorzScroll",0); | 855 | // bool b=cfg.readBoolEntry("HorzScroll",0); |
837 | cfg.writeEntry("HorzScroll", !b ); | 856 | // cfg.writeEntry("HorzScroll", !b ); |
838 | cfg.write(); | 857 | // cfg.write(); |
839 | if(cfg.readNumEntry("Position",2) == 0) | 858 | // if(cfg.readNumEntry("Position",2) == 0) { |
840 | te->setScrollbarLocation(1); | 859 | // te->setScrollbarLocation(1); |
841 | else | 860 | // te->setWrapAt(0); |
842 | te->setScrollbarLocation(0); | 861 | // } else { |
843 | te->setScrollbarLocation( cfg.readNumEntry("Position",2)); | 862 | // te->setScrollbarLocation(0); |
844 | te->setWrapAt(120); | 863 | // te->setWrapAt(120); |
845 | } | 864 | // } |
846 | break; | 865 | // te->setScrollbarLocation( cfg.readNumEntry("Position",2)); |
866 | // } | ||
867 | // break; | ||
847 | }; | 868 | }; |
848 | |||
849 | } | 869 | } |
850 | 870 | ||
851 | void Konsole::editCommandListMenuSelected(int iD) | 871 | void Konsole::editCommandListMenuSelected(int iD) |
852 | { | 872 | { |
853 | // QString temp; | 873 | // QString temp; |
854 | // qDebug( temp.sprintf("edit command list %d",iD)); | 874 | // qDebug( temp.sprintf("edit command list %d",iD)); |
855 | TEWidget* te = getTe(); | 875 | TEWidget* te = getTe(); |
856 | Config cfg("Konsole"); | 876 | Config cfg("Konsole"); |
857 | cfg.setGroup("Menubar"); | 877 | cfg.setGroup("Menubar"); |
858 | if( iD == -3) { | 878 | if( iD == -3) { |
859 | if(!secondToolBar->isHidden()) { | 879 | if(!secondToolBar->isHidden()) { |
860 | secondToolBar->hide(); | 880 | secondToolBar->hide(); |
861 | configMenu->changeItem( iD,tr( "Show Command List" )); | 881 | configMenu->changeItem( iD,tr( "Show Command List" )); |
862 | cfg.writeEntry("Hidden","TRUE"); | 882 | cfg.writeEntry("Hidden","TRUE"); |
863 | configMenu->setItemEnabled(-23 ,FALSE); | 883 | configMenu->setItemEnabled(-23 ,FALSE); |
864 | } else { | 884 | } else { |
865 | secondToolBar->show(); | 885 | secondToolBar->show(); |
866 | configMenu->changeItem( iD,tr( "Hide Command List" )); | 886 | configMenu->changeItem( iD,tr( "Hide Command List" )); |
867 | cfg.writeEntry("Hidden","FALSE"); | 887 | cfg.writeEntry("Hidden","FALSE"); |
868 | configMenu->setItemEnabled(-23 ,TRUE); | 888 | configMenu->setItemEnabled(-23 ,TRUE); |
869 | 889 | ||
870 | if(cfg.readEntry("EditEnabled","FALSE")=="TRUE") { | 890 | if(cfg.readEntry("EditEnabled","FALSE")=="TRUE") { |
871 | configMenu->setItemChecked(-23,TRUE); | 891 | configMenu->setItemChecked(-23,TRUE); |
872 | commonCombo->setEditable( TRUE ); | 892 | commonCombo->setEditable( TRUE ); |
873 | } else { | 893 | } else { |
874 | configMenu->setItemChecked(-23,FALSE); | 894 | configMenu->setItemChecked(-23,FALSE); |
875 | commonCombo->setEditable( FALSE ); | 895 | commonCombo->setEditable( FALSE ); |
876 | } | 896 | } |
877 | } | 897 | } |
878 | } | 898 | } |
879 | if( iD == -23) { | 899 | if( iD == -23) { |
880 | cfg.setGroup("Commands"); | 900 | cfg.setGroup("Commands"); |
881 | // qDebug("enableCommandEdit"); | 901 | // qDebug("enableCommandEdit"); |
882 | if( !configMenu->isItemChecked(iD) ) { | 902 | if( !configMenu->isItemChecked(iD) ) { |
883 | commonCombo->setEditable( TRUE ); | 903 | commonCombo->setEditable( TRUE ); |
884 | configMenu->setItemChecked(iD,TRUE); | 904 | configMenu->setItemChecked(iD,TRUE); |
885 | commonCombo->setCurrentItem(0); | 905 | commonCombo->setCurrentItem(0); |
886 | cfg.writeEntry("EditEnabled","TRUE"); | 906 | cfg.writeEntry("EditEnabled","TRUE"); |
887 | } else { | 907 | } else { |
888 | commonCombo->setEditable( FALSE ); | 908 | commonCombo->setEditable( FALSE ); |
889 | configMenu->setItemChecked(iD,FALSE); | 909 | configMenu->setItemChecked(iD,FALSE); |
890 | cfg.writeEntry("EditEnabled","FALSE"); | 910 | cfg.writeEntry("EditEnabled","FALSE"); |
891 | commonCombo->setFocusPolicy(QWidget::NoFocus); | 911 | commonCombo->setFocusPolicy(QWidget::NoFocus); |
892 | te->setFocus(); | 912 | te->setFocus(); |
893 | } | 913 | } |
894 | } | 914 | } |
895 | if(iD == -24) { | 915 | if(iD == -24) { |
896 | // "edit commands" | 916 | // "edit commands" |
897 | CommandEditDialog *m = new CommandEditDialog(this); | 917 | CommandEditDialog *m = new CommandEditDialog(this); |
898 | connect(m,SIGNAL(commandsEdited()),this,SLOT(initCommandList())); | 918 | connect(m,SIGNAL(commandsEdited()),this,SLOT(initCommandList())); |
899 | m->showMaximized(); | 919 | m->showMaximized(); |
900 | } | 920 | } |
901 | 921 | ||
902 | } | 922 | } |
903 | 923 | ||
904 | // $QPEDIR/bin/qcop QPE/Application/embeddedkonsole 'setDocument(QString)' 'ssh -V' | 924 | // $QPEDIR/bin/qcop QPE/Application/embeddedkonsole 'setDocument(QString)' 'ssh -V' |
905 | void Konsole::setDocument( const QString &cmd) { | 925 | void Konsole::setDocument( const QString &cmd) { |
906 | newSession(); | 926 | newSession(); |
907 | TEWidget* te = getTe(); | 927 | TEWidget* te = getTe(); |
908 | if(cmd.find("-e", 0, TRUE) != -1) { | 928 | if(cmd.find("-e", 0, TRUE) != -1) { |
909 | QString cmd2; | 929 | QString cmd2; |
910 | cmd2=cmd.right(cmd.length()-3)+" &"; | 930 | cmd2=cmd.right(cmd.length()-3)+" &"; |
911 | system(cmd2.latin1()); | 931 | system(cmd2.latin1()); |
912 | if(startUp <= 1 && nsessions < 2) { | 932 | if(startUp <= 1 && nsessions < 2) { |
913 | doneSession(getTe()->currentSession, 0); | 933 | doneSession(getTe()->currentSession, 0); |
914 | exit(0); | 934 | exit(0); |
915 | } else | 935 | } else |
916 | doneSession(getTe()->currentSession, 0); | 936 | doneSession(getTe()->currentSession, 0); |
917 | } else { | 937 | } else { |
918 | if (te != 0) { | 938 | if (te != 0) { |
919 | te->emitText(cmd+"\r"); | 939 | te->emitText(cmd+"\r"); |
920 | } | 940 | } |
921 | } | 941 | } |
922 | startUp++; | 942 | startUp++; |
923 | } | 943 | } |
924 | 944 | ||
925 | void Konsole::parseCommandLine() { | 945 | void Konsole::parseCommandLine() { |
926 | QString cmd; | 946 | QString cmd; |
927 | // newSession(); | 947 | // newSession(); |
928 | for (int i=1;i< qApp->argc();i++) { | 948 | for (int i=1;i< qApp->argc();i++) { |
929 | if( QString(qApp->argv()[i]) == "-e") { | 949 | if( QString(qApp->argv()[i]) == "-e") { |
930 | i++; | 950 | i++; |
931 | for ( int j=i;j< qApp->argc();j++) { | 951 | for ( int j=i;j< qApp->argc();j++) { |
932 | cmd+=QString(qApp->argv()[j])+" "; | 952 | cmd+=QString(qApp->argv()[j])+" "; |
933 | } | 953 | } |
934 | cmd.stripWhiteSpace(); | 954 | cmd.stripWhiteSpace(); |
935 | system(cmd.latin1()); | 955 | system(cmd.latin1()); |
936 | exit(0);//close(); | 956 | exit(0);//close(); |
937 | } // end -e switch | 957 | } // end -e switch |
938 | } | 958 | } |
939 | startUp++; | 959 | startUp++; |
940 | } | 960 | } |
941 | 961 | ||
942 | void Konsole::changeForegroundColor(const QColor &color) { | 962 | void Konsole::changeForegroundColor(const QColor &color) { |
943 | Config cfg("Konsole"); | 963 | Config cfg("Konsole"); |
944 | cfg.setGroup("Colors"); | 964 | cfg.setGroup("Colors"); |
945 | int r, g, b; | 965 | int r, g, b; |
946 | color.rgb(&r,&g,&b); | 966 | color.rgb(&r,&g,&b); |
947 | foreground.setRgb(r,g,b); | 967 | foreground.setRgb(r,g,b); |
948 | // QString colors; | 968 | // QString colors; |
949 | // colors.sprintf("%d,%d,%d"color.red,color.green,color.blue); | 969 | // colors.sprintf("%d,%d,%d"color.red,color.green,color.blue); |
950 | cfg.writeEntry("foreground",color.name()); | 970 | cfg.writeEntry("foreground",color.name()); |
951 | cfg.write(); | 971 | cfg.write(); |
952 | 972 | ||
953 | qDebug("do other dialog"); | 973 | qDebug("do other dialog"); |
954 | ColorPopupMenu* penColorPopupMenu2 = new ColorPopupMenu(Qt::black, this,"background color"); | 974 | ColorPopupMenu* penColorPopupMenu2 = new ColorPopupMenu(Qt::black, this,"background color"); |
955 | connect(penColorPopupMenu2, SIGNAL(colorSelected(const QColor&)), this, | 975 | connect(penColorPopupMenu2, SIGNAL(colorSelected(const QColor&)), this, |
956 | SLOT(changeBackgroundColor(const QColor&))); | 976 | SLOT(changeBackgroundColor(const QColor&))); |
957 | penColorPopupMenu2->exec(); | 977 | penColorPopupMenu2->exec(); |
958 | 978 | ||
959 | } | 979 | } |
960 | 980 | ||
961 | void Konsole::changeBackgroundColor(const QColor &color) { | 981 | void Konsole::changeBackgroundColor(const QColor &color) { |
962 | 982 | ||
963 | qDebug("Change background"); | 983 | qDebug("Change background"); |
964 | Config cfg("Konsole"); | 984 | Config cfg("Konsole"); |
965 | cfg.setGroup("Colors"); | 985 | cfg.setGroup("Colors"); |
966 | int r, g, b; | 986 | int r, g, b; |
967 | color.rgb(&r,&g,&b); | 987 | color.rgb(&r,&g,&b); |
968 | background.setRgb(r,g,b); | 988 | background.setRgb(r,g,b); |
969 | // QString colors; | 989 | // QString colors; |
970 | // colors.sprintf("%d,%d,%d"color.red,color.green,color.blue); | 990 | // colors.sprintf("%d,%d,%d"color.red,color.green,color.blue); |
971 | cfg.writeEntry("background",color.name()); | 991 | cfg.writeEntry("background",color.name()); |
972 | cfg.write(); | 992 | cfg.write(); |
973 | } | 993 | } |
994 | |||
995 | void Konsole::doWrap() { | ||
996 | Config cfg("Konsole"); | ||
997 | cfg.setGroup("ScrollBar"); | ||
998 | TEWidget* te = getTe(); | ||
999 | if( !cfg.readBoolEntry("HorzScroll",0)) { | ||
1000 | te->setWrapAt(0); | ||
1001 | configMenu->setItemChecked(-29,FALSE); | ||
1002 | } else { | ||
1003 | te->setWrapAt(90); | ||
1004 | // te->setWrapAt(120); | ||
1005 | configMenu->setItemChecked(-29,TRUE); | ||
1006 | } | ||
1007 | } | ||
diff --git a/core/apps/embeddedkonsole/konsole.h b/core/apps/embeddedkonsole/konsole.h index 0bf3fb3..4938159 100644 --- a/core/apps/embeddedkonsole/konsole.h +++ b/core/apps/embeddedkonsole/konsole.h | |||
@@ -1,143 +1,144 @@ | |||
1 | /* ----------------------------------------------------------------------- */ | 1 | /* ----------------------------------------------------------------------- */ |
2 | /* */ | 2 | /* */ |
3 | /* [konsole.h] Konsole */ | 3 | /* [konsole.h] Konsole */ |
4 | /* */ | 4 | /* */ |
5 | /* -------------------------------------------------------------------------- */ | 5 | /* -------------------------------------------------------------------------- */ |
6 | /* */ | 6 | /* */ |
7 | /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ | 7 | /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ |
8 | /* */ | 8 | /* */ |
9 | /* This file is part of Konsole, an X terminal. */ | 9 | /* This file is part of Konsole, an X terminal. */ |
10 | /* */ | 10 | /* */ |
11 | /* The material contained in here more or less directly orginates from */ | 11 | /* The material contained in here more or less directly orginates from */ |
12 | /* kvt, which is copyright (c) 1996 by Matthias Ettrich <ettrich@kde.org> */ | 12 | /* kvt, which is copyright (c) 1996 by Matthias Ettrich <ettrich@kde.org> */ |
13 | /* */ | 13 | /* */ |
14 | /* -------------------------------------------------------------------------- */ | 14 | /* -------------------------------------------------------------------------- */ |
15 | /* */ | 15 | /* */ |
16 | /* Ported Konsole to Qt/Embedded */ | 16 | /* Ported Konsole to Qt/Embedded */ |
17 | /* */ | 17 | /* */ |
18 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ | 18 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ |
19 | /* */ | 19 | /* */ |
20 | /* -------------------------------------------------------------------------- */ | 20 | /* -------------------------------------------------------------------------- */ |
21 | 21 | ||
22 | #ifndef KONSOLE_H | 22 | #ifndef KONSOLE_H |
23 | #define KONSOLE_H | 23 | #define KONSOLE_H |
24 | 24 | ||
25 | 25 | ||
26 | #include <qmainwindow.h> | 26 | #include <qmainwindow.h> |
27 | #include <qaction.h> | 27 | #include <qaction.h> |
28 | #include <qpopupmenu.h> | 28 | #include <qpopupmenu.h> |
29 | #include <qstrlist.h> | 29 | #include <qstrlist.h> |
30 | #include <qintdict.h> | 30 | #include <qintdict.h> |
31 | #include <qptrdict.h> | 31 | #include <qptrdict.h> |
32 | #include <qtabwidget.h> | 32 | #include <qtabwidget.h> |
33 | #include <qpe/qpetoolbar.h> | 33 | #include <qpe/qpetoolbar.h> |
34 | #include <qcombobox.h> | 34 | #include <qcombobox.h> |
35 | #include <qcolor.h> | 35 | #include <qcolor.h> |
36 | 36 | ||
37 | #include "MyPty.h" | 37 | #include "MyPty.h" |
38 | #include "TEWidget.h" | 38 | #include "TEWidget.h" |
39 | #include "TEmuVt102.h" | 39 | #include "TEmuVt102.h" |
40 | #include "session.h" | 40 | #include "session.h" |
41 | 41 | ||
42 | class EKNumTabWidget; | 42 | class EKNumTabWidget; |
43 | 43 | ||
44 | class Konsole : public QMainWindow | 44 | class Konsole : public QMainWindow |
45 | { | 45 | { |
46 | Q_OBJECT | 46 | Q_OBJECT |
47 | 47 | ||
48 | public: | 48 | public: |
49 | 49 | ||
50 | Konsole(QWidget* parent = 0, const char* name = 0, WFlags fl = 0); | 50 | Konsole(QWidget* parent = 0, const char* name = 0, WFlags fl = 0); |
51 | Konsole(const char * name, const char* pgm, QStrList & _args, int histon); | 51 | Konsole(const char * name, const char* pgm, QStrList & _args, int histon); |
52 | ~Konsole(); | 52 | ~Konsole(); |
53 | void setColLin(int columns, int lines); | 53 | void setColLin(int columns, int lines); |
54 | QPEToolBar *secondToolBar; | 54 | QPEToolBar *secondToolBar; |
55 | void show(); | 55 | void show(); |
56 | void setColor(); | 56 | void setColor(); |
57 | int lastSelectedMenu; | 57 | int lastSelectedMenu; |
58 | int startUp; | 58 | int startUp; |
59 | private slots: | 59 | private slots: |
60 | void setDocument(const QString &); | 60 | void setDocument(const QString &); |
61 | void doneSession(TESession*,int); | 61 | void doneSession(TESession*,int); |
62 | void changeColumns(int); | 62 | void changeColumns(int); |
63 | void fontChanged(int); | 63 | void fontChanged(int); |
64 | void configMenuSelected(int ); | 64 | void configMenuSelected(int ); |
65 | void colorMenuSelected(int); | 65 | void colorMenuSelected(int); |
66 | void colorMenuIsSelected(int); | 66 | void colorMenuIsSelected(int); |
67 | void enterCommand(int); | 67 | void enterCommand(int); |
68 | void hitEnter(); | 68 | void hitEnter(); |
69 | void hitSpace(); | 69 | void hitSpace(); |
70 | void hitTab(); | 70 | void hitTab(); |
71 | void hitPaste(); | 71 | void hitPaste(); |
72 | void hitUp(); | 72 | void hitUp(); |
73 | void hitDown(); | 73 | void hitDown(); |
74 | void switchSession(QWidget *); | 74 | void switchSession(QWidget *); |
75 | void newSession(); | 75 | void newSession(); |
76 | void changeCommand(const QString &, int); | 76 | void changeCommand(const QString &, int); |
77 | void initCommandList(); | 77 | void initCommandList(); |
78 | void scrollMenuSelected(int); | 78 | void scrollMenuSelected(int); |
79 | void editCommandListMenuSelected(int); | 79 | void editCommandListMenuSelected(int); |
80 | void parseCommandLine(); | 80 | void parseCommandLine(); |
81 | void changeForegroundColor(const QColor &); | 81 | void changeForegroundColor(const QColor &); |
82 | void changeBackgroundColor(const QColor &); | 82 | void changeBackgroundColor(const QColor &); |
83 | private: | 83 | private: |
84 | void doWrap(); | ||
84 | void init(const char* _pgm, QStrList & _args); | 85 | void init(const char* _pgm, QStrList & _args); |
85 | void initSession(const char* _pgm, QStrList & _args); | 86 | void initSession(const char* _pgm, QStrList & _args); |
86 | void runSession(TESession* s); | 87 | void runSession(TESession* s); |
87 | void setColorPixmaps(); | 88 | void setColorPixmaps(); |
88 | void setHistory(bool); | 89 | void setHistory(bool); |
89 | QSize calcSize(int columns, int lines); | 90 | QSize calcSize(int columns, int lines); |
90 | TEWidget* getTe(); | 91 | TEWidget* getTe(); |
91 | QStringList commands; | 92 | QStringList commands; |
92 | QLabel * msgLabel; | 93 | QLabel * msgLabel; |
93 | QColor foreground, background; | 94 | QColor foreground, background; |
94 | bool fromMenu; | 95 | bool fromMenu; |
95 | private: | 96 | private: |
96 | class VTFont | 97 | class VTFont |
97 | { | 98 | { |
98 | public: | 99 | public: |
99 | VTFont(QString name, QFont& font) | 100 | VTFont(QString name, QFont& font) |
100 | { | 101 | { |
101 | this->name = name; | 102 | this->name = name; |
102 | this->font = font; | 103 | this->font = font; |
103 | } | 104 | } |
104 | 105 | ||
105 | QFont& getFont() | 106 | QFont& getFont() |
106 | { | 107 | { |
107 | return font; | 108 | return font; |
108 | } | 109 | } |
109 | 110 | ||
110 | QString getName() | 111 | QString getName() |
111 | { | 112 | { |
112 | return name; | 113 | return name; |
113 | } | 114 | } |
114 | 115 | ||
115 | private: | 116 | private: |
116 | QString name; | 117 | QString name; |
117 | QFont font; | 118 | QFont font; |
118 | }; | 119 | }; |
119 | 120 | ||
120 | EKNumTabWidget* tab; | 121 | EKNumTabWidget* tab; |
121 | int nsessions; | 122 | int nsessions; |
122 | QList<VTFont> fonts; | 123 | QList<VTFont> fonts; |
123 | int cfont; | 124 | int cfont; |
124 | QCString se_pgm; | 125 | QCString se_pgm; |
125 | QStrList se_args; | 126 | QStrList se_args; |
126 | 127 | ||
127 | QPopupMenu *fontList,*configMenu,*colorMenu,*scrollMenu,*editCommandListMenu; | 128 | QPopupMenu *fontList,*configMenu,*colorMenu,*scrollMenu,*editCommandListMenu; |
128 | QComboBox *commonCombo; | 129 | QComboBox *commonCombo; |
129 | // history scrolling I think | 130 | // history scrolling I think |
130 | bool b_scroll; | 131 | bool b_scroll; |
131 | 132 | ||
132 | int n_keytab; | 133 | int n_keytab; |
133 | int n_scroll; | 134 | int n_scroll; |
134 | int n_render; | 135 | int n_render; |
135 | QString pmPath; // pixmap path | 136 | QString pmPath; // pixmap path |
136 | QString dropText; | 137 | QString dropText; |
137 | QFont defaultFont; | 138 | QFont defaultFont; |
138 | QSize defaultSize; | 139 | QSize defaultSize; |
139 | 140 | ||
140 | }; | 141 | }; |
141 | 142 | ||
142 | #endif | 143 | #endif |
143 | 144 | ||