summaryrefslogtreecommitdiff
path: root/core/apps/embeddedkonsole/konsole.cpp
Unidiff
Diffstat (limited to 'core/apps/embeddedkonsole/konsole.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/konsole.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp
index d855d90..fff2f68 100644
--- a/core/apps/embeddedkonsole/konsole.cpp
+++ b/core/apps/embeddedkonsole/konsole.cpp
@@ -7,49 +7,49 @@
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// enhancements added by L.J. Potter <ljp@llornkcor.com> 21// enhancements added by L.J. Potter <ljp@llornkcor.com>
22#define QT_QWS_OPIE 22#define QT_QWS_OPIE
23 23
24#include <qpe/resource.h> 24#include <qpe/resource.h>
25 25
26#include <qdir.h> 26#include <qdir.h>
27#include <qevent.h> 27#include <qevent.h>
28#include <qdragobject.h> 28#include <qdragobject.h>
29#include <qobjectlist.h> 29#include <qobjectlist.h>
30#include <qtoolbutton.h> 30#include <qtoolbutton.h>
31#include <qpe/qpetoolbar.h> 31#include <qtoolbar.h>
32#include <qpushbutton.h> 32#include <qpushbutton.h>
33#include <qfontdialog.h> 33#include <qfontdialog.h>
34#include <qglobal.h> 34#include <qglobal.h>
35#include <qpainter.h> 35#include <qpainter.h>
36#include <qmenubar.h> 36#include <qmenubar.h>
37#include <qmessagebox.h> 37#include <qmessagebox.h>
38#include <qaction.h> 38#include <qaction.h>
39#include <qapplication.h> 39#include <qapplication.h>
40#include <qfontmetrics.h> 40#include <qfontmetrics.h>
41#include <qcombobox.h> 41#include <qcombobox.h>
42#include <qevent.h> 42#include <qevent.h>
43#include <qtabwidget.h> 43#include <qtabwidget.h>
44#include <qtabbar.h> 44#include <qtabbar.h>
45#include <qpe/config.h> 45#include <qpe/config.h>
46#include <qstringlist.h> 46#include <qstringlist.h>
47#include <qpalette.h> 47#include <qpalette.h>
48 48
49#include <unistd.h> 49#include <unistd.h>
50#include <pwd.h> 50#include <pwd.h>
51#include <sys/types.h> 51#include <sys/types.h>
52#include <sys/wait.h> 52#include <sys/wait.h>
53#include <stdio.h> 53#include <stdio.h>
54#include <stdlib.h> 54#include <stdlib.h>
55#include <assert.h> 55#include <assert.h>
@@ -261,49 +261,49 @@ void Konsole::init(const char* _pgm, QStrList & _args)
261 QString tmp; 261 QString tmp;
262 // initialize the list of allowed fonts /////////////////////////////////// 262 // initialize the list of allowed fonts ///////////////////////////////////
263 cfont = cfg.readNumEntry("FontID", 1); 263 cfont = cfg.readNumEntry("FontID", 1);
264 QFont f = QFont("Micro", 4, QFont::Normal); 264 QFont f = QFont("Micro", 4, QFont::Normal);
265 f.setFixedPitch(TRUE); 265 f.setFixedPitch(TRUE);
266 fonts.append(new VTFont(tr("Micro"), f)); 266 fonts.append(new VTFont(tr("Micro"), f));
267 267
268 f = QFont("Fixed", 7, QFont::Normal); 268 f = QFont("Fixed", 7, QFont::Normal);
269 f.setFixedPitch(TRUE); 269 f.setFixedPitch(TRUE);
270 fonts.append(new VTFont(tr("Small Fixed"), f)); 270 fonts.append(new VTFont(tr("Small Fixed"), f));
271 271
272 f = QFont("Fixed", 12, QFont::Normal); 272 f = QFont("Fixed", 12, QFont::Normal);
273 f.setFixedPitch(TRUE); 273 f.setFixedPitch(TRUE);
274 fonts.append(new VTFont(tr("Medium Fixed"), f)); 274 fonts.append(new VTFont(tr("Medium Fixed"), f));
275 275
276 // create terminal emulation framework //////////////////////////////////// 276 // create terminal emulation framework ////////////////////////////////////
277 nsessions = 0; 277 nsessions = 0;
278 278
279 tab = new EKNumTabWidget(this); 279 tab = new EKNumTabWidget(this);
280 280
281 connect(tab, SIGNAL(currentChanged(QWidget*)), this, SLOT(switchSession(QWidget*))); 281 connect(tab, SIGNAL(currentChanged(QWidget*)), this, SLOT(switchSession(QWidget*)));
282 282
283 // create terminal toolbar //////////////////////////////////////////////// 283 // create terminal toolbar ////////////////////////////////////////////////
284 setToolBarsMovable( FALSE ); 284 setToolBarsMovable( FALSE );
285 QPEToolBar *menuToolBar = new QPEToolBar( this ); 285 QToolBar *menuToolBar = new QToolBar( this );
286 menuToolBar->setHorizontalStretchable( TRUE ); 286 menuToolBar->setHorizontalStretchable( TRUE );
287 287
288 QMenuBar *menuBar = new QMenuBar( menuToolBar ); 288 QMenuBar *menuBar = new QMenuBar( menuToolBar );
289 289
290 fontList = new QPopupMenu( this ); 290 fontList = new QPopupMenu( this );
291 for(uint i = 0; i < fonts.count(); i++) { 291 for(uint i = 0; i < fonts.count(); i++) {
292 VTFont *fnt = fonts.at(i); 292 VTFont *fnt = fonts.at(i);
293 fontList->insertItem(fnt->getName(), i); 293 fontList->insertItem(fnt->getName(), i);
294 } 294 }
295 fontChanged(cfont); 295 fontChanged(cfont);
296 296
297 configMenu = new QPopupMenu( this); 297 configMenu = new QPopupMenu( this);
298 colorMenu = new QPopupMenu( this); 298 colorMenu = new QPopupMenu( this);
299 scrollMenu = new QPopupMenu( this); 299 scrollMenu = new QPopupMenu( this);
300 editCommandListMenu = new QPopupMenu( this); 300 editCommandListMenu = new QPopupMenu( this);
301 301
302 configMenu->insertItem(tr("Command List"), editCommandListMenu); 302 configMenu->insertItem(tr("Command List"), editCommandListMenu);
303 303
304 bool listHidden; 304 bool listHidden;
305 cfg.setGroup("Menubar"); 305 cfg.setGroup("Menubar");
306 if( cfg.readEntry("Hidden","FALSE") == "TRUE") { 306 if( cfg.readEntry("Hidden","FALSE") == "TRUE") {
307 editCommandListMenu->insertItem( tr( "Show command list" )); 307 editCommandListMenu->insertItem( tr( "Show command list" ));
308 listHidden=TRUE; 308 listHidden=TRUE;
309 } else { 309 } else {
@@ -330,75 +330,75 @@ void Konsole::init(const char* _pgm, QStrList & _args)
330 colorMenu->insertItem(tr( "Red on Black")); 330 colorMenu->insertItem(tr( "Red on Black"));
331 colorMenu->insertItem(tr( "Green on Yellow")); 331 colorMenu->insertItem(tr( "Green on Yellow"));
332 colorMenu->insertItem(tr( "Blue on Magenta")); 332 colorMenu->insertItem(tr( "Blue on Magenta"));
333 colorMenu->insertItem(tr( "Magenta on Blue")); 333 colorMenu->insertItem(tr( "Magenta on Blue"));
334 colorMenu->insertItem(tr( "Cyan on White")); 334 colorMenu->insertItem(tr( "Cyan on White"));
335 colorMenu->insertItem(tr( "White on Cyan")); 335 colorMenu->insertItem(tr( "White on Cyan"));
336 colorMenu->insertItem(tr( "Blue on Black")); 336 colorMenu->insertItem(tr( "Blue on Black"));
337 colorMenu->insertItem(tr( "Amber on Black")); 337 colorMenu->insertItem(tr( "Amber on Black"));
338 338
339#ifdef QT_QWS_OPIE 339#ifdef QT_QWS_OPIE
340 colorMenu->insertItem(tr( "Custom")); 340 colorMenu->insertItem(tr( "Custom"));
341#endif 341#endif
342 342
343 configMenu->insertItem( tr("Font"), fontList ); 343 configMenu->insertItem( tr("Font"), fontList );
344 configMenu->insertItem(tr( "Colors") ,colorMenu); 344 configMenu->insertItem(tr( "Colors") ,colorMenu);
345 345
346 connect( fontList, SIGNAL( activated(int) ), this, SLOT( fontChanged(int) )); 346 connect( fontList, SIGNAL( activated(int) ), this, SLOT( fontChanged(int) ));
347 connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) )); 347 connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) ));
348 connect( colorMenu, SIGNAL( activated(int) ), this, SLOT( colorMenuIsSelected(int) )); 348 connect( colorMenu, SIGNAL( activated(int) ), this, SLOT( colorMenuIsSelected(int) ));
349 connect( scrollMenu, SIGNAL(activated(int)),this,SLOT(scrollMenuSelected(int))); 349 connect( scrollMenu, SIGNAL(activated(int)),this,SLOT(scrollMenuSelected(int)));
350 connect(editCommandListMenu,SIGNAL(activated(int)),this,SLOT(editCommandListMenuSelected(int))); 350 connect(editCommandListMenu,SIGNAL(activated(int)),this,SLOT(editCommandListMenuSelected(int)));
351 351
352 menuBar->insertItem( tr("Options"), configMenu ); 352 menuBar->insertItem( tr("Options"), configMenu );
353 353
354 QPEToolBar *toolbar = new QPEToolBar( this ); 354 QToolBar *toolbar = new QToolBar( this );
355 355
356 QAction *a; 356 QAction *a;
357 357
358 // Button Commands 358 // Button Commands
359 a = new QAction( tr("New"), Resource::loadPixmap( "konsole" ), QString::null, 0, this, 0 ); 359 a = new QAction( tr("New"), Resource::loadPixmap( "konsole" ), QString::null, 0, this, 0 );
360 connect( a, SIGNAL( activated() ), this, SLOT( newSession() ) ); a->addTo( toolbar ); 360 connect( a, SIGNAL( activated() ), this, SLOT( newSession() ) ); a->addTo( toolbar );
361 a = new QAction( tr("Enter"), Resource::loadPixmap( "konsole/enter" ), QString::null, 0, this, 0 ); 361 a = new QAction( tr("Enter"), Resource::loadPixmap( "konsole/enter" ), QString::null, 0, this, 0 );
362 connect( a, SIGNAL( activated() ), this, SLOT( hitEnter() ) ); a->addTo( toolbar ); 362 connect( a, SIGNAL( activated() ), this, SLOT( hitEnter() ) ); a->addTo( toolbar );
363 a = new QAction( tr("Space"), Resource::loadPixmap( "konsole/space" ), QString::null, 0, this, 0 ); 363 a = new QAction( tr("Space"), Resource::loadPixmap( "konsole/space" ), QString::null, 0, this, 0 );
364 connect( a, SIGNAL( activated() ), this, SLOT( hitSpace() ) ); a->addTo( toolbar ); 364 connect( a, SIGNAL( activated() ), this, SLOT( hitSpace() ) ); a->addTo( toolbar );
365 a = new QAction( tr("Tab"), Resource::loadPixmap( "konsole/tab" ), QString::null, 0, this, 0 ); 365 a = new QAction( tr("Tab"), Resource::loadPixmap( "konsole/tab" ), QString::null, 0, this, 0 );
366 connect( a, SIGNAL( activated() ), this, SLOT( hitTab() ) ); a->addTo( toolbar ); 366 connect( a, SIGNAL( activated() ), this, SLOT( hitTab() ) ); a->addTo( toolbar );
367 a = new QAction( tr("Up"), Resource::loadPixmap( "konsole/up" ), QString::null, 0, this, 0 ); 367 a = new QAction( tr("Up"), Resource::loadPixmap( "konsole/up" ), QString::null, 0, this, 0 );
368 connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar ); 368 connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar );
369 a = new QAction( tr("Down"), Resource::loadPixmap( "konsole/down" ), QString::null, 0, this, 0 ); 369 a = new QAction( tr("Down"), Resource::loadPixmap( "konsole/down" ), QString::null, 0, this, 0 );
370 connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar ); 370 connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar );
371 a = new QAction( tr("Paste"), Resource::loadPixmap( "paste" ), QString::null, 0, this, 0 ); 371 a = new QAction( tr("Paste"), Resource::loadPixmap( "paste" ), QString::null, 0, this, 0 );
372 connect( a, SIGNAL( activated() ), this, SLOT( hitPaste() ) ); a->addTo( toolbar ); 372 connect( a, SIGNAL( activated() ), this, SLOT( hitPaste() ) ); a->addTo( toolbar );
373/* 373/*
374 a = new QAction( tr("Up"), Resource::loadPixmap( "up" ), QString::null, 0, this, 0 ); 374 a = new QAction( tr("Up"), Resource::loadPixmap( "up" ), QString::null, 0, this, 0 );
375 connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar ); 375 connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar );
376 a = new QAction( tr("Down"), Resource::loadPixmap( "down" ), QString::null, 0, this, 0 ); 376 a = new QAction( tr("Down"), Resource::loadPixmap( "down" ), QString::null, 0, this, 0 );
377 connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar ); 377 connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar );
378*/ 378*/
379 379
380 secondToolBar = new QPEToolBar( this ); 380 secondToolBar = new QToolBar( this );
381 secondToolBar->setHorizontalStretchable( TRUE ); 381 secondToolBar->setHorizontalStretchable( TRUE );
382 382
383 commonCombo = new QComboBox( secondToolBar ); 383 commonCombo = new QComboBox( secondToolBar );
384 commonCombo->setMaximumWidth(236); 384 commonCombo->setMaximumWidth(236);
385 385
386 editCommandListMenu->insertItem( tr( "Quick Edit" ) ); 386 editCommandListMenu->insertItem( tr( "Quick Edit" ) );
387 if( listHidden) { 387 if( listHidden) {
388 secondToolBar->hide(); 388 secondToolBar->hide();
389 editCommandListMenu->setItemEnabled(-23 ,FALSE); 389 editCommandListMenu->setItemEnabled(-23 ,FALSE);
390 } 390 }
391 editCommandListMenu->insertItem(tr( "Edit" ) ); 391 editCommandListMenu->insertItem(tr( "Edit" ) );
392 392
393 cfg.setGroup("Commands"); 393 cfg.setGroup("Commands");
394 commonCombo->setInsertionPolicy(QComboBox::AtCurrent); 394 commonCombo->setInsertionPolicy(QComboBox::AtCurrent);
395 395
396 initCommandList(); 396 initCommandList();
397// for (int i = 0; commonCmds[i] != NULL; i++) { 397// for (int i = 0; commonCmds[i] != NULL; i++) {
398// commonCombo->insertItem( commonCmds[i], i ); 398// commonCombo->insertItem( commonCmds[i], i );
399// tmp = cfg.readEntry( QString::number(i),""); 399// tmp = cfg.readEntry( QString::number(i),"");
400// if(tmp != "") 400// if(tmp != "")
401// commonCombo->changeItem( tmp,i ); 401// commonCombo->changeItem( tmp,i );
402// } 402// }
403 403
404 connect( commonCombo, SIGNAL( activated(int) ), this, SLOT( enterCommand(int) )); 404 connect( commonCombo, SIGNAL( activated(int) ), this, SLOT( enterCommand(int) ));