summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2004-04-07 07:31:34 (UTC)
committer llornkcor <llornkcor>2004-04-07 07:31:34 (UTC)
commit8934c3230dfab60e1ecef0a3c0cafa1e67be5c75 (patch) (unidiff)
tree0c0d48441c8fb6c6416a564f4a1472fd7e061503
parent843ac5d18f43e7f79ea6144c93bde0bd0e3e2f40 (diff)
downloadopie-8934c3230dfab60e1ecef0a3c0cafa1e67be5c75.zip
opie-8934c3230dfab60e1ecef0a3c0cafa1e67be5c75.tar.gz
opie-8934c3230dfab60e1ecef0a3c0cafa1e67be5c75.tar.bz2
move namespace into opie ifdef
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/konsole.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp
index cbea7bd..ff5c2f1 100644
--- a/core/apps/embeddedkonsole/konsole.cpp
+++ b/core/apps/embeddedkonsole/konsole.cpp
@@ -1,100 +1,100 @@
1 1
2/* ---------------------------------------------------------------------- */ 2/* ---------------------------------------------------------------------- */
3/* */ 3/* */
4/* [main.C] Konsole */ 4/* [main.C] Konsole */
5/* */ 5/* */
6/* ---------------------------------------------------------------------- */ 6/* ---------------------------------------------------------------------- */
7/* */ 7/* */
8/* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ 8/* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */
9/* */ 9/* */
10/* This file is part of Konsole, an X terminal. */ 10/* This file is part of Konsole, an X terminal. */
11/* */ 11/* */
12/* The material contained in here more or less directly orginates from */ 12/* The material contained in here more or less directly orginates from */
13/* kvt, which is copyright (c) 1996 by Matthias Ettrich <ettrich@kde.org> */ 13/* kvt, which is copyright (c) 1996 by Matthias Ettrich <ettrich@kde.org> */
14/* */ 14/* */
15/* ---------------------------------------------------------------------- */ 15/* ---------------------------------------------------------------------- */
16/* */ 16/* */
17/* Ported Konsole to Qt/Embedded */ 17/* Ported Konsole to Qt/Embedded */
18/* */ 18/* */
19/* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ 19/* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */
20/* */ 20/* */
21/* -------------------------------------------------------------------------- */ 21/* -------------------------------------------------------------------------- */
22// enhancements added by L.J. Potter <ljp@llornkcor.com> 22// enhancements added by L.J. Potter <ljp@llornkcor.com>
23// enhancements added by Phillip Kuhn 23// enhancements added by Phillip Kuhn
24 24
25#include <stdlib.h> 25#include <stdlib.h>
26#include <sys/types.h> 26#include <sys/types.h>
27#include <pwd.h> 27#include <pwd.h>
28#include <unistd.h> 28#include <unistd.h>
29 29
30#ifdef QT_QWS_OPIE 30#ifdef QT_QWS_OPIE
31#include <opie2/ocolorpopupmenu.h> 31#include <opie2/ocolorpopupmenu.h>
32using namespace Opie;
32#endif 33#endif
33 34
34#include <qpe/resource.h> 35#include <qpe/resource.h>
35 36
36#include <qmenubar.h> 37#include <qmenubar.h>
37#include <qtabbar.h> 38#include <qtabbar.h>
38#include <qpe/config.h> 39#include <qpe/config.h>
39#include <qfontdatabase.h> 40#include <qfontdatabase.h>
40#include <qfile.h> 41#include <qfile.h>
41#include <qspinbox.h> 42#include <qspinbox.h>
42#include <qlayout.h> 43#include <qlayout.h>
43 44
44#include <sys/wait.h> 45#include <sys/wait.h>
45#include <stdio.h> 46#include <stdio.h>
46#include <stdlib.h> 47#include <stdlib.h>
47#include <assert.h> 48#include <assert.h>
48 49
49#include "konsole.h" 50#include "konsole.h"
50#include "commandeditdialog.h" 51#include "commandeditdialog.h"
51 52
52using namespace Opie;
53class EKNumTabBar : public QTabBar 53class EKNumTabBar : public QTabBar
54{ 54{
55public: 55public:
56 EKNumTabBar(QWidget *parent = 0, const char *name = 0) : 56 EKNumTabBar(QWidget *parent = 0, const char *name = 0) :
57 QTabBar(parent, name) 57 QTabBar(parent, name)
58 {} 58 {}
59 59
60 // QList<QTab> *getTabList() { return(tabList()); } 60 // QList<QTab> *getTabList() { return(tabList()); }
61 61
62 void numberTabs() 62 void numberTabs()
63 { 63 {
64 // Yes, it really is this messy. QTabWidget needs functions 64 // Yes, it really is this messy. QTabWidget needs functions
65 // that provide acces to tabs in a sequential way. 65 // that provide acces to tabs in a sequential way.
66 int m=INT_MIN; 66 int m=INT_MIN;
67 for (int i=0; i<count(); i++) 67 for (int i=0; i<count(); i++)
68 { 68 {
69 QTab* left=0; 69 QTab* left=0;
70 QListIterator<QTab> it(*tabList()); 70 QListIterator<QTab> it(*tabList());
71 int x=INT_MAX; 71 int x=INT_MAX;
72 for( QTab* t; (t=it.current()); ++it ) 72 for( QTab* t; (t=it.current()); ++it )
73 { 73 {
74 int tx = t->rect().x(); 74 int tx = t->rect().x();
75 if ( tx<x && tx>m ) 75 if ( tx<x && tx>m )
76 { 76 {
77 x = tx; 77 x = tx;
78 left = t; 78 left = t;
79 } 79 }
80 } 80 }
81 if ( left ) 81 if ( left )
82 { 82 {
83 left->setText(QString::number(i+1)); 83 left->setText(QString::number(i+1));
84 m = left->rect().x(); 84 m = left->rect().x();
85 } 85 }
86 } 86 }
87 } 87 }
88 88
89 virtual QSize sizeHint() const 89 virtual QSize sizeHint() const
90 { 90 {
91 if (isHidden()) 91 if (isHidden())
92 { 92 {
93 return(QSize(0,0)); 93 return(QSize(0,0));
94 } 94 }
95 else 95 else
96 { 96 {
97 QSize size = QTabBar::sizeHint(); 97 QSize size = QTabBar::sizeHint();
98 int shrink = 5; 98 int shrink = 5;
99 if (qApp->desktop()->width() > 600 || qApp->desktop()->height() > 600) 99 if (qApp->desktop()->width() > 600 || qApp->desktop()->height() > 600)
100 { 100 {
@@ -468,98 +468,98 @@ void Konsole::init(const char* _pgm, QStrList & _args)
468 { 468 {
469 sizeMenu = new QPopupMenu(); 469 sizeMenu = new QPopupMenu();
470 } 470 }
471 int id = sizeMenu->insertItem(QString("%1").arg(size), fontIndex); 471 int id = sizeMenu->insertItem(QString("%1").arg(size), fontIndex);
472 sizeMenu->setItemParameter(id, fontIndex); 472 sizeMenu->setItemParameter(id, fontIndex);
473 sizeMenu->connectItem(id, this, SLOT(setFont(int))); 473 sizeMenu->connectItem(id, this, SLOT(setFont(int)));
474 QString name = s + " " + QString::number(size); 474 QString name = s + " " + QString::number(size);
475 fonts.append(new VTFont(name, f, familyNames[j], familyNum, size)); 475 fonts.append(new VTFont(name, f, familyNames[j], familyNum, size));
476 if (familyNames[j] == cfgFontName && size == cfgFontSize) 476 if (familyNames[j] == cfgFontName && size == cfgFontSize)
477 { 477 {
478 cfont = fontIndex; 478 cfont = fontIndex;
479 } 479 }
480 printf("FOUND: %s family %s size %d\n", name.latin1(), familyNames[j].latin1(), size); 480 printf("FOUND: %s family %s size %d\n", name.latin1(), familyNames[j].latin1(), size);
481 fontIndex++; 481 fontIndex++;
482 } 482 }
483 } 483 }
484 if (sizeMenu) 484 if (sizeMenu)
485 { 485 {
486 fontList->insertItem(s, sizeMenu, familyNum + 1000); 486 fontList->insertItem(s, sizeMenu, familyNum + 1000);
487 487
488 familyNum++; 488 familyNum++;
489 } 489 }
490 } 490 }
491 491
492 } 492 }
493 493
494 if (cfont < 0 || cfont >= (int)fonts.count()) 494 if (cfont < 0 || cfont >= (int)fonts.count())
495 { 495 {
496 cfont = 0; 496 cfont = 0;
497 } 497 }
498 498
499 // create terminal emulation framework //////////////////////////////////// 499 // create terminal emulation framework ////////////////////////////////////
500 nsessions = 0; 500 nsessions = 0;
501 501
502 tab = new EKNumTabWidget(this); 502 tab = new EKNumTabWidget(this);
503 // tab->setMargin(tab->margin()-5); 503 // tab->setMargin(tab->margin()-5);
504 connect(tab, SIGNAL(currentChanged(QWidget*)), this, SLOT(switchSession(QWidget*))); 504 connect(tab, SIGNAL(currentChanged(QWidget*)), this, SLOT(switchSession(QWidget*)));
505 505
506 // create terminal toolbar //////////////////////////////////////////////// 506 // create terminal toolbar ////////////////////////////////////////////////
507 setToolBarsMovable( FALSE ); 507 setToolBarsMovable( FALSE );
508 menuToolBar = new QToolBar( this ); 508 menuToolBar = new QToolBar( this );
509 menuToolBar->setHorizontalStretchable( TRUE ); 509 menuToolBar->setHorizontalStretchable( TRUE );
510 510
511 QMenuBar *menuBar = new QMenuBar( menuToolBar ); 511 QMenuBar *menuBar = new QMenuBar( menuToolBar );
512 512
513 setFont(cfont); 513 setFont(cfont);
514 514
515 configMenu = new QPopupMenu( this); 515 configMenu = new QPopupMenu( this);
516 colorMenu = new QPopupMenu( this); 516 colorMenu = new QPopupMenu( this);
517 scrollMenu = new QPopupMenu( this); 517 scrollMenu = new QPopupMenu( this);
518 editCommandListMenu = new QPopupMenu( this); 518 editCommandListMenu = new QPopupMenu( this);
519 519
520 configMenu->insertItem(tr("Command List"), editCommandListMenu); 520 configMenu->insertItem(tr("Command List"), editCommandListMenu);
521 521
522 bool listHidden; 522 bool listHidden;
523 cfg.setGroup("Menubar"); 523 cfg.setGroup("Menubar");
524 if( cfg.readEntry("Hidden","FALSE") == "TRUE") 524 if( cfg.readEntry("Hidden","FALSE") == "TRUE")
525 { 525 {
526 ec_cmdlist = editCommandListMenu->insertItem( tr( "Show command list" )); 526 ec_cmdlist = editCommandListMenu->insertItem( tr( "Show command list" ));
527 listHidden=TRUE; 527 listHidden=TRUE;
528 } 528 }
529 else 529 else
530 { 530 {
531 ec_cmdlist = editCommandListMenu->insertItem( tr( "Hide command list" )); 531 ec_cmdlist = editCommandListMenu->insertItem( tr( "Hide command list" ));
532 listHidden=FALSE; 532 listHidden=FALSE;
533 } 533 }
534 534
535 cfg.setGroup("Tabs"); 535 cfg.setGroup("Tabs");
536 536
537 tabMenu = new QPopupMenu(this); 537 tabMenu = new QPopupMenu(this);
538 tm_bottom = tabMenu->insertItem(tr("Bottom" )); 538 tm_bottom = tabMenu->insertItem(tr("Bottom" ));
539 tm_top = tabMenu->insertItem(tr("Top")); 539 tm_top = tabMenu->insertItem(tr("Top"));
540 tm_hidden = tabMenu->insertItem(tr("Hidden")); 540 tm_hidden = tabMenu->insertItem(tr("Hidden"));
541 541
542 configMenu->insertItem(tr("Tabs"), tabMenu); 542 configMenu->insertItem(tr("Tabs"), tabMenu);
543 543
544 tmp=cfg.readEntry("Position","Top"); 544 tmp=cfg.readEntry("Position","Top");
545 if(tmp=="Top") 545 if(tmp=="Top")
546 { 546 {
547 tab->setTabPosition(QTabWidget::Top); 547 tab->setTabPosition(QTabWidget::Top);
548 tab->getTabBar()->show(); 548 tab->getTabBar()->show();
549 tabPos = tm_top; 549 tabPos = tm_top;
550 } 550 }
551 else if (tmp=="Bottom") 551 else if (tmp=="Bottom")
552 { 552 {
553 tab->setTabPosition(QTabWidget::Bottom); 553 tab->setTabPosition(QTabWidget::Bottom);
554 tab->getTabBar()->show(); 554 tab->getTabBar()->show();
555 tabPos = tm_bottom; 555 tabPos = tm_bottom;
556 } 556 }
557 else 557 else
558 { 558 {
559 tab->getTabBar()->hide(); 559 tab->getTabBar()->hide();
560 tab->setMargin(tab->margin()); 560 tab->setMargin(tab->margin());
561 tabPos = tm_hidden; 561 tabPos = tm_hidden;
562 } 562 }
563 563
564 cm_bw = colorMenu->insertItem(tr( "Black on White")); 564 cm_bw = colorMenu->insertItem(tr( "Black on White"));
565 cm_wb = colorMenu->insertItem(tr( "White on Black")); 565 cm_wb = colorMenu->insertItem(tr( "White on Black"));