-rw-r--r-- | core/apps/embeddedkonsole/TEHistory.cpp | 4 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/commandeditdialog.cpp | 2 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/konsole.cpp | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/core/apps/embeddedkonsole/TEHistory.cpp b/core/apps/embeddedkonsole/TEHistory.cpp index 2417af1..2e6535c 100644 --- a/core/apps/embeddedkonsole/TEHistory.cpp +++ b/core/apps/embeddedkonsole/TEHistory.cpp | |||
@@ -1,45 +1,45 @@ | |||
1 | /* -------------------------------------------------------------------------- */ | 1 | /* -------------------------------------------------------------------------- */ |
2 | /* */ | 2 | /* */ |
3 | /* [TEHistory.C] History Buffer */ | 3 | /* [TEHistory.C] 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 Qkonsole - 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 Qkonsole 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 | #include "TEHistory.h" | 19 | #include "TEHistory.h" |
20 | #include <stdlib.h> | 20 | #include <stdlib.h> |
21 | #include <assert.h> | 21 | #include <assert.h> |
22 | #include <stdio.h> | 22 | #include <stdio.h> |
23 | #include <sys/types.h> | 23 | #include <sys/types.h> |
24 | #include <unistd.h> | 24 | #include <unistd.h> |
25 | #include <errno.h> | 25 | #include <errno.h> |
26 | 26 | ||
27 | #include <qpe/config.h> | 27 | #include <qpe/config.h> |
28 | 28 | ||
29 | #define HERE printf("%s(%d): here\n",__FILE__,__LINE__) | 29 | #define HERE printf("%s(%d): here\n",__FILE__,__LINE__) |
30 | 30 | ||
31 | /* | 31 | /* |
32 | An arbitrary long scroll. | 32 | An arbitrary long scroll. |
33 | 33 | ||
34 | One can modify the scroll only by adding either cells | 34 | One can modify the scroll only by adding either cells |
35 | or newlines, but access it randomly. | 35 | or newlines, but access it randomly. |
36 | 36 | ||
37 | The model is that of an arbitrary wide typewriter scroll | 37 | The model is that of an arbitrary wide typewriter scroll |
38 | in that the scroll is a serie of lines and each line is | 38 | in that the scroll is a serie of lines and each line is |
39 | a serie of cells with no overwriting permitted. | 39 | a serie of cells with no overwriting permitted. |
40 | 40 | ||
41 | The implementation provides arbitrary length and numbers | 41 | The implementation provides arbitrary length and numbers |
42 | of cells and line/column indexed read access to the scroll | 42 | of cells and line/column indexed read access to the scroll |
43 | at constant costs. | 43 | at constant costs. |
44 | 44 | ||
45 | */ | 45 | */ |
diff --git a/core/apps/embeddedkonsole/commandeditdialog.cpp b/core/apps/embeddedkonsole/commandeditdialog.cpp index b23db18..e4255f3 100644 --- a/core/apps/embeddedkonsole/commandeditdialog.cpp +++ b/core/apps/embeddedkonsole/commandeditdialog.cpp | |||
@@ -123,65 +123,65 @@ m_PlayListSelection->addStringToSelection("dc "); | |||
123 | m_PlayListSelection->addStringToSelection("df "); | 123 | m_PlayListSelection->addStringToSelection("df "); |
124 | m_PlayListSelection->addStringToSelection("dmesg"); | 124 | m_PlayListSelection->addStringToSelection("dmesg"); |
125 | m_PlayListSelection->addStringToSelection("echo "); | 125 | m_PlayListSelection->addStringToSelection("echo "); |
126 | m_PlayListSelection->addStringToSelection("env"); | 126 | m_PlayListSelection->addStringToSelection("env"); |
127 | m_PlayListSelection->addStringToSelection("find "); | 127 | m_PlayListSelection->addStringToSelection("find "); |
128 | m_PlayListSelection->addStringToSelection("free"); | 128 | m_PlayListSelection->addStringToSelection("free"); |
129 | m_PlayListSelection->addStringToSelection("grep "); | 129 | m_PlayListSelection->addStringToSelection("grep "); |
130 | m_PlayListSelection->addStringToSelection("ifconfig "); | 130 | m_PlayListSelection->addStringToSelection("ifconfig "); |
131 | m_PlayListSelection->addStringToSelection("ipkg "); | 131 | m_PlayListSelection->addStringToSelection("ipkg "); |
132 | m_PlayListSelection->addStringToSelection("mkdir "); | 132 | m_PlayListSelection->addStringToSelection("mkdir "); |
133 | m_PlayListSelection->addStringToSelection("mv "); | 133 | m_PlayListSelection->addStringToSelection("mv "); |
134 | m_PlayListSelection->addStringToSelection("nc localhost 7776"); | 134 | m_PlayListSelection->addStringToSelection("nc localhost 7776"); |
135 | m_PlayListSelection->addStringToSelection("nc localhost 7777"); | 135 | m_PlayListSelection->addStringToSelection("nc localhost 7777"); |
136 | m_PlayListSelection->addStringToSelection("nslookup "); | 136 | m_PlayListSelection->addStringToSelection("nslookup "); |
137 | m_PlayListSelection->addStringToSelection("ping "); | 137 | m_PlayListSelection->addStringToSelection("ping "); |
138 | m_PlayListSelection->addStringToSelection("ps aux"); | 138 | m_PlayListSelection->addStringToSelection("ps aux"); |
139 | m_PlayListSelection->addStringToSelection("pwd "); | 139 | m_PlayListSelection->addStringToSelection("pwd "); |
140 | m_PlayListSelection->addStringToSelection("rm "); | 140 | m_PlayListSelection->addStringToSelection("rm "); |
141 | m_PlayListSelection->addStringToSelection("rmdir "); | 141 | m_PlayListSelection->addStringToSelection("rmdir "); |
142 | m_PlayListSelection->addStringToSelection("route "); | 142 | m_PlayListSelection->addStringToSelection("route "); |
143 | m_PlayListSelection->addStringToSelection("set "); | 143 | m_PlayListSelection->addStringToSelection("set "); |
144 | m_PlayListSelection->addStringToSelection("traceroute"); | 144 | m_PlayListSelection->addStringToSelection("traceroute"); |
145 | 145 | ||
146 | } | 146 | } |
147 | } | 147 | } |
148 | CommandEditDialog::~CommandEditDialog() | 148 | CommandEditDialog::~CommandEditDialog() |
149 | { | 149 | { |
150 | } | 150 | } |
151 | 151 | ||
152 | void CommandEditDialog::accept() | 152 | void CommandEditDialog::accept() |
153 | { | 153 | { |
154 | int i = 0; | 154 | int i = 0; |
155 | Config *cfg = new Config("Qkonsole"); | 155 | Config *cfg = new Config("Konsole"); |
156 | cfg->setGroup("Commands"); | 156 | cfg->setGroup("Commands"); |
157 | cfg->clearGroup(); | 157 | cfg->clearGroup(); |
158 | 158 | ||
159 | QListViewItemIterator it( m_PlayListSelection ); | 159 | QListViewItemIterator it( m_PlayListSelection ); |
160 | 160 | ||
161 | for ( ; it.current(); ++it ) { | 161 | for ( ; it.current(); ++it ) { |
162 | // qDebug(it.current()->text(0)); | 162 | // qDebug(it.current()->text(0)); |
163 | cfg->writeEntry(QString::number(i),it.current()->text(0)); | 163 | cfg->writeEntry(QString::number(i),it.current()->text(0)); |
164 | i++; | 164 | i++; |
165 | 165 | ||
166 | } | 166 | } |
167 | cfg->writeEntry("Commands Set","TRUE"); | 167 | cfg->writeEntry("Commands Set","TRUE"); |
168 | // qDebug("CommandEditDialog::accept() - written"); | 168 | // qDebug("CommandEditDialog::accept() - written"); |
169 | delete cfg; | 169 | delete cfg; |
170 | emit commandsEdited(); | 170 | emit commandsEdited(); |
171 | close(); | 171 | close(); |
172 | 172 | ||
173 | 173 | ||
174 | 174 | ||
175 | 175 | ||
176 | 176 | ||
177 | } | 177 | } |
178 | 178 | ||
179 | void CommandEditDialog::showEditDialog() | 179 | void CommandEditDialog::showEditDialog() |
180 | { | 180 | { |
181 | editCommandBase *d = new editCommandBase(this,"smalleditdialog", TRUE); | 181 | editCommandBase *d = new editCommandBase(this,"smalleditdialog", TRUE); |
182 | d->setCaption("Edit command"); | 182 | d->setCaption("Edit command"); |
183 | d->TextLabel->setText("Edit command:"); | 183 | d->TextLabel->setText("Edit command:"); |
184 | d->commandEdit->setText(m_PlayListSelection->currentItem()->text(0)); | 184 | d->commandEdit->setText(m_PlayListSelection->currentItem()->text(0)); |
185 | int i = d->exec(); | 185 | int i = d->exec(); |
186 | if ((i==1) && (!(d->commandEdit->text()).isEmpty())) | 186 | if ((i==1) && (!(d->commandEdit->text()).isEmpty())) |
187 | m_PlayListSelection->currentItem()->setText(0,(d->commandEdit->text())); | 187 | m_PlayListSelection->currentItem()->setText(0,(d->commandEdit->text())); |
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp index 3289a04..7812e4c 100644 --- a/core/apps/embeddedkonsole/konsole.cpp +++ b/core/apps/embeddedkonsole/konsole.cpp | |||
@@ -340,65 +340,65 @@ void Konsole::initCommandList() | |||
340 | 340 | ||
341 | 341 | ||
342 | } | 342 | } |
343 | 343 | ||
344 | static void sig_handler(int x) | 344 | static void sig_handler(int x) |
345 | { | 345 | { |
346 | printf("got signal %d\n",x); | 346 | printf("got signal %d\n",x); |
347 | } | 347 | } |
348 | 348 | ||
349 | void Konsole::init(const char* _pgm, QStrList & _args) | 349 | void Konsole::init(const char* _pgm, QStrList & _args) |
350 | { | 350 | { |
351 | 351 | ||
352 | #if 0 | 352 | #if 0 |
353 | for(int i=1; i<=31; i++) | 353 | for(int i=1; i<=31; i++) |
354 | { | 354 | { |
355 | if (i != SIGPIPE && i != SIGPROF && i != SIGSEGV | 355 | if (i != SIGPIPE && i != SIGPROF && i != SIGSEGV |
356 | && i != SIGINT && i != SIGILL && i != SIGTERM | 356 | && i != SIGINT && i != SIGILL && i != SIGTERM |
357 | && i != SIGBUS) | 357 | && i != SIGBUS) |
358 | signal(i,sig_handler); | 358 | signal(i,sig_handler); |
359 | } | 359 | } |
360 | #endif | 360 | #endif |
361 | signal(SIGSTOP, sig_handler); | 361 | signal(SIGSTOP, sig_handler); |
362 | signal(SIGCONT, sig_handler); | 362 | signal(SIGCONT, sig_handler); |
363 | signal(SIGTSTP, sig_handler); | 363 | signal(SIGTSTP, sig_handler); |
364 | 364 | ||
365 | b_scroll = TRUE; // histon; | 365 | b_scroll = TRUE; // histon; |
366 | n_keytab = 0; | 366 | n_keytab = 0; |
367 | n_render = 0; | 367 | n_render = 0; |
368 | startUp=0; | 368 | startUp=0; |
369 | fromMenu = FALSE; | 369 | fromMenu = FALSE; |
370 | fullscreen = false; | 370 | fullscreen = false; |
371 | 371 | ||
372 | setCaption( "Qkonsole" ); | 372 | setCaption( "Konsole" ); |
373 | setIcon( Resource::loadPixmap( "qkonsole/qkonsole" ) ); | 373 | setIcon( Resource::loadPixmap( "qkonsole/qkonsole" ) ); |
374 | 374 | ||
375 | Config cfg( "Konsole" ); | 375 | Config cfg( "Konsole" ); |
376 | cfg.setGroup("Font"); | 376 | cfg.setGroup("Font"); |
377 | QString tmp; | 377 | QString tmp; |
378 | 378 | ||
379 | // initialize the list of allowed fonts /////////////////////////////////// | 379 | // initialize the list of allowed fonts /////////////////////////////////// |
380 | 380 | ||
381 | QString cfgFontName = cfg.readEntry("FontName","Lcfont"); | 381 | QString cfgFontName = cfg.readEntry("FontName","Lcfont"); |
382 | int cfgFontSize = cfg.readNumEntry("FontSize",18); | 382 | int cfgFontSize = cfg.readNumEntry("FontSize",18); |
383 | 383 | ||
384 | cfont = -1; | 384 | cfont = -1; |
385 | 385 | ||
386 | // this code causes repeated access to all the font files | 386 | // this code causes repeated access to all the font files |
387 | // which does slow down startup | 387 | // which does slow down startup |
388 | QFontDatabase fontDB; | 388 | QFontDatabase fontDB; |
389 | QStringList familyNames; | 389 | QStringList familyNames; |
390 | familyNames = fontDB.families( FALSE ); | 390 | familyNames = fontDB.families( FALSE ); |
391 | QString s; | 391 | QString s; |
392 | int fontIndex = 0; | 392 | int fontIndex = 0; |
393 | int familyNum = 0; | 393 | int familyNum = 0; |
394 | fontList = new QPopupMenu( this ); | 394 | fontList = new QPopupMenu( this ); |
395 | 395 | ||
396 | for(uint j = 0; j < (uint)familyNames.count(); j++) | 396 | for(uint j = 0; j < (uint)familyNames.count(); j++) |
397 | { | 397 | { |
398 | s = familyNames[j]; | 398 | s = familyNames[j]; |
399 | if ( s.contains('-') ) | 399 | if ( s.contains('-') ) |
400 | { | 400 | { |
401 | int i = s.find('-'); | 401 | int i = s.find('-'); |
402 | s = s.right( s.length() - i - 1 ) + " [" + s.left( i ) + "]"; | 402 | s = s.right( s.length() - i - 1 ) + " [" + s.left( i ) + "]"; |
403 | } | 403 | } |
404 | s[0] = s[0].upper(); | 404 | s[0] = s[0].upper(); |
@@ -1284,65 +1284,65 @@ void Konsole::changeSession(int delta) | |||
1284 | n++; | 1284 | n++; |
1285 | } | 1285 | } |
1286 | } | 1286 | } |
1287 | } | 1287 | } |
1288 | 1288 | ||
1289 | void Konsole::switchSession(QWidget* w) | 1289 | void Konsole::switchSession(QWidget* w) |
1290 | { | 1290 | { |
1291 | TEWidget* te = (TEWidget *) w; | 1291 | TEWidget* te = (TEWidget *) w; |
1292 | QFont teFnt = te->getVTFont(); | 1292 | QFont teFnt = te->getVTFont(); |
1293 | int familyNum = -1; | 1293 | int familyNum = -1; |
1294 | 1294 | ||
1295 | for(uint i = 0; i < fonts.count(); i++) | 1295 | for(uint i = 0; i < fonts.count(); i++) |
1296 | { | 1296 | { |
1297 | VTFont *fnt = fonts.at(i); | 1297 | VTFont *fnt = fonts.at(i); |
1298 | bool cf = fnt->getFont() == teFnt; | 1298 | bool cf = fnt->getFont() == teFnt; |
1299 | fontList->setItemChecked(i, cf); | 1299 | fontList->setItemChecked(i, cf); |
1300 | if (cf) | 1300 | if (cf) |
1301 | { | 1301 | { |
1302 | cfont = i; | 1302 | cfont = i; |
1303 | familyNum = fnt->getFamilyNum(); | 1303 | familyNum = fnt->getFamilyNum(); |
1304 | } | 1304 | } |
1305 | } | 1305 | } |
1306 | for(int i = 0; i < (int)fontList->count(); i++) | 1306 | for(int i = 0; i < (int)fontList->count(); i++) |
1307 | { | 1307 | { |
1308 | fontList->setItemChecked(i + 1000, i == familyNum); | 1308 | fontList->setItemChecked(i + 1000, i == familyNum); |
1309 | } | 1309 | } |
1310 | if (! te->currentSession->Title().isEmpty() ) | 1310 | if (! te->currentSession->Title().isEmpty() ) |
1311 | { | 1311 | { |
1312 | setCaption(te->currentSession->Title() + " - QKonsole"); | 1312 | setCaption(te->currentSession->Title() + " - QKonsole"); |
1313 | } | 1313 | } |
1314 | else | 1314 | else |
1315 | { | 1315 | { |
1316 | setCaption( "Qkonsole" ); | 1316 | setCaption( "Konsole" ); |
1317 | } | 1317 | } |
1318 | // colorMenuSelected(te->color_menu_item); | 1318 | // colorMenuSelected(te->color_menu_item); |
1319 | } | 1319 | } |
1320 | 1320 | ||
1321 | 1321 | ||
1322 | void Konsole::toggleFullScreen() | 1322 | void Konsole::toggleFullScreen() |
1323 | { | 1323 | { |
1324 | setFullScreen(! fullscreen); | 1324 | setFullScreen(! fullscreen); |
1325 | } | 1325 | } |
1326 | 1326 | ||
1327 | void Konsole::setFullScreen ( bool b ) | 1327 | void Konsole::setFullScreen ( bool b ) |
1328 | { | 1328 | { |
1329 | static QSize normalsize; | 1329 | static QSize normalsize; |
1330 | static bool listHidden; | 1330 | static bool listHidden; |
1331 | 1331 | ||
1332 | if (b == fullscreen) | 1332 | if (b == fullscreen) |
1333 | { | 1333 | { |
1334 | return; | 1334 | return; |
1335 | } | 1335 | } |
1336 | 1336 | ||
1337 | fullscreen = b; | 1337 | fullscreen = b; |
1338 | 1338 | ||
1339 | if ( b ) | 1339 | if ( b ) |
1340 | { | 1340 | { |
1341 | if ( !normalsize. isValid ( )) | 1341 | if ( !normalsize. isValid ( )) |
1342 | { | 1342 | { |
1343 | normalsize = size ( ); | 1343 | normalsize = size ( ); |
1344 | } | 1344 | } |
1345 | 1345 | ||
1346 | setFixedSize ( qApp-> desktop ( )-> size ( )); | 1346 | setFixedSize ( qApp-> desktop ( )-> size ( )); |
1347 | showNormal ( ); | 1347 | showNormal ( ); |
1348 | reparent ( 0, WStyle_Customize | WStyle_NoBorder, | 1348 | reparent ( 0, WStyle_Customize | WStyle_NoBorder, |