summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/konsole.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp
index efcb1f2..f154bb8 100644
--- a/core/apps/embeddedkonsole/konsole.cpp
+++ b/core/apps/embeddedkonsole/konsole.cpp
@@ -43,25 +43,24 @@
43#include <qpe/config.h> 43#include <qpe/config.h>
44#include <qstringlist.h> 44#include <qstringlist.h>
45#include <qpalette.h> 45#include <qpalette.h>
46 46
47#include <sys/wait.h> 47#include <sys/wait.h>
48#include <stdio.h> 48#include <stdio.h>
49#include <stdlib.h> 49#include <stdlib.h>
50#include <assert.h> 50#include <assert.h>
51 51
52#include "konsole.h" 52#include "konsole.h"
53#include "keytrans.h" 53#include "keytrans.h"
54 54
55
56class EKNumTabBar : public QTabBar { 55class EKNumTabBar : public QTabBar {
57public: 56public:
58 void numberTabs() 57 void numberTabs()
59 { 58 {
60 // Yes, it really is this messy. QTabWidget needs functions 59 // Yes, it really is this messy. QTabWidget needs functions
61 // that provide acces to tabs in a sequential way. 60 // that provide acces to tabs in a sequential way.
62 int m=INT_MIN; 61 int m=INT_MIN;
63 for (int i=0; i<count(); i++) { 62 for (int i=0; i<count(); i++) {
64 QTab* left=0; 63 QTab* left=0;
65 QListIterator<QTab> it(*tabList()); 64 QListIterator<QTab> it(*tabList());
66 int x=INT_MAX; 65 int x=INT_MAX;
67 for( QTab* t; (t=it.current()); ++it ) { 66 for( QTab* t; (t=it.current()); ++it ) {
@@ -103,34 +102,34 @@ public:
103static const char *commonCmds[] = 102static const char *commonCmds[] =
104{ 103{
105 "ls ", // I left this here, cause it looks better than the first alpha 104 "ls ", // I left this here, cause it looks better than the first alpha
106 "cardctl eject", 105 "cardctl eject",
107 "cat ", 106 "cat ",
108 "cd ", 107 "cd ",
109 "chmod ", 108 "chmod ",
110 "cp ", 109 "cp ",
111 "dc ", 110 "dc ",
112 "df ", 111 "df ",
113 "dmesg", 112 "dmesg",
114 "echo ", 113 "echo ",
114 "env",
115 "find ", 115 "find ",
116 "free", 116 "free",
117 "grep ", 117 "grep ",
118 "ifconfig ", 118 "ifconfig ",
119 "ipkg ", 119 "ipkg ",
120 "mkdir ", 120 "mkdir ",
121 "mv ", 121 "mv ",
122 "nc localhost 7776", 122 "nc localhost 7776",
123 "nc localhost 7777", 123 "nc localhost 7777",
124 "netstat ",
125 "nslookup ", 124 "nslookup ",
126 "ping ", 125 "ping ",
127 "ps aux", 126 "ps aux",
128 "pwd ", 127 "pwd ",
129 "rm ", 128 "rm ",
130 "rmdir ", 129 "rmdir ",
131 "route ", 130 "route ",
132 "set ", 131 "set ",
133 "traceroute", 132 "traceroute",
134 133
135/* 134/*
136 "gzip", 135 "gzip",
@@ -288,27 +287,29 @@ void Konsole::init(const char* _pgm, QStrList & _args)
288/* 287/*
289 a = new QAction( tr("Up"), Resource::loadPixmap( "up" ), QString::null, 0, this, 0 ); 288 a = new QAction( tr("Up"), Resource::loadPixmap( "up" ), QString::null, 0, this, 0 );
290 connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar ); 289 connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar );
291 a = new QAction( tr("Down"), Resource::loadPixmap( "down" ), QString::null, 0, this, 0 ); 290 a = new QAction( tr("Down"), Resource::loadPixmap( "down" ), QString::null, 0, this, 0 );
292 connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar ); 291 connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar );
293*/ 292*/
294 293
295 secondToolBar = new QPEToolBar( this ); 294 secondToolBar = new QPEToolBar( this );
296 secondToolBar->setHorizontalStretchable( TRUE ); 295 secondToolBar->setHorizontalStretchable( TRUE );
297 296
298 commonCombo = new QComboBox( secondToolBar ); 297 commonCombo = new QComboBox( secondToolBar );
299 298
300 if( listHidden)
301 secondToolBar->hide();
302 configMenu->insertItem( "Edit Command List"); 299 configMenu->insertItem( "Edit Command List");
300 if( listHidden) {
301 secondToolBar->hide();
302 configMenu->setItemEnabled(-20 ,FALSE);
303 }
303 304
304 cfg.setGroup("Commands"); 305 cfg.setGroup("Commands");
305 commonCombo->setInsertionPolicy(QComboBox::AtCurrent); 306 commonCombo->setInsertionPolicy(QComboBox::AtCurrent);
306 307
307 for (int i = 0; commonCmds[i] != NULL; i++) { 308 for (int i = 0; commonCmds[i] != NULL; i++) {
308 commonCombo->insertItem( commonCmds[i], i ); 309 commonCombo->insertItem( commonCmds[i], i );
309 tmp = cfg.readEntry( QString::number(i),""); 310 tmp = cfg.readEntry( QString::number(i),"");
310 if(tmp != "") 311 if(tmp != "")
311 commonCombo->changeItem( tmp,i ); 312 commonCombo->changeItem( tmp,i );
312 } 313 }
313 314
314 connect( commonCombo, SIGNAL( activated(int) ), this, SLOT( enterCommand(int) )); 315 connect( commonCombo, SIGNAL( activated(int) ), this, SLOT( enterCommand(int) ));