author | mickeyl <mickeyl> | 2004-02-25 11:27:48 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-02-25 11:27:48 (UTC) |
commit | 25e87d9ccc92b7a4c12518532576f55b11726b26 (patch) (unidiff) | |
tree | 39c21854f8b6845736126a05f2cc89e552484881 | |
parent | 50aef52b265bc8c8e5e5c6a871affe94142d74fb (diff) | |
download | opie-25e87d9ccc92b7a4c12518532576f55b11726b26.zip opie-25e87d9ccc92b7a4c12518532576f55b11726b26.tar.gz opie-25e87d9ccc92b7a4c12518532576f55b11726b26.tar.bz2 |
fix most of zecke's comments. Someone should look into the open issues though
(see mail to opie-devel)
-rw-r--r-- | core/apps/embeddedkonsole/MyPty.cpp | 7 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/konsole.cpp | 21 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/konsole.h | 6 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/session.h | 2 |
4 files changed, 17 insertions, 19 deletions
diff --git a/core/apps/embeddedkonsole/MyPty.cpp b/core/apps/embeddedkonsole/MyPty.cpp index e7d8274..5a8519a 100644 --- a/core/apps/embeddedkonsole/MyPty.cpp +++ b/core/apps/embeddedkonsole/MyPty.cpp | |||
@@ -78,9 +78,8 @@ | |||
78 | #include <sys/types.h> | 78 | #include <sys/types.h> |
79 | #include <sys/ioctl.h> | 79 | #include <sys/ioctl.h> |
80 | #include <sys/wait.h> | 80 | #include <sys/wait.h> |
81 | 81 | ||
82 | #undef HAVE_OPENPTY | ||
83 | #ifdef HAVE_OPENPTY | 82 | #ifdef HAVE_OPENPTY |
84 | #include <pty.h> | 83 | #include <pty.h> |
85 | #endif | 84 | #endif |
86 | 85 | ||
@@ -259,14 +258,14 @@ void MyPty::send_bytes(const char* s, int len) | |||
259 | printf("%c", s[i]); | 258 | printf("%c", s[i]); |
260 | printf("\n"); | 259 | printf("\n"); |
261 | #endif | 260 | #endif |
262 | 261 | ||
263 | ::write(fd, s, len); | 262 | ::write(fd, s, len); |
264 | } | 263 | } |
265 | 264 | ||
266 | /*! indicates that a block of data is received */ | 265 | /*! indicates that a block of data is received */ |
267 | void MyPty::readPty() | 266 | void MyPty::readPty() |
268 | { | 267 | { |
269 | char buf[4096]; | 268 | char buf[4096]; |
270 | 269 | ||
271 | int len = ::read( fd, buf, 4096 ); | 270 | int len = ::read( fd, buf, 4096 ); |
272 | 271 | ||
@@ -276,9 +275,9 @@ void MyPty::readPty() | |||
276 | if (len < 0) | 275 | if (len < 0) |
277 | return; | 276 | return; |
278 | 277 | ||
279 | emit block_in(buf,len); | 278 | emit block_in(buf,len); |
280 | 279 | ||
281 | #ifdef VERBOSE_DEBUG | 280 | #ifdef VERBOSE_DEBUG |
282 | // verbose debug | 281 | // verbose debug |
283 | printf("read bytes:\n"); | 282 | printf("read bytes:\n"); |
284 | for (int i = 0; i < len; i++) | 283 | for (int i = 0; i < len; i++) |
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp index b8f009d..1c613a9 100644 --- a/core/apps/embeddedkonsole/konsole.cpp +++ b/core/apps/embeddedkonsole/konsole.cpp | |||
@@ -20,9 +20,8 @@ | |||
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 | //#define QT_QWS_OPIE | ||
25 | 24 | ||
26 | #include <stdlib.h> | 25 | #include <stdlib.h> |
27 | 26 | ||
28 | #ifdef QT_QWS_OPIE | 27 | #ifdef QT_QWS_OPIE |
@@ -368,10 +367,10 @@ void Konsole::init(const char* _pgm, QStrList & _args) | |||
368 | startUp=0; | 367 | startUp=0; |
369 | fromMenu = FALSE; | 368 | fromMenu = FALSE; |
370 | fullscreen = false; | 369 | fullscreen = false; |
371 | 370 | ||
372 | setCaption( "Konsole" ); | 371 | setCaption( tr( "Konsole" ) ); |
373 | setIcon( Resource::loadPixmap( "qkonsole/qkonsole" ) ); | 372 | setIcon( Resource::loadPixmap( "konsole/Terminal" ) ); |
374 | 373 | ||
375 | Config cfg( "Konsole" ); | 374 | Config cfg( "Konsole" ); |
376 | cfg.setGroup("Font"); | 375 | cfg.setGroup("Font"); |
377 | QString tmp; | 376 | QString tmp; |
@@ -576,9 +575,9 @@ void Konsole::init(const char* _pgm, QStrList & _args) | |||
576 | 575 | ||
577 | configMenu->insertItem(tr( "Colors") ,colorMenu); | 576 | configMenu->insertItem(tr( "Colors") ,colorMenu); |
578 | 577 | ||
579 | sessionList = new QPopupMenu(this); | 578 | sessionList = new QPopupMenu(this); |
580 | sessionList-> insertItem ( Resource::loadPixmap ( "qkonsole/qkonsole" ), tr( "new session" ), this, | 579 | sessionList-> insertItem ( Resource::loadPixmap ( "konsole/Terminal" ), tr( "new session" ), this, |
581 | SLOT(newSession()) ); | 580 | SLOT(newSession()) ); |
582 | 581 | ||
583 | // connect( fontList, SIGNAL( activated(int) ), this, SLOT( fontChanged(int) )); | 582 | // connect( fontList, SIGNAL( activated(int) ), this, SLOT( fontChanged(int) )); |
584 | connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) )); | 583 | connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) )); |
@@ -878,9 +877,9 @@ void Konsole::changeFontSize(int delta) | |||
878 | setFont(closest_font); | 877 | setFont(closest_font); |
879 | } | 878 | } |
880 | } | 879 | } |
881 | 880 | ||
882 | int Konsole::findFont(QString name, int size, bool exactMatch) | 881 | int Konsole::findFont(const QString& name, int size, bool exactMatch) |
883 | { | 882 | { |
884 | for(uint i = 0; i < fonts.count(); i++) | 883 | for(uint i = 0; i < fonts.count(); i++) |
885 | { | 884 | { |
886 | if (fonts.at(i)->getName() == name | 885 | if (fonts.at(i)->getName() == name |
@@ -1158,13 +1157,13 @@ void Konsole::doneSession(TEWidget* te, int ) | |||
1158 | close(); | 1157 | close(); |
1159 | } | 1158 | } |
1160 | } | 1159 | } |
1161 | 1160 | ||
1162 | void Konsole::changeTitle(TEWidget* te, QString newTitle ) | 1161 | void Konsole::changeTitle(TEWidget* te, const QString& newTitle ) |
1163 | { | 1162 | { |
1164 | if (te == getTe()) | 1163 | if (te == getTe()) |
1165 | { | 1164 | { |
1166 | setCaption(newTitle + " - QKonsole"); | 1165 | setCaption( newTitle + " - " + tr( "Konsole " ) ); |
1167 | } | 1166 | } |
1168 | } | 1167 | } |
1169 | 1168 | ||
1170 | 1169 | ||
@@ -1199,10 +1198,10 @@ void Konsole::newSession() | |||
1199 | tab->addTab(te); | 1198 | tab->addTab(te); |
1200 | TESession* se = new TESession(this, te, se_pgm, se_args, "xterm"); | 1199 | TESession* se = new TESession(this, te, se_pgm, se_args, "xterm"); |
1201 | te->currentSession = se; | 1200 | te->currentSession = se; |
1202 | connect( se, SIGNAL(done(TEWidget*,int)), this, SLOT(doneSession(TEWidget*,int)) ); | 1201 | connect( se, SIGNAL(done(TEWidget*,int)), this, SLOT(doneSession(TEWidget*,int)) ); |
1203 | connect( se, SIGNAL(changeTitle(TEWidget*,QString)), this, | 1202 | connect( se, SIGNAL(changeTitle(TEWidget*,const QString&)), this, |
1204 | SLOT(changeTitle(TEWidget*,QString)) ); | 1203 | SLOT(changeTitle(TEWidget*,const QString&)) ); |
1205 | connect(te, SIGNAL(changeFontSize(int)), this, SLOT(changeFontSize(int))); | 1204 | connect(te, SIGNAL(changeFontSize(int)), this, SLOT(changeFontSize(int))); |
1206 | connect(te, SIGNAL(changeSession(int)), this, SLOT(changeSession(int))); | 1205 | connect(te, SIGNAL(changeSession(int)), this, SLOT(changeSession(int))); |
1207 | connect(te, SIGNAL(newSession()), this, SLOT(newSession())); | 1206 | connect(te, SIGNAL(newSession()), this, SLOT(newSession())); |
1208 | connect(te, SIGNAL(toggleFullScreen()), this, SLOT(toggleFullScreen())); | 1207 | connect(te, SIGNAL(toggleFullScreen()), this, SLOT(toggleFullScreen())); |
@@ -1308,13 +1307,13 @@ void Konsole::switchSession(QWidget* w) | |||
1308 | fontList->setItemChecked(i + 1000, i == familyNum); | 1307 | fontList->setItemChecked(i + 1000, i == familyNum); |
1309 | } | 1308 | } |
1310 | if (! te->currentSession->Title().isEmpty() ) | 1309 | if (! te->currentSession->Title().isEmpty() ) |
1311 | { | 1310 | { |
1312 | setCaption(te->currentSession->Title() + " - QKonsole"); | 1311 | setCaption( te->currentSession->Title() + " - " + tr( "Konsole" ) ); |
1313 | } | 1312 | } |
1314 | else | 1313 | else |
1315 | { | 1314 | { |
1316 | setCaption( "Konsole" ); | 1315 | setCaption( tr( "Konsole" ) ); |
1317 | } | 1316 | } |
1318 | // colorMenuSelected(te->color_menu_item); | 1317 | // colorMenuSelected(te->color_menu_item); |
1319 | } | 1318 | } |
1320 | 1319 | ||
diff --git a/core/apps/embeddedkonsole/konsole.h b/core/apps/embeddedkonsole/konsole.h index 37babbb..e163cb8 100644 --- a/core/apps/embeddedkonsole/konsole.h +++ b/core/apps/embeddedkonsole/konsole.h | |||
@@ -72,9 +72,9 @@ public slots: | |||
72 | 72 | ||
73 | private slots: | 73 | private slots: |
74 | void setDocument(const QString &); | 74 | void setDocument(const QString &); |
75 | void doneSession(TEWidget*,int); | 75 | void doneSession(TEWidget*,int); |
76 | void changeTitle(TEWidget*,QString); | 76 | void changeTitle(TEWidget*, const QString&); |
77 | void changeColumns(int); | 77 | void changeColumns(int); |
78 | void setFont(int); | 78 | void setFont(int); |
79 | // void fontChanged(int); | 79 | // void fontChanged(int); |
80 | void configMenuSelected(int ); | 80 | void configMenuSelected(int ); |
@@ -109,9 +109,9 @@ private: | |||
109 | void runSession(TESession* s); | 109 | void runSession(TESession* s); |
110 | void setColorPixmaps(); | 110 | void setColorPixmaps(); |
111 | void setHistory(bool); | 111 | void setHistory(bool); |
112 | void setColors(QColor foreground, QColor background); | 112 | void setColors(QColor foreground, QColor background); |
113 | int findFont(QString name, int size, bool exact = false); | 113 | int findFont(const QString& name, int size, bool exact = false); |
114 | QSize calcSize(int columns, int lines); | 114 | QSize calcSize(int columns, int lines); |
115 | TEWidget* getTe(); | 115 | TEWidget* getTe(); |
116 | QStringList commands; | 116 | QStringList commands; |
117 | QLabel * msgLabel; | 117 | QLabel * msgLabel; |
@@ -123,9 +123,9 @@ private: | |||
123 | private: | 123 | private: |
124 | class VTFont | 124 | class VTFont |
125 | { | 125 | { |
126 | public: | 126 | public: |
127 | VTFont(QString name, QFont& font, QString family, int familyNum, int size) | 127 | VTFont(const QString& name, QFont& font, const QString& family, int familyNum, int size) |
128 | { | 128 | { |
129 | this->name = name; | 129 | this->name = name; |
130 | this->font = font; | 130 | this->font = font; |
131 | this->family = family; | 131 | this->family = family; |
diff --git a/core/apps/embeddedkonsole/session.h b/core/apps/embeddedkonsole/session.h index f399e96..a4b33e2 100644 --- a/core/apps/embeddedkonsole/session.h +++ b/core/apps/embeddedkonsole/session.h | |||
@@ -67,9 +67,9 @@ public slots: | |||
67 | 67 | ||
68 | signals: | 68 | signals: |
69 | 69 | ||
70 | void done(TEWidget*, int); | 70 | void done(TEWidget*, int); |
71 | void changeTitle(TEWidget*, QString); | 71 | void changeTitle(TEWidget*, const QString&); |
72 | 72 | ||
73 | private: | 73 | private: |
74 | 74 | ||
75 | // TEPty* sh; | 75 | // TEPty* sh; |