summaryrefslogtreecommitdiff
path: root/core/apps
Unidiff
Diffstat (limited to 'core/apps') (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/TEScreen.cpp2
-rw-r--r--core/apps/embeddedkonsole/TEWidget.cpp6
-rw-r--r--core/apps/embeddedkonsole/commandeditdialog.cpp4
-rw-r--r--core/apps/embeddedkonsole/konsole.cpp41
-rw-r--r--core/apps/embeddedkonsole/main.cpp8
-rw-r--r--core/apps/embeddedkonsole/playlistselection.cpp11
6 files changed, 38 insertions, 34 deletions
diff --git a/core/apps/embeddedkonsole/TEScreen.cpp b/core/apps/embeddedkonsole/TEScreen.cpp
index 3dbcec2..8e69a88 100644
--- a/core/apps/embeddedkonsole/TEScreen.cpp
+++ b/core/apps/embeddedkonsole/TEScreen.cpp
@@ -48,49 +48,49 @@
48// #include <kdebug.h> 48// #include <kdebug.h>
49 49
50#include <assert.h> 50#include <assert.h>
51#include <string.h> 51#include <string.h>
52#include <ctype.h> 52#include <ctype.h>
53 53
54#include <qpe/config.h> 54#include <qpe/config.h>
55#include "TEScreen.h" 55#include "TEScreen.h"
56 56
57#define HERE printf("%s(%d): here\n",__FILE__,__LINE__) 57#define HERE printf("%s(%d): here\n",__FILE__,__LINE__)
58 58
59//FIXME: this is emulation specific. Use FALSE for xterm, TRUE for ANSI. 59//FIXME: this is emulation specific. Use FALSE for xterm, TRUE for ANSI.
60//FIXME: see if we can get this from terminfo. 60//FIXME: see if we can get this from terminfo.
61#define BS_CLEARS FALSE 61#define BS_CLEARS FALSE
62 62
63#define loc(X,Y) ((Y) * columns + (X)) 63#define loc(X,Y) ((Y) * columns + (X))
64 64
65/*! creates a `TEScreen' of `lines' lines and `columns' columns. 65/*! creates a `TEScreen' of `lines' lines and `columns' columns.
66*/ 66*/
67 67
68TEScreen::TEScreen(int lines, int columns) 68TEScreen::TEScreen(int lines, int columns)
69{ 69{
70 this->lines = lines; 70 this->lines = lines;
71 this->columns = columns; 71 this->columns = columns;
72// qDebug("Columns %d", columns); 72// odebug << "Columns " << columns << "" << oendl;
73 73
74 image = (ca*) malloc(lines*columns*sizeof(ca)); 74 image = (ca*) malloc(lines*columns*sizeof(ca));
75 tabstops = NULL; initTabStops(); 75 tabstops = NULL; initTabStops();
76 76
77 histCursor = 0; 77 histCursor = 0;
78 horzCursor = 0; 78 horzCursor = 0;
79 79
80 clearSelection(); 80 clearSelection();
81 reset(); 81 reset();
82} 82}
83 83
84/*! Destructor 84/*! Destructor
85*/ 85*/
86 86
87TEScreen::~TEScreen() 87TEScreen::~TEScreen()
88{ 88{
89 free(image); 89 free(image);
90 if (tabstops) free(tabstops); 90 if (tabstops) free(tabstops);
91} 91}
92 92
93/* ------------------------------------------------------------------------- */ 93/* ------------------------------------------------------------------------- */
94/* */ 94/* */
95/* Normalized Screen Operations */ 95/* Normalized Screen Operations */
96/* */ 96/* */
diff --git a/core/apps/embeddedkonsole/TEWidget.cpp b/core/apps/embeddedkonsole/TEWidget.cpp
index 93348f4..3cb1c0a 100644
--- a/core/apps/embeddedkonsole/TEWidget.cpp
+++ b/core/apps/embeddedkonsole/TEWidget.cpp
@@ -920,49 +920,49 @@ int TEWidget::charClass(char ch) const
920 920
921 // Everything else is weird 921 // Everything else is weird
922 return 1; 922 return 1;
923} 923}
924 924
925void TEWidget::setMouseMarks(bool on) 925void TEWidget::setMouseMarks(bool on)
926{ 926{
927 mouse_marks = on; 927 mouse_marks = on;
928 setCursor( mouse_marks ? ibeamCursor : arrowCursor ); 928 setCursor( mouse_marks ? ibeamCursor : arrowCursor );
929} 929}
930 930
931/* ------------------------------------------------------------------------- */ 931/* ------------------------------------------------------------------------- */
932/* */ 932/* */
933/* Clipboard */ 933/* Clipboard */
934/* */ 934/* */
935/* ------------------------------------------------------------------------- */ 935/* ------------------------------------------------------------------------- */
936 936
937#undef KeyPress 937#undef KeyPress
938 938
939void TEWidget::emitSelection() 939void TEWidget::emitSelection()
940// Paste Clipboard by simulating keypress events 940// Paste Clipboard by simulating keypress events
941{ 941{
942#ifndef QT_NO_CLIPBOARD 942#ifndef QT_NO_CLIPBOARD
943 QString text = QApplication::clipboard()->text(); 943 QString text = QApplication::clipboard()->text();
944 //qDebug(text); 944 //odebug << text << oendl;
945 if ( ! text.isNull()) 945 if ( ! text.isNull())
946 { 946 {
947 text.replace(QRegExp("\n"), "\r"); 947 text.replace(QRegExp("\n"), "\r");
948 QKeyEvent e(QEvent::KeyPress, 0, -1, 0, text); 948 QKeyEvent e(QEvent::KeyPress, 0, -1, 0, text);
949 emit keyPressedSignal(&e); // expose as a big fat keypress event 949 emit keyPressedSignal(&e); // expose as a big fat keypress event
950 emit clearSelectionSignal(); 950 emit clearSelectionSignal();
951 } 951 }
952#endif 952#endif
953} 953}
954 954
955void TEWidget::emitText(QString text) 955void TEWidget::emitText(QString text)
956{ 956{
957 QKeyEvent e(QEvent::KeyPress, 0, -1, 0, text); 957 QKeyEvent e(QEvent::KeyPress, 0, -1, 0, text);
958 emit keyPressedSignal(&e); // expose as a big fat keypress event 958 emit keyPressedSignal(&e); // expose as a big fat keypress event
959} 959}
960 960
961void TEWidget::pasteClipboard( ) 961void TEWidget::pasteClipboard( )
962{ 962{
963 emitSelection(); 963 emitSelection();
964} 964}
965 965
966void TEWidget::setSelection(const QString& t) 966void TEWidget::setSelection(const QString& t)
967{ 967{
968#ifndef QT_NO_CLIPBOARD 968#ifndef QT_NO_CLIPBOARD
@@ -1007,88 +1007,88 @@ void TEWidget::doScroll(int lines)
1007{ 1007{
1008 scrollbar->setValue(scrollbar->value()+lines); 1008 scrollbar->setValue(scrollbar->value()+lines);
1009} 1009}
1010 1010
1011void TEWidget::doHScroll(int lines) { 1011void TEWidget::doHScroll(int lines) {
1012 hScrollbar->setValue( hScrollbar->value()+lines); 1012 hScrollbar->setValue( hScrollbar->value()+lines);
1013} 1013}
1014 1014
1015bool TEWidget::eventFilter( QObject *obj, QEvent *e ) 1015bool TEWidget::eventFilter( QObject *obj, QEvent *e )
1016{ 1016{
1017 if ( (e->type() == QEvent::Accel || 1017 if ( (e->type() == QEvent::Accel ||
1018 e->type() == QEvent::AccelAvailable ) && qApp->focusWidget() == this ) { 1018 e->type() == QEvent::AccelAvailable ) && qApp->focusWidget() == this ) {
1019 static_cast<QKeyEvent *>( e )->ignore(); 1019 static_cast<QKeyEvent *>( e )->ignore();
1020 return true; 1020 return true;
1021 } 1021 }
1022 if ( obj != this /* when embedded */ && obj != parent() /* when standalone */ ) 1022 if ( obj != this /* when embedded */ && obj != parent() /* when standalone */ )
1023 return FALSE; // not us 1023 return FALSE; // not us
1024 if ( e->type() == QEvent::Wheel) { 1024 if ( e->type() == QEvent::Wheel) {
1025 QApplication::sendEvent(scrollbar, e); 1025 QApplication::sendEvent(scrollbar, e);
1026 } 1026 }
1027 1027
1028#ifdef FAKE_CTRL_AND_ALT 1028#ifdef FAKE_CTRL_AND_ALT
1029 static bool control = FALSE; 1029 static bool control = FALSE;
1030 static bool alt = FALSE; 1030 static bool alt = FALSE;
1031// qDebug(" Has a keyboard with no CTRL and ALT keys, but we fake it:"); 1031// odebug << " Has a keyboard with no CTRL and ALT keys, but we fake it:" << oendl;
1032 bool dele=FALSE; 1032 bool dele=FALSE;
1033 if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) { 1033 if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) {
1034 QKeyEvent* ke = (QKeyEvent*)e; 1034 QKeyEvent* ke = (QKeyEvent*)e;
1035 bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat(); 1035 bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat();
1036 switch (ke->key()) { 1036 switch (ke->key()) {
1037 case Key_F9: // let this be "Control" 1037 case Key_F9: // let this be "Control"
1038 control = keydown; 1038 control = keydown;
1039 e = new QKeyEvent(QEvent::KeyPress, Key_Control, 0, ke->state()); 1039 e = new QKeyEvent(QEvent::KeyPress, Key_Control, 0, ke->state());
1040 dele=TRUE; 1040 dele=TRUE;
1041 break; 1041 break;
1042 case Key_F13: // let this be "Alt" 1042 case Key_F13: // let this be "Alt"
1043 alt = keydown; 1043 alt = keydown;
1044 e = new QKeyEvent(QEvent::KeyPress, Key_Alt, 0, ke->state()); 1044 e = new QKeyEvent(QEvent::KeyPress, Key_Alt, 0, ke->state());
1045 dele=TRUE; 1045 dele=TRUE;
1046 break; 1046 break;
1047 default: 1047 default:
1048 if ( control ) { 1048 if ( control ) {
1049 int a = toupper(ke->ascii())-64; 1049 int a = toupper(ke->ascii())-64;
1050 if ( a >= 0 && a < ' ' ) { 1050 if ( a >= 0 && a < ' ' ) {
1051 e = new QKeyEvent(e->type(), ke->key(), 1051 e = new QKeyEvent(e->type(), ke->key(),
1052 a, ke->state()|ControlButton, QChar(a,0)); 1052 a, ke->state()|ControlButton, QChar(a,0));
1053 dele=TRUE; 1053 dele=TRUE;
1054 } 1054 }
1055 } 1055 }
1056 if ( alt ) { 1056 if ( alt ) {
1057 e = new QKeyEvent(e->type(), ke->key(), 1057 e = new QKeyEvent(e->type(), ke->key(),
1058 ke->ascii(), ke->state()|AltButton, ke->text()); 1058 ke->ascii(), ke->state()|AltButton, ke->text());
1059 dele=TRUE; 1059 dele=TRUE;
1060 } 1060 }
1061 } 1061 }
1062 } 1062 }
1063#endif 1063#endif
1064 1064
1065 if ( e->type() == QEvent::KeyPress ) { 1065 if ( e->type() == QEvent::KeyPress ) {
1066 QKeyEvent* ke = (QKeyEvent*)e; 1066 QKeyEvent* ke = (QKeyEvent*)e;
1067 actSel=0; // Key stroke implies a screen update, so TEWidget won't 1067 actSel=0; // Key stroke implies a screen update, so TEWidget won't
1068 // know where the current selection is. 1068 // know where the current selection is.
1069 1069
1070// qDebug("key pressed is 0x%x, ascii is 0x%x, state %d", ke->key(), ke->ascii(), ke->state()); 1070// odebug << "key pressed is 0x" << ke->key() << ", ascii is 0x" << ke->ascii() << ", state " << ke->state() << "" << oendl;
1071 1071
1072 bool special_function = true; 1072 bool special_function = true;
1073 switch(ke->key()) { 1073 switch(ke->key()) {
1074 //case 0x201b: // fn-5 1074 //case 0x201b: // fn-5
1075 //case Key_F1: 1075 //case Key_F1:
1076 // switch sessions (?) 1076 // switch sessions (?)
1077 // emitText("\\"); // expose (??) 1077 // emitText("\\"); // expose (??)
1078 // break; 1078 // break;
1079 1079
1080 case 0x2016: // fn-p 1080 case 0x2016: // fn-p
1081 case Key_F2: 1081 case Key_F2:
1082 pasteClipboard(); 1082 pasteClipboard();
1083 break; 1083 break;
1084 1084
1085 case 0x2018: // fn-S 1085 case 0x2018: // fn-S
1086 case Key_F3: 1086 case Key_F3:
1087 emit changeSession(1); 1087 emit changeSession(1);
1088 break; 1088 break;
1089 1089
1090 case 0x2019: // fn-n 1090 case 0x2019: // fn-n
1091 emit newSession(); 1091 emit newSession();
1092 break; 1092 break;
1093 1093
1094 case Qt::Key_Tab: 1094 case Qt::Key_Tab:
diff --git a/core/apps/embeddedkonsole/commandeditdialog.cpp b/core/apps/embeddedkonsole/commandeditdialog.cpp
index 6587b26..697bf72 100644
--- a/core/apps/embeddedkonsole/commandeditdialog.cpp
+++ b/core/apps/embeddedkonsole/commandeditdialog.cpp
@@ -130,55 +130,55 @@ m_PlayListSelection->addStringToSelection("ping ");
130m_PlayListSelection->addStringToSelection("ps aux"); 130m_PlayListSelection->addStringToSelection("ps aux");
131m_PlayListSelection->addStringToSelection("pwd "); 131m_PlayListSelection->addStringToSelection("pwd ");
132m_PlayListSelection->addStringToSelection("rm "); 132m_PlayListSelection->addStringToSelection("rm ");
133m_PlayListSelection->addStringToSelection("rmdir "); 133m_PlayListSelection->addStringToSelection("rmdir ");
134m_PlayListSelection->addStringToSelection("route "); 134m_PlayListSelection->addStringToSelection("route ");
135m_PlayListSelection->addStringToSelection("set "); 135m_PlayListSelection->addStringToSelection("set ");
136m_PlayListSelection->addStringToSelection("traceroute"); 136m_PlayListSelection->addStringToSelection("traceroute");
137 137
138} 138}
139} 139}
140CommandEditDialog::~CommandEditDialog() 140CommandEditDialog::~CommandEditDialog()
141{ 141{
142} 142}
143 143
144void CommandEditDialog::accept() 144void CommandEditDialog::accept()
145{ 145{
146int i = 0; 146int i = 0;
147 Config *cfg = new Config("Konsole"); 147 Config *cfg = new Config("Konsole");
148 cfg->setGroup("Commands"); 148 cfg->setGroup("Commands");
149 cfg->clearGroup(); 149 cfg->clearGroup();
150 150
151 QListViewItemIterator it( m_PlayListSelection ); 151 QListViewItemIterator it( m_PlayListSelection );
152 152
153 for ( ; it.current(); ++it ) { 153 for ( ; it.current(); ++it ) {
154// qDebug(it.current()->text(0)); 154// odebug << it.current()->text(0) << oendl;
155 cfg->writeEntry(QString::number(i),it.current()->text(0)); 155 cfg->writeEntry(QString::number(i),it.current()->text(0));
156 i++; 156 i++;
157 157
158 } 158 }
159 cfg->writeEntry("Commands Set","TRUE"); 159 cfg->writeEntry("Commands Set","TRUE");
160// qDebug("CommandEditDialog::accept() - written"); 160// odebug << "CommandEditDialog::accept() - written" << oendl;
161 delete cfg; 161 delete cfg;
162 emit commandsEdited(); 162 emit commandsEdited();
163 close(); 163 close();
164 164
165 165
166 166
167 167
168 168
169} 169}
170 170
171void CommandEditDialog::showEditDialog() 171void CommandEditDialog::showEditDialog()
172{ 172{
173editCommandBase *d = new editCommandBase(this,"smalleditdialog", TRUE); 173editCommandBase *d = new editCommandBase(this,"smalleditdialog", TRUE);
174d->setCaption("Edit command"); 174d->setCaption("Edit command");
175d->TextLabel->setText("Edit command:"); 175d->TextLabel->setText("Edit command:");
176d->commandEdit->setText(m_PlayListSelection->currentItem()->text(0)); 176d->commandEdit->setText(m_PlayListSelection->currentItem()->text(0));
177int i = d->exec(); 177int i = d->exec();
178if ((i==1) && (!(d->commandEdit->text()).isEmpty())) 178if ((i==1) && (!(d->commandEdit->text()).isEmpty()))
179 m_PlayListSelection->currentItem()->setText(0,(d->commandEdit->text())); 179 m_PlayListSelection->currentItem()->setText(0,(d->commandEdit->text()));
180} 180}
181 181
182void CommandEditDialog::showAddDialog() 182void CommandEditDialog::showAddDialog()
183{ 183{
184 184
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp
index 8207f23..80c8223 100644
--- a/core/apps/embeddedkonsole/konsole.cpp
+++ b/core/apps/embeddedkonsole/konsole.cpp
@@ -8,48 +8,49 @@
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>
32#include <opie2/odebug.h>
32using namespace Opie; 33using namespace Opie;
33#endif 34#endif
34 35
35#include <qpe/resource.h> 36#include <qpe/resource.h>
36 37
37#include <qmenubar.h> 38#include <qmenubar.h>
38#include <qtabbar.h> 39#include <qtabbar.h>
39#include <qpe/config.h> 40#include <qpe/config.h>
40#include <qfontdatabase.h> 41#include <qfontdatabase.h>
41#include <qfile.h> 42#include <qfile.h>
42#include <qspinbox.h> 43#include <qspinbox.h>
43#include <qlayout.h> 44#include <qlayout.h>
44 45
45#include <sys/wait.h> 46#include <sys/wait.h>
46#include <stdio.h> 47#include <stdio.h>
47#include <stdlib.h> 48#include <stdlib.h>
48#include <assert.h> 49#include <assert.h>
49 50
50#include "konsole.h" 51#include "konsole.h"
51#include "commandeditdialog.h" 52#include "commandeditdialog.h"
52 53
53class EKNumTabBar : public QTabBar 54class EKNumTabBar : public QTabBar
54{ 55{
55public: 56public:
@@ -183,126 +184,126 @@ static const char *commonCmds[] =
183 "dd", 184 "dd",
184 "df", 185 "df",
185 "dmesg", 186 "dmesg",
186 "fuser", 187 "fuser",
187 "hostname", 188 "hostname",
188 "kill", 189 "kill",
189 "killall", 190 "killall",
190 "ln", 191 "ln",
191 "ping", 192 "ping",
192 "mount", 193 "mount",
193 "more", 194 "more",
194 "sort", 195 "sort",
195 "touch", 196 "touch",
196 "umount", 197 "umount",
197 "mknod", 198 "mknod",
198 "netstat", 199 "netstat",
199 */ 200 */
200 201
201 "exit", 202 "exit",
202 NULL 203 NULL
203 }; 204 };
204 205
205 206
206static void konsoleInit(const char** shell) { 207static void konsoleInit(const char** shell) {
207 if(setuid(getuid()) !=0) qDebug("setuid failed"); 208 if(setuid(getuid()) !=0) odebug << "setuid failed" << oendl;
208 if(setgid(getgid()) != 0) qDebug("setgid failed"); // drop privileges 209 if(setgid(getgid()) != 0) odebug << "setgid failed" << oendl; // drop privileges
209 210
210 211
211// QPEApplication::grabKeyboard(); // for CTRL and ALT 212// QPEApplication::grabKeyboard(); // for CTRL and ALT
212 213
213 qDebug("keyboard grabbed"); 214 odebug << "keyboard grabbed" << oendl;
214#ifdef FAKE_CTRL_AND_ALT 215#ifdef FAKE_CTRL_AND_ALT
215 qDebug("Fake Ctrl and Alt defined"); 216 odebug << "Fake Ctrl and Alt defined" << oendl;
216 QPEApplication::grabKeyboard(); // for CTRL and ALT 217 QPEApplication::grabKeyboard(); // for CTRL and ALT
217#endif 218#endif
218 219
219 *shell = getenv("SHELL"); 220 *shell = getenv("SHELL");
220 qWarning("SHell initially is %s", *shell ); 221 owarn << "SHell initially is " << *shell << "" << oendl;
221 222
222 if (shell == NULL || *shell == '\0') { 223 if (shell == NULL || *shell == '\0') {
223 struct passwd *ent = 0; 224 struct passwd *ent = 0;
224 uid_t me = getuid(); 225 uid_t me = getuid();
225 *shell = "/bin/sh"; 226 *shell = "/bin/sh";
226 227
227 while ( (ent = getpwent()) != 0 ) { 228 while ( (ent = getpwent()) != 0 ) {
228 if (ent->pw_uid == me) { 229 if (ent->pw_uid == me) {
229 if (ent->pw_shell != "") 230 if (ent->pw_shell != "")
230 *shell = ent->pw_shell; 231 *shell = ent->pw_shell;
231 break; 232 break;
232 } 233 }
233 } 234 }
234 endpwent(); 235 endpwent();
235 } 236 }
236 237
237 if( putenv((char*)"COLORTERM=") !=0) 238 if( putenv((char*)"COLORTERM=") !=0)
238 qDebug("putenv failed"); // to trigger mc's color detection 239 odebug << "putenv failed" << oendl; // to trigger mc's color detection
239} 240}
240 241
241 242
242Konsole::Konsole(QWidget* parent, const char* name, WFlags fl) : 243Konsole::Konsole(QWidget* parent, const char* name, WFlags fl) :
243 QMainWindow(parent, name, fl) 244 QMainWindow(parent, name, fl)
244{ 245{
245 QStrList tmp; const char* shell; 246 QStrList tmp; const char* shell;
246 247
247 konsoleInit( &shell); 248 konsoleInit( &shell);
248 init(shell,tmp); 249 init(shell,tmp);
249} 250}
250 251
251Konsole::Konsole(const char* name, const char* _pgm, QStrList & _args, int) 252Konsole::Konsole(const char* name, const char* _pgm, QStrList & _args, int)
252 : QMainWindow(0, name) 253 : QMainWindow(0, name)
253{ 254{
254 init(_pgm,_args); 255 init(_pgm,_args);
255} 256}
256 257
257struct HistoryItem 258struct HistoryItem
258{ 259{
259 HistoryItem(int c, const QString &l) 260 HistoryItem(int c, const QString &l)
260 { 261 {
261 count = c; 262 count = c;
262 line = l; 263 line = l;
263 } 264 }
264 int count; 265 int count;
265 QString line; 266 QString line;
266}; 267};
267 268
268class HistoryList : public QList<HistoryItem> 269class HistoryList : public QList<HistoryItem>
269{ 270{
270 virtual int compareItems( QCollection::Item item1, QCollection::Item item2) 271 virtual int compareItems( QCollection::Item item1, QCollection::Item item2)
271 { 272 {
272 int c1 = ((HistoryItem*)item1)->count; 273 int c1 = ((HistoryItem*)item1)->count;
273 int c2 = ((HistoryItem*)item2)->count; 274 int c2 = ((HistoryItem*)item2)->count;
274 if (c1 > c2) 275 if (c1 > c2)
275 return(1); 276 return(1);
276 if (c1 < c2) 277 if (c1 < c2)
277 return(-1); 278 return(-1);
278 return(0); 279 return(0);
279 } 280 }
280}; 281};
281 282
282void Konsole::initCommandList() 283void Konsole::initCommandList()
283{ 284{
284 // qDebug("Konsole::initCommandList"); 285 // odebug << "Konsole::initCommandList" << oendl;
285 Config cfg( "Konsole" ); 286 Config cfg( "Konsole" );
286 cfg.setGroup("Commands"); 287 cfg.setGroup("Commands");
287 // commonCombo->setInsertionPolicy(QComboBox::AtCurrent); 288 // commonCombo->setInsertionPolicy(QComboBox::AtCurrent);
288 commonCombo->clear(); 289 commonCombo->clear();
289 290
290 if (cfg.readEntry("ShellHistory","TRUE") == "TRUE") 291 if (cfg.readEntry("ShellHistory","TRUE") == "TRUE")
291 { 292 {
292 QString histfilename = QString(getenv("HOME")) + "/.bash_history"; 293 QString histfilename = QString(getenv("HOME")) + "/.bash_history";
293 histfilename = cfg.readEntry("ShellHistoryPath",histfilename); 294 histfilename = cfg.readEntry("ShellHistoryPath",histfilename);
294 QFile histfile(histfilename); 295 QFile histfile(histfilename);
295 // note: compiler barfed on: 296 // note: compiler barfed on:
296 // QFile histfile(QString(getenv("HOME")) + "/.bash_history"); 297 // QFile histfile(QString(getenv("HOME")) + "/.bash_history");
297 if (histfile.open( IO_ReadOnly )) 298 if (histfile.open( IO_ReadOnly ))
298 { 299 {
299 QString line; 300 QString line;
300 uint i; 301 uint i;
301 HistoryList items; 302 HistoryList items;
302 303
303 int lineno = 0; 304 int lineno = 0;
304 while(!histfile.atEnd()) 305 while(!histfile.atEnd())
305 { 306 {
306 if (histfile.readLine(line, 200) < 0) 307 if (histfile.readLine(line, 200) < 0)
307 { 308 {
308 break; 309 break;
@@ -492,49 +493,49 @@ void Konsole::init(const char* _pgm, QStrList & _args)
492 } 493 }
493 494
494 if (cfont < 0 || cfont >= (int)fonts.count()) 495 if (cfont < 0 || cfont >= (int)fonts.count())
495 { 496 {
496 cfont = 0; 497 cfont = 0;
497 } 498 }
498 499
499 // create terminal emulation framework //////////////////////////////////// 500 // create terminal emulation framework ////////////////////////////////////
500 nsessions = 0; 501 nsessions = 0;
501 502
502 tab = new EKNumTabWidget(this); 503 tab = new EKNumTabWidget(this);
503 // tab->setMargin(tab->margin()-5); 504 // tab->setMargin(tab->margin()-5);
504 connect(tab, SIGNAL(currentChanged(QWidget*)), this, SLOT(switchSession(QWidget*))); 505 connect(tab, SIGNAL(currentChanged(QWidget*)), this, SLOT(switchSession(QWidget*)));
505 506
506 // create terminal toolbar //////////////////////////////////////////////// 507 // create terminal toolbar ////////////////////////////////////////////////
507 setToolBarsMovable( FALSE ); 508 setToolBarsMovable( FALSE );
508 menuToolBar = new QToolBar( this ); 509 menuToolBar = new QToolBar( this );
509 menuToolBar->setHorizontalStretchable( TRUE ); 510 menuToolBar->setHorizontalStretchable( TRUE );
510 511
511 QMenuBar *menuBar = new QMenuBar( menuToolBar ); 512 QMenuBar *menuBar = new QMenuBar( menuToolBar );
512 513
513 setFont(cfont); 514 setFont(cfont);
514 515
515 configMenu = new QPopupMenu( this); 516 configMenu = new QPopupMenu( this);
516 colorMenu = new QPopupMenu( this); 517 colorMenu = new QPopupMenu( this);
517 scrollMenu = new QPopupMenu( this); 518 scrollMenu = new QPopupMenu( this);
518 editCommandListMenu = new QPopupMenu( this); 519 editCommandListMenu = new QPopupMenu( this);
519 520
520 configMenu->insertItem(tr("Command List"), editCommandListMenu); 521 configMenu->insertItem(tr("Command List"), editCommandListMenu);
521 522
522 bool listHidden; 523 bool listHidden;
523 cfg.setGroup("Menubar"); 524 cfg.setGroup("Menubar");
524 if( cfg.readEntry("Hidden","FALSE") == "TRUE") 525 if( cfg.readEntry("Hidden","FALSE") == "TRUE")
525 { 526 {
526 ec_cmdlist = editCommandListMenu->insertItem( tr( "Show command list" )); 527 ec_cmdlist = editCommandListMenu->insertItem( tr( "Show command list" ));
527 listHidden=TRUE; 528 listHidden=TRUE;
528 } 529 }
529 else 530 else
530 { 531 {
531 ec_cmdlist = editCommandListMenu->insertItem( tr( "Hide command list" )); 532 ec_cmdlist = editCommandListMenu->insertItem( tr( "Hide command list" ));
532 listHidden=FALSE; 533 listHidden=FALSE;
533 } 534 }
534 535
535 cfg.setGroup("Tabs"); 536 cfg.setGroup("Tabs");
536 537
537 tabMenu = new QPopupMenu(this); 538 tabMenu = new QPopupMenu(this);
538 tm_bottom = tabMenu->insertItem(tr("Bottom" )); 539 tm_bottom = tabMenu->insertItem(tr("Bottom" ));
539 tm_top = tabMenu->insertItem(tr("Top")); 540 tm_top = tabMenu->insertItem(tr("Top"));
540 tm_hidden = tabMenu->insertItem(tr("Hidden")); 541 tm_hidden = tabMenu->insertItem(tr("Hidden"));
@@ -1046,97 +1047,97 @@ void Konsole::hitDown()
1046 needed for the internal widget to be 1047 needed for the internal widget to be
1047 */ 1048 */
1048QSize Konsole::calcSize(int columns, int lines) 1049QSize Konsole::calcSize(int columns, int lines)
1049{ 1050{
1050 TEWidget* te = getTe(); 1051 TEWidget* te = getTe();
1051 if (te != 0) 1052 if (te != 0)
1052 { 1053 {
1053 QSize size = te->calcSize(columns, lines); 1054 QSize size = te->calcSize(columns, lines);
1054 return size; 1055 return size;
1055 } 1056 }
1056 else 1057 else
1057 { 1058 {
1058 QSize size; 1059 QSize size;
1059 return size; 1060 return size;
1060 } 1061 }
1061} 1062}
1062 1063
1063/** 1064/**
1064 sets application window to a size based on columns X lines of the te 1065 sets application window to a size based on columns X lines of the te
1065 guest widget. Call with (0,0) for setting default size. 1066 guest widget. Call with (0,0) for setting default size.
1066*/ 1067*/
1067 1068
1068void Konsole::setColLin(int columns, int lines) 1069void Konsole::setColLin(int columns, int lines)
1069{ 1070{
1070 qDebug("konsole::setColLin:: Columns %d", columns); 1071 odebug << "konsole::setColLin:: Columns " << columns << "" << oendl;
1071 1072
1072 if ((columns==0) || (lines==0)) 1073 if ((columns==0) || (lines==0))
1073 { 1074 {
1074 if (defaultSize.isEmpty()) // not in config file : set default value 1075 if (defaultSize.isEmpty()) // not in config file : set default value
1075 { 1076 {
1076 defaultSize = calcSize(80,24); 1077 defaultSize = calcSize(80,24);
1077 // notifySize(24,80); // set menu items (strange arg order !) 1078 // notifySize(24,80); // set menu items (strange arg order !)
1078 } 1079 }
1079 resize(defaultSize); 1080 resize(defaultSize);
1080 } 1081 }
1081 else 1082 else
1082 { 1083 {
1083 resize(calcSize(columns, lines)); 1084 resize(calcSize(columns, lines));
1084 // notifySize(lines,columns); // set menu items (strange arg order !) 1085 // notifySize(lines,columns); // set menu items (strange arg order !)
1085 } 1086 }
1086} 1087}
1087 1088
1088/* 1089/*
1089void Konsole::setFont(int fontno) 1090void Konsole::setFont(int fontno)
1090{ 1091{
1091 QFont f; 1092 QFont f;
1092 if (fontno == 0) 1093 if (fontno == 0)
1093 f = defaultFont = QFont( "Helvetica", 12 ); 1094 f = defaultFont = QFont( "Helvetica", 12 );
1094 else 1095 else
1095 if (fonts[fontno][0] == '-') 1096 if (fonts[fontno][0] == '-')
1096 f.setRawName( fonts[fontno] ); 1097 f.setRawName( fonts[fontno] );
1097 else 1098 else
1098 { 1099 {
1099 f.setFamily(fonts[fontno]); 1100 f.setFamily(fonts[fontno]);
1100 f.setRawMode( TRUE ); 1101 f.setRawMode( TRUE );
1101 } 1102 }
1102 if ( !f.exactMatch() && fontno != 0) 1103 if ( !f.exactMatch() && fontno != 0)
1103 { 1104 {
1104 QString msg = i18n("Font `%1' not found.\nCheck README.linux.console for help.").arg(fonts[fontno]); 1105 QString msg = i18n("Font `%1' not found.\nCheck README.linux.console for help.").arg(fonts[fontno]);
1105 QMessageBox(this, msg); 1106 QMessageBox(this, msg);
1106 return; 1107 return;
1107 } 1108 }
1108 if (se) se->setFontNo(fontno); 1109 if (se) se->setFontNo(fontno);
1109 te->setVTFont(f); 1110 te->setVTFont(f);
1110 n_font = fontno; 1111 n_font = fontno;
1111} 1112}
1112*/ 1113*/
1113 1114
1114// --| color selection |------------------------------------------------------- 1115// --| color selection |-------------------------------------------------------
1115 1116
1116void Konsole::changeColumns(int /*columns*/) 1117void Konsole::changeColumns(int /*columns*/)
1117{ //FIXME this seems to cause silliness when reset command is executed 1118{ //FIXME this seems to cause silliness when reset command is executed
1118 // qDebug("change columns"); 1119 // odebug << "change columns" << oendl;
1119 // TEWidget* te = getTe(); 1120 // TEWidget* te = getTe();
1120 // if (te != 0) { 1121 // if (te != 0) {
1121 // setColLin(columns,te->Lines()); 1122 // setColLin(columns,te->Lines());
1122 // te->update(); 1123 // te->update();
1123 // } 1124 // }
1124} 1125}
1125 1126
1126//FIXME: If a child dies during session swap, 1127//FIXME: If a child dies during session swap,
1127// this routine might be called before 1128// this routine might be called before
1128// session swap is completed. 1129// session swap is completed.
1129 1130
1130void Konsole::doneSession(TEWidget* te, int ) 1131void Konsole::doneSession(TEWidget* te, int )
1131{ 1132{
1132 // TEWidget *te = NULL; 1133 // TEWidget *te = NULL;
1133 // if (sess->currentSession == tab->currentPage()) { 1134 // if (sess->currentSession == tab->currentPage()) {
1134 // printf("done current session\n"); 1135 // printf("done current session\n");
1135 // te = getTe(); 1136 // te = getTe();
1136 // } else { 1137 // } else {
1137 // int currentPage = tab->currentPageIndex(); 1138 // int currentPage = tab->currentPageIndex();
1138 // printf("done not current session\n"); 1139 // printf("done not current session\n");
1139 // for(int i = 0; i < nsessions; i++) { 1140 // for(int i = 0; i < nsessions; i++) {
1140 // tab->setCurrentPage(i); 1141 // tab->setCurrentPage(i);
1141 // printf("find session %d tab page %x session %x\n", 1142 // printf("find session %d tab page %x session %x\n",
1142 // i, tab->currentPage(), sess->currentSession); 1143 // i, tab->currentPage(), sess->currentSession);
@@ -1392,49 +1393,49 @@ void Konsole::setFullScreen ( bool b )
1392 } 1393 }
1393 } 1394 }
1394 tab->setMargin(tab->margin()); // cause setup to run 1395 tab->setMargin(tab->margin()); // cause setup to run
1395} 1396}
1396 1397
1397 1398
1398void Konsole::fullscreenTimeout() 1399void Konsole::fullscreenTimeout()
1399{ 1400{
1400 fullscreen_msg->hide(); 1401 fullscreen_msg->hide();
1401} 1402}
1402 1403
1403void Konsole::colorMenuIsSelected(int iD) 1404void Konsole::colorMenuIsSelected(int iD)
1404{ 1405{
1405 fromMenu = TRUE; 1406 fromMenu = TRUE;
1406 colorMenuSelected(iD); 1407 colorMenuSelected(iD);
1407} 1408}
1408 1409
1409/// ------------------------------- some new stuff by L.J. Potter 1410/// ------------------------------- some new stuff by L.J. Potter
1410 1411
1411 1412
1412void Konsole::colorMenuSelected(int iD) 1413void Konsole::colorMenuSelected(int iD)
1413{ 1414{
1414 // this is NOT pretty, elegant or anything else besides functional 1415 // this is NOT pretty, elegant or anything else besides functional
1415 // QString temp; 1416 // QString temp;
1416 // qDebug( temp.sprintf("colormenu %d", iD)); 1417 // odebug << temp.sprintf("colormenu " << iD) << "" << oendl;
1417 1418
1418 TEWidget* te = getTe(); 1419 TEWidget* te = getTe();
1419 Config cfg( "Konsole" ); 1420 Config cfg( "Konsole" );
1420 cfg.setGroup("Colors"); 1421 cfg.setGroup("Colors");
1421 1422
1422 ColorEntry m_table[TABLE_COLORS]; 1423 ColorEntry m_table[TABLE_COLORS];
1423 const ColorEntry * defaultCt=te->getdefaultColorTable(); 1424 const ColorEntry * defaultCt=te->getdefaultColorTable();
1424 1425
1425 int i; 1426 int i;
1426 1427
1427 // te->color_menu_item = iD; 1428 // te->color_menu_item = iD;
1428 1429
1429 colorMenu->setItemChecked(cm_ab,FALSE); 1430 colorMenu->setItemChecked(cm_ab,FALSE);
1430 colorMenu->setItemChecked(cm_bb,FALSE); 1431 colorMenu->setItemChecked(cm_bb,FALSE);
1431 colorMenu->setItemChecked(cm_wc,FALSE); 1432 colorMenu->setItemChecked(cm_wc,FALSE);
1432 colorMenu->setItemChecked(cm_cw,FALSE); 1433 colorMenu->setItemChecked(cm_cw,FALSE);
1433 colorMenu->setItemChecked(cm_mb,FALSE); 1434 colorMenu->setItemChecked(cm_mb,FALSE);
1434 colorMenu->setItemChecked(cm_bm,FALSE); 1435 colorMenu->setItemChecked(cm_bm,FALSE);
1435 colorMenu->setItemChecked(cm_gy,FALSE); 1436 colorMenu->setItemChecked(cm_gy,FALSE);
1436 colorMenu->setItemChecked(cm_rb,FALSE); 1437 colorMenu->setItemChecked(cm_rb,FALSE);
1437 colorMenu->setItemChecked(cm_br,FALSE); 1438 colorMenu->setItemChecked(cm_br,FALSE);
1438 colorMenu->setItemChecked(cm_wb,FALSE); 1439 colorMenu->setItemChecked(cm_wb,FALSE);
1439 colorMenu->setItemChecked(cm_bw,FALSE); 1440 colorMenu->setItemChecked(cm_bw,FALSE);
1440 colorMenu->setItemChecked(cm_gb,FALSE); 1441 colorMenu->setItemChecked(cm_gb,FALSE);
@@ -1508,49 +1509,49 @@ void Konsole::colorMenuSelected(int iD)
1508 colorMenu->setItemChecked(cm_cw,TRUE); 1509 colorMenu->setItemChecked(cm_cw,TRUE);
1509 } 1510 }
1510 if(iD==cm_wc) 1511 if(iD==cm_wc)
1511 {// White, Cyan 1512 {// White, Cyan
1512 background.setRgb(8,91,129); 1513 background.setRgb(8,91,129);
1513 foreground.setRgb(0xFF,0xFF,0xFF); 1514 foreground.setRgb(0xFF,0xFF,0xFF);
1514 colorMenu->setItemChecked(cm_wc,TRUE); 1515 colorMenu->setItemChecked(cm_wc,TRUE);
1515 } 1516 }
1516 if(iD==cm_bb) 1517 if(iD==cm_bb)
1517 {// Black, Blue 1518 {// Black, Blue
1518 background.setRgb(0x00,0x00,0x00); 1519 background.setRgb(0x00,0x00,0x00);
1519 foreground.setRgb(127,147,225); 1520 foreground.setRgb(127,147,225);
1520 colorMenu->setItemChecked(cm_bb,TRUE); 1521 colorMenu->setItemChecked(cm_bb,TRUE);
1521 } 1522 }
1522 if(iD==cm_ab) 1523 if(iD==cm_ab)
1523 {// Black, Gold 1524 {// Black, Gold
1524 background.setRgb(0x00,0x00,0x00); 1525 background.setRgb(0x00,0x00,0x00);
1525 foreground.setRgb(255,215,105); 1526 foreground.setRgb(255,215,105);
1526 colorMenu->setItemChecked(cm_ab,TRUE); 1527 colorMenu->setItemChecked(cm_ab,TRUE);
1527 } 1528 }
1528#ifdef QT_QWS_OPIE 1529#ifdef QT_QWS_OPIE
1529 if(iD==-19) 1530 if(iD==-19)
1530 { 1531 {
1531 // Custom 1532 // Custom
1532 qDebug("do custom"); 1533 odebug << "do custom" << oendl;
1533 if(fromMenu) 1534 if(fromMenu)
1534 { 1535 {
1535 Opie::OColorPopupMenu* penColorPopupMenu = new Opie::OColorPopupMenu(Qt::black, this, "foreground color"); 1536 Opie::OColorPopupMenu* penColorPopupMenu = new Opie::OColorPopupMenu(Qt::black, this, "foreground color");
1536 connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, 1537 connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this,
1537 SLOT(changeForegroundColor(const QColor&))); 1538 SLOT(changeForegroundColor(const QColor&)));
1538 penColorPopupMenu->exec(); 1539 penColorPopupMenu->exec();
1539 } 1540 }
1540 if(!fromMenu) 1541 if(!fromMenu)
1541 { 1542 {
1542 foreground.setNamedColor(cfg.readEntry("foreground","")); 1543 foreground.setNamedColor(cfg.readEntry("foreground",""));
1543 background.setNamedColor(cfg.readEntry("background","")); 1544 background.setNamedColor(cfg.readEntry("background",""));
1544 } 1545 }
1545 fromMenu=FALSE; 1546 fromMenu=FALSE;
1546 colorMenu->setItemChecked(-19,TRUE); 1547 colorMenu->setItemChecked(-19,TRUE);
1547 } 1548 }
1548#endif 1549#endif
1549 1550
1550 lastSelectedMenu = iD; 1551 lastSelectedMenu = iD;
1551 1552
1552 setColors(foreground, background); 1553 setColors(foreground, background);
1553 1554
1554 QTabBar *tabBar = tab->getTabBar(); 1555 QTabBar *tabBar = tab->getTabBar();
1555 QString ss = QString("Session%1").arg(tabBar->currentTab()); 1556 QString ss = QString("Session%1").arg(tabBar->currentTab());
1556 // printf("current tab = %d\n", tabBar->currentTab()); 1557 // printf("current tab = %d\n", tabBar->currentTab());
@@ -1613,49 +1614,49 @@ void Konsole::tabMenuSelected(int id)
1613 } 1614 }
1614 else if (id == tm_top) 1615 else if (id == tm_top)
1615 { 1616 {
1616 printf("set top tab\n"); 1617 printf("set top tab\n");
1617 tab->getTabBar()->show(); 1618 tab->getTabBar()->show();
1618 tab->setTabPosition(QTabWidget::Bottom); 1619 tab->setTabPosition(QTabWidget::Bottom);
1619 tab->setTabPosition(QTabWidget::Top); 1620 tab->setTabPosition(QTabWidget::Top);
1620 tab->getTabBar()->show(); 1621 tab->getTabBar()->show();
1621 cfg.writeEntry("Position","Top"); 1622 cfg.writeEntry("Position","Top");
1622 } 1623 }
1623 else if (id == tm_hidden) 1624 else if (id == tm_hidden)
1624 { 1625 {
1625 tab->getTabBar()->hide(); 1626 tab->getTabBar()->hide();
1626 tab->setMargin(tab->margin()); 1627 tab->setMargin(tab->margin());
1627 cfg.writeEntry("Position","Hidden"); 1628 cfg.writeEntry("Position","Hidden");
1628 } 1629 }
1629 tabMenu->setItemChecked(id, true); 1630 tabMenu->setItemChecked(id, true);
1630 tabPos = id; 1631 tabPos = id;
1631} 1632}
1632 1633
1633 1634
1634void Konsole::configMenuSelected(int iD) 1635void Konsole::configMenuSelected(int iD)
1635{ 1636{
1636 // QString temp; 1637 // QString temp;
1637 // qDebug( temp.sprintf("configmenu %d",iD)); 1638 // odebug << temp.sprintf("configmenu " << iD) << "" << oendl;
1638 1639
1639 TEWidget* te = getTe(); 1640 TEWidget* te = getTe();
1640 Config cfg( "Konsole" ); 1641 Config cfg( "Konsole" );
1641 cfg.setGroup("Menubar"); 1642 cfg.setGroup("Menubar");
1642 if(iD == cm_wrap) 1643 if(iD == cm_wrap)
1643 { 1644 {
1644 cfg.setGroup("ScrollBar"); 1645 cfg.setGroup("ScrollBar");
1645 bool b=cfg.readBoolEntry("HorzScroll",0); 1646 bool b=cfg.readBoolEntry("HorzScroll",0);
1646 b=!b; 1647 b=!b;
1647 cfg.writeEntry("HorzScroll", b ); 1648 cfg.writeEntry("HorzScroll", b );
1648 cfg.write(); 1649 cfg.write();
1649 doWrap(); 1650 doWrap();
1650 if(cfg.readNumEntry("Position",2) == 0) 1651 if(cfg.readNumEntry("Position",2) == 0)
1651 { 1652 {
1652 te->setScrollbarLocation(1); 1653 te->setScrollbarLocation(1);
1653 } 1654 }
1654 else 1655 else
1655 { 1656 {
1656 te->setScrollbarLocation(0); 1657 te->setScrollbarLocation(0);
1657 } 1658 }
1658 te->setScrollbarLocation( cfg.readNumEntry("Position",2)); 1659 te->setScrollbarLocation( cfg.readNumEntry("Position",2));
1659 } 1660 }
1660 if(iD == cm_beep) 1661 if(iD == cm_beep)
1661 { 1662 {
@@ -1683,134 +1684,134 @@ void Konsole::changeCommand(const QString &text, int c)
1683 1684
1684void Konsole::setColor(int sess) 1685void Konsole::setColor(int sess)
1685{ 1686{
1686 Config cfg( "Konsole" ); 1687 Config cfg( "Konsole" );
1687 cfg.setGroup("Colors"); 1688 cfg.setGroup("Colors");
1688 QColor foreground, background; 1689 QColor foreground, background;
1689 QString ss = QString("Session") + QString::number(sess); 1690 QString ss = QString("Session") + QString::number(sess);
1690 foreground.setRgb(cfg.readNumEntry("foregroundRed"+ss, 1691 foreground.setRgb(cfg.readNumEntry("foregroundRed"+ss,
1691 cfg.readNumEntry("foregroundRed",0xff)), 1692 cfg.readNumEntry("foregroundRed",0xff)),
1692 cfg.readNumEntry("foregroundGreen"+ss, 1693 cfg.readNumEntry("foregroundGreen"+ss,
1693 cfg.readNumEntry("foregroundGreen",0xff)), 1694 cfg.readNumEntry("foregroundGreen",0xff)),
1694 cfg.readNumEntry("foregroundBlue"+ss, 1695 cfg.readNumEntry("foregroundBlue"+ss,
1695 cfg.readNumEntry("foregroundBlue",0xff))); 1696 cfg.readNumEntry("foregroundBlue",0xff)));
1696 background.setRgb(cfg.readNumEntry("backgroundRed"+ss, 1697 background.setRgb(cfg.readNumEntry("backgroundRed"+ss,
1697 cfg.readNumEntry("backgroundRed",0)), 1698 cfg.readNumEntry("backgroundRed",0)),
1698 cfg.readNumEntry("backgroundGreen"+ss, 1699 cfg.readNumEntry("backgroundGreen"+ss,
1699 cfg.readNumEntry("backgroundGreen",0)), 1700 cfg.readNumEntry("backgroundGreen",0)),
1700 cfg.readNumEntry("backgroundBlue"+ss, 1701 cfg.readNumEntry("backgroundBlue"+ss,
1701 cfg.readNumEntry("backgroundBlue",0))); 1702 cfg.readNumEntry("backgroundBlue",0)));
1702 setColors(foreground, background); 1703 setColors(foreground, background);
1703} 1704}
1704 1705
1705void Konsole::scrollMenuSelected(int index) 1706void Konsole::scrollMenuSelected(int index)
1706{ 1707{
1707 // qDebug( "scrollbar menu %d",index); 1708 // odebug << "scrollbar menu " << index << "" << oendl;
1708 1709
1709 TEWidget* te = getTe(); 1710 TEWidget* te = getTe();
1710 Config cfg( "Konsole" ); 1711 Config cfg( "Konsole" );
1711 cfg.setGroup("ScrollBar"); 1712 cfg.setGroup("ScrollBar");
1712 1713
1713 if(index == sm_none) 1714 if(index == sm_none)
1714 { 1715 {
1715 te->setScrollbarLocation(0); 1716 te->setScrollbarLocation(0);
1716 cfg.writeEntry("Position",0); 1717 cfg.writeEntry("Position",0);
1717 } 1718 }
1718 else if(index == sm_left) 1719 else if(index == sm_left)
1719 { 1720 {
1720 te->setScrollbarLocation(1); 1721 te->setScrollbarLocation(1);
1721 cfg.writeEntry("Position",1); 1722 cfg.writeEntry("Position",1);
1722 } 1723 }
1723 else if(index == sm_right) 1724 else if(index == sm_right)
1724 { 1725 {
1725 te->setScrollbarLocation(2); 1726 te->setScrollbarLocation(2);
1726 cfg.writeEntry("Position",2); 1727 cfg.writeEntry("Position",2);
1727 } 1728 }
1728 scrollMenu->setItemChecked(sm_none, index == sm_none); 1729 scrollMenu->setItemChecked(sm_none, index == sm_none);
1729 scrollMenu->setItemChecked(sm_left, index == sm_left); 1730 scrollMenu->setItemChecked(sm_left, index == sm_left);
1730 scrollMenu->setItemChecked(sm_right, index == sm_right); 1731 scrollMenu->setItemChecked(sm_right, index == sm_right);
1731} 1732}
1732 1733
1733// case -29: { 1734// case -29: {
1734// bool b=cfg.readBoolEntry("HorzScroll",0); 1735// bool b=cfg.readBoolEntry("HorzScroll",0);
1735// cfg.writeEntry("HorzScroll", !b ); 1736// cfg.writeEntry("HorzScroll", !b );
1736// cfg.write(); 1737// cfg.write();
1737// if(cfg.readNumEntry("Position",2) == 0) { 1738// if(cfg.readNumEntry("Position",2) == 0) {
1738// te->setScrollbarLocation(1); 1739// te->setScrollbarLocation(1);
1739// te->setWrapAt(0); 1740// te->setWrapAt(0);
1740// } else { 1741// } else {
1741// te->setScrollbarLocation(0); 1742// te->setScrollbarLocation(0);
1742// te->setWrapAt(120); 1743// te->setWrapAt(120);
1743// } 1744// }
1744// te->setScrollbarLocation( cfg.readNumEntry("Position",2)); 1745// te->setScrollbarLocation( cfg.readNumEntry("Position",2));
1745// } 1746// }
1746// break; 1747// break;
1747 1748
1748void Konsole::editCommandListMenuSelected(int iD) 1749void Konsole::editCommandListMenuSelected(int iD)
1749{ 1750{
1750 // QString temp; 1751 // QString temp;
1751 // qDebug( temp.sprintf("edit command list %d",iD)); 1752 // odebug << temp.sprintf("edit command list " << iD) << "" << oendl;
1752 1753
1753 // FIXME: more cleanup needed here 1754 // FIXME: more cleanup needed here
1754 1755
1755 1756
1756 TEWidget* te = getTe(); 1757 TEWidget* te = getTe();
1757 Config cfg( "Konsole" ); 1758 Config cfg( "Konsole" );
1758 cfg.setGroup("Menubar"); 1759 cfg.setGroup("Menubar");
1759 if( iD == ec_cmdlist) 1760 if( iD == ec_cmdlist)
1760 { 1761 {
1761 if(!secondToolBar->isHidden()) 1762 if(!secondToolBar->isHidden())
1762 { 1763 {
1763 secondToolBar->hide(); 1764 secondToolBar->hide();
1764 configMenu->changeItem( iD,tr( "Show Command List" )); 1765 configMenu->changeItem( iD,tr( "Show Command List" ));
1765 cfg.writeEntry("Hidden","TRUE"); 1766 cfg.writeEntry("Hidden","TRUE");
1766 configMenu->setItemEnabled(ec_edit ,FALSE); 1767 configMenu->setItemEnabled(ec_edit ,FALSE);
1767 configMenu->setItemEnabled(ec_quick ,FALSE); 1768 configMenu->setItemEnabled(ec_quick ,FALSE);
1768 } 1769 }
1769 else 1770 else
1770 { 1771 {
1771 secondToolBar->show(); 1772 secondToolBar->show();
1772 configMenu->changeItem( iD,tr( "Hide Command List" )); 1773 configMenu->changeItem( iD,tr( "Hide Command List" ));
1773 cfg.writeEntry("Hidden","FALSE"); 1774 cfg.writeEntry("Hidden","FALSE");
1774 configMenu->setItemEnabled(ec_edit ,TRUE); 1775 configMenu->setItemEnabled(ec_edit ,TRUE);
1775 configMenu->setItemEnabled(ec_quick ,TRUE); 1776 configMenu->setItemEnabled(ec_quick ,TRUE);
1776 1777
1777 if(cfg.readEntry("EditEnabled","FALSE")=="TRUE") 1778 if(cfg.readEntry("EditEnabled","FALSE")=="TRUE")
1778 { 1779 {
1779 configMenu->setItemChecked(ec_edit,TRUE); 1780 configMenu->setItemChecked(ec_edit,TRUE);
1780 commonCombo->setEditable( TRUE ); 1781 commonCombo->setEditable( TRUE );
1781 } 1782 }
1782 else 1783 else
1783 { 1784 {
1784 configMenu->setItemChecked(ec_edit,FALSE); 1785 configMenu->setItemChecked(ec_edit,FALSE);
1785 commonCombo->setEditable( FALSE ); 1786 commonCombo->setEditable( FALSE );
1786 } 1787 }
1787 } 1788 }
1788 } 1789 }
1789 if( iD == ec_quick) 1790 if( iD == ec_quick)
1790 { 1791 {
1791 cfg.setGroup("Commands"); 1792 cfg.setGroup("Commands");
1792 // qDebug("enableCommandEdit"); 1793 // odebug << "enableCommandEdit" << oendl;
1793 if( !configMenu->isItemChecked(iD) ) 1794 if( !configMenu->isItemChecked(iD) )
1794 { 1795 {
1795 commonCombo->setEditable( TRUE ); 1796 commonCombo->setEditable( TRUE );
1796 configMenu->setItemChecked(iD,TRUE); 1797 configMenu->setItemChecked(iD,TRUE);
1797 commonCombo->setCurrentItem(0); 1798 commonCombo->setCurrentItem(0);
1798 cfg.writeEntry("EditEnabled","TRUE"); 1799 cfg.writeEntry("EditEnabled","TRUE");
1799 } 1800 }
1800 else 1801 else
1801 { 1802 {
1802 commonCombo->setEditable( FALSE ); 1803 commonCombo->setEditable( FALSE );
1803 configMenu->setItemChecked(iD,FALSE); 1804 configMenu->setItemChecked(iD,FALSE);
1804 cfg.writeEntry("EditEnabled","FALSE"); 1805 cfg.writeEntry("EditEnabled","FALSE");
1805 commonCombo->setFocusPolicy(QWidget::NoFocus); 1806 commonCombo->setFocusPolicy(QWidget::NoFocus);
1806 te->setFocus(); 1807 te->setFocus();
1807 } 1808 }
1808 } 1809 }
1809 if(iD == ec_edit) 1810 if(iD == ec_edit)
1810 { 1811 {
1811 // "edit commands" 1812 // "edit commands"
1812 CommandEditDialog *m = new CommandEditDialog(this); 1813 CommandEditDialog *m = new CommandEditDialog(this);
1813 connect(m,SIGNAL(commandsEdited()),this,SLOT(initCommandList())); 1814 connect(m,SIGNAL(commandsEdited()),this,SLOT(initCommandList()));
1814 m->showMaximized(); 1815 m->showMaximized();
1815 } 1816 }
1816 1817
@@ -1856,68 +1857,68 @@ void Konsole::parseCommandLine()
1856 if( QString(qApp->argv()[i]) == "-e") 1857 if( QString(qApp->argv()[i]) == "-e")
1857 { 1858 {
1858 i++; 1859 i++;
1859 for ( int j=i;j< qApp->argc();j++) 1860 for ( int j=i;j< qApp->argc();j++)
1860 { 1861 {
1861 cmd+=QString(qApp->argv()[j])+" "; 1862 cmd+=QString(qApp->argv()[j])+" ";
1862 } 1863 }
1863 cmd.stripWhiteSpace(); 1864 cmd.stripWhiteSpace();
1864 system(cmd.latin1()); 1865 system(cmd.latin1());
1865 exit(0);//close(); 1866 exit(0);//close();
1866 } // end -e switch 1867 } // end -e switch
1867 } 1868 }
1868 startUp++; 1869 startUp++;
1869} 1870}
1870 1871
1871void Konsole::changeForegroundColor(const QColor &color) 1872void Konsole::changeForegroundColor(const QColor &color)
1872{ 1873{
1873 Config cfg( "Konsole" ); 1874 Config cfg( "Konsole" );
1874 cfg.setGroup("Colors"); 1875 cfg.setGroup("Colors");
1875 int r, g, b; 1876 int r, g, b;
1876 color.rgb(&r,&g,&b); 1877 color.rgb(&r,&g,&b);
1877 foreground.setRgb(r,g,b); 1878 foreground.setRgb(r,g,b);
1878 1879
1879 cfg.writeEntry("foreground",color.name()); 1880 cfg.writeEntry("foreground",color.name());
1880 qDebug("foreground "+color.name()); 1881 odebug << "foreground "+color.name() << oendl;
1881 cfg.write(); 1882 cfg.write();
1882 1883
1883 qDebug("do other dialog"); 1884 odebug << "do other dialog" << oendl;
1884#ifdef QT_QWS_OPIE 1885#ifdef QT_QWS_OPIE
1885 1886
1886 Opie::OColorPopupMenu* penColorPopupMenu2 = new Opie::OColorPopupMenu(Qt::black, this,"background color"); 1887 Opie::OColorPopupMenu* penColorPopupMenu2 = new Opie::OColorPopupMenu(Qt::black, this,"background color");
1887 connect(penColorPopupMenu2, SIGNAL(colorSelected(const QColor&)), this, 1888 connect(penColorPopupMenu2, SIGNAL(colorSelected(const QColor&)), this,
1888 SLOT(changeBackgroundColor(const QColor&))); 1889 SLOT(changeBackgroundColor(const QColor&)));
1889 penColorPopupMenu2->exec(); 1890 penColorPopupMenu2->exec();
1890#endif 1891#endif
1891} 1892}
1892 1893
1893void Konsole::changeBackgroundColor(const QColor &color) 1894void Konsole::changeBackgroundColor(const QColor &color)
1894{ 1895{
1895 1896
1896 qDebug("Change background"); 1897 odebug << "Change background" << oendl;
1897 Config cfg( "Konsole" ); 1898 Config cfg( "Konsole" );
1898 cfg.setGroup("Colors"); 1899 cfg.setGroup("Colors");
1899 int r, g, b; 1900 int r, g, b;
1900 color.rgb(&r,&g,&b); 1901 color.rgb(&r,&g,&b);
1901 background.setRgb(r,g,b); 1902 background.setRgb(r,g,b);
1902 cfg.writeEntry("background",color.name()); 1903 cfg.writeEntry("background",color.name());
1903 qDebug("background "+color.name()); 1904 odebug << "background "+color.name() << oendl;
1904 cfg.write(); 1905 cfg.write();
1905} 1906}
1906 1907
1907void Konsole::doWrap() 1908void Konsole::doWrap()
1908{ 1909{
1909 Config cfg( "Konsole" ); 1910 Config cfg( "Konsole" );
1910 cfg.setGroup("ScrollBar"); 1911 cfg.setGroup("ScrollBar");
1911 TEWidget* te = getTe(); 1912 TEWidget* te = getTe();
1912 if( !cfg.readBoolEntry("HorzScroll",0)) 1913 if( !cfg.readBoolEntry("HorzScroll",0))
1913 { 1914 {
1914 te->setWrapAt(0); 1915 te->setWrapAt(0);
1915 configMenu->setItemChecked( cm_wrap,TRUE); 1916 configMenu->setItemChecked( cm_wrap,TRUE);
1916 } 1917 }
1917 else 1918 else
1918 { 1919 {
1919 // te->setWrapAt(90); 1920 // te->setWrapAt(90);
1920 te->setWrapAt(120); 1921 te->setWrapAt(120);
1921 configMenu->setItemChecked( cm_wrap,FALSE); 1922 configMenu->setItemChecked( cm_wrap,FALSE);
1922 } 1923 }
1923} 1924}
diff --git a/core/apps/embeddedkonsole/main.cpp b/core/apps/embeddedkonsole/main.cpp
index b851d3e..131e782 100644
--- a/core/apps/embeddedkonsole/main.cpp
+++ b/core/apps/embeddedkonsole/main.cpp
@@ -24,62 +24,62 @@
24#ifdef QT_QWS_OPIE 24#ifdef QT_QWS_OPIE
25 25
26#include <opie2/oapplicationfactory.h> 26#include <opie2/oapplicationfactory.h>
27 27
28/* --| main |------------------------------------------------------ */ 28/* --| main |------------------------------------------------------ */
29using namespace Opie::Core; 29using namespace Opie::Core;
30OPIE_EXPORT_APP( OApplicationFactory<Konsole> ) 30OPIE_EXPORT_APP( OApplicationFactory<Konsole> )
31 31
32#else //for non opie builds 32#else //for non opie builds
33 33
34#include <qpe/qpeapplication.h> 34#include <qpe/qpeapplication.h>
35 35
36#include <qfile.h> 36#include <qfile.h>
37 37
38#include <unistd.h> 38#include <unistd.h>
39#include <stdio.h> 39#include <stdio.h>
40#include <stdlib.h> 40#include <stdlib.h>
41 41
42#include <pwd.h> 42#include <pwd.h>
43#include <sys/types.h> 43#include <sys/types.h>
44 44
45 45
46/* --| main |------------------------------------------------------ */ 46/* --| main |------------------------------------------------------ */
47 int main(int argc, char* argv[]) { 47 int main(int argc, char* argv[]) {
48 if(setuid(getuid()) !=0) qDebug("setuid failed"); 48 if(setuid(getuid()) !=0) odebug << "setuid failed" << oendl;
49 if(setgid(getgid()) != 0) qDebug("setgid failed"); // drop privileges 49 if(setgid(getgid()) != 0) odebug << "setgid failed" << oendl; // drop privileges
50 50
51 QPEApplication a( argc, argv ); 51 QPEApplication a( argc, argv );
52#ifdef FAKE_CTRL_AND_ALT 52#ifdef FAKE_CTRL_AND_ALT
53 qDebug("Fake Ctrl and Alt defined"); 53 odebug << "Fake Ctrl and Alt defined" << oendl;
54 QPEApplication::grabKeyboard(); // for CTRL and ALT 54 QPEApplication::grabKeyboard(); // for CTRL and ALT
55#endif 55#endif
56 56
57 QStrList tmp; 57 QStrList tmp;
58 const char* shell = getenv("SHELL"); 58 const char* shell = getenv("SHELL");
59 59
60 if (shell == NULL || *shell == '\0') { 60 if (shell == NULL || *shell == '\0') {
61 struct passwd *ent = 0; 61 struct passwd *ent = 0;
62 uid_t me = getuid(); 62 uid_t me = getuid();
63 shell = "/bin/sh"; 63 shell = "/bin/sh";
64 64
65 while ( (ent = getpwent()) != 0 ) { 65 while ( (ent = getpwent()) != 0 ) {
66 if (ent->pw_uid == me) { 66 if (ent->pw_uid == me) {
67 if (ent->pw_shell != "") 67 if (ent->pw_shell != "")
68 shell = ent->pw_shell; 68 shell = ent->pw_shell;
69 break; 69 break;
70 } 70 }
71 } 71 }
72 endpwent(); 72 endpwent();
73 } 73 }
74 74
75 if( putenv((char*)"COLORTERM=") !=0) 75 if( putenv((char*)"COLORTERM=") !=0)
76 qDebug("putenv failed"); // to trigger mc's color detection 76 odebug << "putenv failed" << oendl; // to trigger mc's color detection
77 77
78 Konsole m( "test", shell, tmp, TRUE ); 78 Konsole m( "test", shell, tmp, TRUE );
79 m.setCaption( Konsole::tr("Terminal") ); 79 m.setCaption( Konsole::tr("Terminal") );
80 a.showMainWidget( &m ); 80 a.showMainWidget( &m );
81 81
82 return a.exec(); 82 return a.exec();
83} 83}
84 84
85#endif 85#endif
diff --git a/core/apps/embeddedkonsole/playlistselection.cpp b/core/apps/embeddedkonsole/playlistselection.cpp
index fc5330f..096d36a 100644
--- a/core/apps/embeddedkonsole/playlistselection.cpp
+++ b/core/apps/embeddedkonsole/playlistselection.cpp
@@ -1,51 +1,54 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#include <qheader.h>
21 20
22#include "playlistselection.h" 21#include "playlistselection.h"
23 22
24#include <stdlib.h> 23/* OPIE */
25 24#include <opie2/odebug.h>
26 25
26/* Qt */
27#include <qheader.h>
27 28
29/* STD */
30#include <stdlib.h>
28 31
29 32
30PlayListSelection::PlayListSelection( QWidget *parent, const char *name ) 33PlayListSelection::PlayListSelection( QWidget *parent, const char *name )
31 : QListView( parent, name ) 34 : QListView( parent, name )
32{ 35{
33 setAllColumnsShowFocus( TRUE ); 36 setAllColumnsShowFocus( TRUE );
34 addColumn( tr( "Command Selection" ) ); 37 addColumn( tr( "Command Selection" ) );
35 header()->hide(); 38 header()->hide();
36 setSorting( -1, FALSE ); 39 setSorting( -1, FALSE );
37} 40}
38 41
39 42
40PlayListSelection::~PlayListSelection() { 43PlayListSelection::~PlayListSelection() {
41} 44}
42 45
43 46
44 47
45void PlayListSelection::contentsMouseMoveEvent( QMouseEvent *event ) { 48void PlayListSelection::contentsMouseMoveEvent( QMouseEvent *event ) {
46 if ( event->state() == QMouseEvent::LeftButton ) { 49 if ( event->state() == QMouseEvent::LeftButton ) {
47 QListViewItem *currentItem = selectedItem(); 50 QListViewItem *currentItem = selectedItem();
48 QListViewItem *itemUnder = itemAt( QPoint( event->pos().x(), event->pos().y() - contentsY() ) ); 51 QListViewItem *itemUnder = itemAt( QPoint( event->pos().x(), event->pos().y() - contentsY() ) );
49 if ( currentItem && currentItem->itemAbove() == itemUnder ) 52 if ( currentItem && currentItem->itemAbove() == itemUnder )
50 moveSelectedUp(); 53 moveSelectedUp();
51 else if ( currentItem && currentItem->itemBelow() == itemUnder ) 54 else if ( currentItem && currentItem->itemBelow() == itemUnder )
@@ -60,49 +63,49 @@ const QString *PlayListSelection::current() {
60 return item->file(); 63 return item->file();
61 return NULL; 64 return NULL;
62} 65}
63 66
64 67
65void PlayListSelection::addToSelection( QListViewItem *lnk ) { 68void PlayListSelection::addToSelection( QListViewItem *lnk ) {
66PlayListSelectionItem *item = new PlayListSelectionItem( this, new QString( lnk->text(0) ) ); 69PlayListSelectionItem *item = new PlayListSelectionItem( this, new QString( lnk->text(0) ) );
67 QListViewItem *current = selectedItem(); 70 QListViewItem *current = selectedItem();
68 if ( current ) 71 if ( current )
69 item->moveItem( current ); 72 item->moveItem( current );
70 setSelected( item, TRUE ); 73 setSelected( item, TRUE );
71 ensureItemVisible( selectedItem() ); 74 ensureItemVisible( selectedItem() );
72} 75}
73 76
74void PlayListSelection::addStringToSelection (const QString & lnk) { 77void PlayListSelection::addStringToSelection (const QString & lnk) {
75 PlayListSelectionItem *item = new PlayListSelectionItem( this, new QString( lnk ) ); 78 PlayListSelectionItem *item = new PlayListSelectionItem( this, new QString( lnk ) );
76 QListViewItem *current = selectedItem(); 79 QListViewItem *current = selectedItem();
77 if ( current ) 80 if ( current )
78 item->moveItem( current ); 81 item->moveItem( current );
79 setSelected( item, TRUE ); 82 setSelected( item, TRUE );
80 ensureItemVisible( selectedItem() ); 83 ensureItemVisible( selectedItem() );
81 84
82} 85}
83void PlayListSelection::removeSelected() { 86void PlayListSelection::removeSelected() {
84 qDebug("removeSelected()"); 87 odebug << "removeSelected()" << oendl;
85 QListViewItem *item = selectedItem(); 88 QListViewItem *item = selectedItem();
86 if ( item ) 89 if ( item )
87 delete item; 90 delete item;
88 setSelected( currentItem(), TRUE ); 91 setSelected( currentItem(), TRUE );
89 ensureItemVisible( selectedItem() ); 92 ensureItemVisible( selectedItem() );
90} 93}
91 94
92 95
93void PlayListSelection::moveSelectedUp() { 96void PlayListSelection::moveSelectedUp() {
94 QListViewItem *item = selectedItem(); 97 QListViewItem *item = selectedItem();
95 if ( item && item->itemAbove() ) 98 if ( item && item->itemAbove() )
96 item->itemAbove()->moveItem( item ); 99 item->itemAbove()->moveItem( item );
97 ensureItemVisible( selectedItem() ); 100 ensureItemVisible( selectedItem() );
98} 101}
99 102
100 103
101void PlayListSelection::moveSelectedDown() { 104void PlayListSelection::moveSelectedDown() {
102 QListViewItem *item = selectedItem(); 105 QListViewItem *item = selectedItem();
103 if ( item && item->itemBelow() ) 106 if ( item && item->itemBelow() )
104 item->moveItem( item->itemBelow() ); 107 item->moveItem( item->itemBelow() );
105 ensureItemVisible( selectedItem() ); 108 ensureItemVisible( selectedItem() );
106} 109}
107 110
108 111