-rwxr-xr-x | core/apps/embeddedkonsole/embeddedkonsole.pro | 1 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/konsole.cpp | 21 |
2 files changed, 13 insertions, 9 deletions
diff --git a/core/apps/embeddedkonsole/embeddedkonsole.pro b/core/apps/embeddedkonsole/embeddedkonsole.pro index bfa16a2..913cb89 100755 --- a/core/apps/embeddedkonsole/embeddedkonsole.pro +++ b/core/apps/embeddedkonsole/embeddedkonsole.pro | |||
@@ -25,24 +25,25 @@ SOURCES = TEScreen.cpp \ | |||
25 | keytrans.cpp \ | 25 | keytrans.cpp \ |
26 | konsole.cpp \ | 26 | konsole.cpp \ |
27 | commandeditdialog.cpp \ | 27 | commandeditdialog.cpp \ |
28 | commandeditwidget.cpp \ | 28 | commandeditwidget.cpp \ |
29 | playlistselection.cpp \ | 29 | playlistselection.cpp \ |
30 | MyPty.cpp \ | 30 | MyPty.cpp \ |
31 | main.cpp | 31 | main.cpp |
32 | INTERFACES = commandeditdialogbase.ui smallcommandeditdialogbase.ui | 32 | INTERFACES = commandeditdialogbase.ui smallcommandeditdialogbase.ui |
33 | TARGET = embeddedkonsole | 33 | TARGET = embeddedkonsole |
34 | INCLUDEPATH += $(OPIEDIR)/include | 34 | INCLUDEPATH += $(OPIEDIR)/include |
35 | DEPENDPATH += $(OPIEDIR)/include | 35 | DEPENDPATH += $(OPIEDIR)/include |
36 | LIBS += -lqpe -lopie | 36 | LIBS += -lqpe -lopie |
37 | TMAKE_CXXFLAGS += -DQT_QWS_OPIE | ||
37 | 38 | ||
38 | TRANSLATIONS = ../../../i18n/de/embeddedkonsole.ts \ | 39 | TRANSLATIONS = ../../../i18n/de/embeddedkonsole.ts \ |
39 | ../../../i18n/en/embeddedkonsole.ts \ | 40 | ../../../i18n/en/embeddedkonsole.ts \ |
40 | ../../../i18n/es/embeddedkonsole.ts \ | 41 | ../../../i18n/es/embeddedkonsole.ts \ |
41 | ../../../i18n/fr/embeddedkonsole.ts \ | 42 | ../../../i18n/fr/embeddedkonsole.ts \ |
42 | ../../../i18n/hu/embeddedkonsole.ts \ | 43 | ../../../i18n/hu/embeddedkonsole.ts \ |
43 | ../../../i18n/ja/embeddedkonsole.ts \ | 44 | ../../../i18n/ja/embeddedkonsole.ts \ |
44 | ../../../i18n/ko/embeddedkonsole.ts \ | 45 | ../../../i18n/ko/embeddedkonsole.ts \ |
45 | ../../../i18n/no/embeddedkonsole.ts \ | 46 | ../../../i18n/no/embeddedkonsole.ts \ |
46 | ../../../i18n/pl/embeddedkonsole.ts \ | 47 | ../../../i18n/pl/embeddedkonsole.ts \ |
47 | ../../../i18n/pt/embeddedkonsole.ts \ | 48 | ../../../i18n/pt/embeddedkonsole.ts \ |
48 | ../../../i18n/pt_BR/embeddedkonsole.ts \ | 49 | ../../../i18n/pt_BR/embeddedkonsole.ts \ |
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp index ebff05e..4480fe2 100644 --- a/core/apps/embeddedkonsole/konsole.cpp +++ b/core/apps/embeddedkonsole/konsole.cpp | |||
@@ -10,25 +10,25 @@ | |||
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 QWS_QT_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 <qpe/qpetoolbar.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> |
@@ -46,25 +46,25 @@ | |||
46 | #include <qstringlist.h> | 46 | #include <qstringlist.h> |
47 | #include <qpalette.h> | 47 | #include <qpalette.h> |
48 | 48 | ||
49 | #include <sys/wait.h> | 49 | #include <sys/wait.h> |
50 | #include <stdio.h> | 50 | #include <stdio.h> |
51 | #include <stdlib.h> | 51 | #include <stdlib.h> |
52 | #include <assert.h> | 52 | #include <assert.h> |
53 | 53 | ||
54 | #include "konsole.h" | 54 | #include "konsole.h" |
55 | #include "keytrans.h" | 55 | #include "keytrans.h" |
56 | #include "commandeditdialog.h" | 56 | #include "commandeditdialog.h" |
57 | 57 | ||
58 | #ifdef QWS_QT_OPIE | 58 | #ifdef QT_QWS_OPIE |
59 | #include <opie/colorpopupmenu.h> | 59 | #include <opie/colorpopupmenu.h> |
60 | #endif | 60 | #endif |
61 | 61 | ||
62 | class EKNumTabBar : public QTabBar { | 62 | class EKNumTabBar : public QTabBar { |
63 | public: | 63 | public: |
64 | void numberTabs() | 64 | void numberTabs() |
65 | { | 65 | { |
66 | // Yes, it really is this messy. QTabWidget needs functions | 66 | // Yes, it really is this messy. QTabWidget needs functions |
67 | // that provide acces to tabs in a sequential way. | 67 | // that provide acces to tabs in a sequential way. |
68 | int m=INT_MIN; | 68 | int m=INT_MIN; |
69 | for (int i=0; i<count(); i++) { | 69 | for (int i=0; i<count(); i++) { |
70 | QTab* left=0; | 70 | QTab* left=0; |
@@ -287,25 +287,25 @@ void Konsole::init(const char* _pgm, QStrList & _args) | |||
287 | colorMenu->insertItem(tr( "White on Black")); | 287 | colorMenu->insertItem(tr( "White on Black")); |
288 | colorMenu->insertItem(tr( "Black on Transparent")); | 288 | colorMenu->insertItem(tr( "Black on Transparent")); |
289 | colorMenu->insertItem(tr( "Black on Red")); | 289 | colorMenu->insertItem(tr( "Black on Red")); |
290 | colorMenu->insertItem(tr( "Red on Black")); | 290 | colorMenu->insertItem(tr( "Red on Black")); |
291 | colorMenu->insertItem(tr( "Green on Yellow")); | 291 | colorMenu->insertItem(tr( "Green on Yellow")); |
292 | colorMenu->insertItem(tr( "Blue on Magenta")); | 292 | colorMenu->insertItem(tr( "Blue on Magenta")); |
293 | colorMenu->insertItem(tr( "Magenta on Blue")); | 293 | colorMenu->insertItem(tr( "Magenta on Blue")); |
294 | colorMenu->insertItem(tr( "Cyan on White")); | 294 | colorMenu->insertItem(tr( "Cyan on White")); |
295 | colorMenu->insertItem(tr( "White on Cyan")); | 295 | colorMenu->insertItem(tr( "White on Cyan")); |
296 | colorMenu->insertItem(tr( "Blue on Black")); | 296 | colorMenu->insertItem(tr( "Blue on Black")); |
297 | colorMenu->insertItem(tr( "Amber on Black")); | 297 | colorMenu->insertItem(tr( "Amber on Black")); |
298 | 298 | ||
299 | #ifdef QWS_QT_OPIE | 299 | #ifdef QT_QWS_OPIE |
300 | colorMenu->insertItem(tr( "Custom")); | 300 | colorMenu->insertItem(tr( "Custom")); |
301 | #endif | 301 | #endif |
302 | 302 | ||
303 | configMenu->insertItem(tr( "Colors") ,colorMenu); | 303 | configMenu->insertItem(tr( "Colors") ,colorMenu); |
304 | 304 | ||
305 | connect( fontList, SIGNAL( activated(int) ), this, SLOT( fontChanged(int) )); | 305 | connect( fontList, SIGNAL( activated(int) ), this, SLOT( fontChanged(int) )); |
306 | connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) )); | 306 | connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) )); |
307 | connect( colorMenu, SIGNAL( activated(int) ), this, SLOT( colorMenuIsSelected(int) )); | 307 | connect( colorMenu, SIGNAL( activated(int) ), this, SLOT( colorMenuIsSelected(int) )); |
308 | connect( scrollMenu, SIGNAL(activated(int)),this,SLOT(scrollMenuSelected(int))); | 308 | connect( scrollMenu, SIGNAL(activated(int)),this,SLOT(scrollMenuSelected(int))); |
309 | connect(editCommandListMenu,SIGNAL(activated(int)),this,SLOT(editCommandListMenuSelected(int))); | 309 | connect(editCommandListMenu,SIGNAL(activated(int)),this,SLOT(editCommandListMenuSelected(int))); |
310 | menuBar->insertItem( tr("Font"), fontList ); | 310 | menuBar->insertItem( tr("Font"), fontList ); |
311 | menuBar->insertItem( tr("Options"), configMenu ); | 311 | menuBar->insertItem( tr("Options"), configMenu ); |
@@ -361,26 +361,29 @@ void Konsole::init(const char* _pgm, QStrList & _args) | |||
361 | // } | 361 | // } |
362 | 362 | ||
363 | connect( commonCombo, SIGNAL( activated(int) ), this, SLOT( enterCommand(int) )); | 363 | connect( commonCombo, SIGNAL( activated(int) ), this, SLOT( enterCommand(int) )); |
364 | 364 | ||
365 | scrollMenu->insertItem(tr( "None" )); | 365 | scrollMenu->insertItem(tr( "None" )); |
366 | scrollMenu->insertItem(tr( "Left" )); | 366 | scrollMenu->insertItem(tr( "Left" )); |
367 | scrollMenu->insertItem(tr( "Right" )); | 367 | scrollMenu->insertItem(tr( "Right" )); |
368 | // scrollMenu->insertSeparator(4); | 368 | // scrollMenu->insertSeparator(4); |
369 | // scrollMenu->insertItem(tr( "Horizontal" )); | 369 | // scrollMenu->insertItem(tr( "Horizontal" )); |
370 | 370 | ||
371 | configMenu->insertItem(tr( "ScrollBar" ),scrollMenu); | 371 | configMenu->insertItem(tr( "ScrollBar" ),scrollMenu); |
372 | 372 | ||
373 | configMenu->insertItem(tr( "Wrap" )); | 373 | int jut = configMenu->insertItem(tr( "Wrap" )); |
374 | int jut = configMenu->insertItem(tr( "Use Beep" )); | 374 | cfg.setGroup("ScrollBar"); |
375 | configMenu->setItemChecked(jut, cfg.readBoolEntry("HorzScroll",0)); | ||
376 | |||
377 | jut = configMenu->insertItem(tr( "Use Beep" )); | ||
375 | cfg.setGroup("Menubar"); | 378 | cfg.setGroup("Menubar"); |
376 | configMenu->setItemChecked(jut, cfg.readBoolEntry("useBeep",0)); | 379 | configMenu->setItemChecked(jut, cfg.readBoolEntry("useBeep",0)); |
377 | 380 | ||
378 | 381 | ||
379 | //scrollMenuSelected(-29); | 382 | //scrollMenuSelected(-29); |
380 | // cfg.setGroup("ScrollBar"); | 383 | // cfg.setGroup("ScrollBar"); |
381 | // if(cfg.readBoolEntry("HorzScroll",0)) { | 384 | // if(cfg.readBoolEntry("HorzScroll",0)) { |
382 | // if(cfg.readNumEntry("Position",2) == 0) | 385 | // if(cfg.readNumEntry("Position",2) == 0) |
383 | // te->setScrollbarLocation(1); | 386 | // te->setScrollbarLocation(1); |
384 | // else | 387 | // else |
385 | // te->setScrollbarLocation(0); | 388 | // te->setScrollbarLocation(0); |
386 | // te->setScrollbarLocation( cfg.readNumEntry("Position",2)); | 389 | // te->setScrollbarLocation( cfg.readNumEntry("Position",2)); |
@@ -744,25 +747,25 @@ void Konsole::colorMenuSelected(int iD) | |||
744 | if(iD==-17) {// Black, Blue | 747 | if(iD==-17) {// Black, Blue |
745 | background.setRgb(0x00,0x00,0x00); | 748 | background.setRgb(0x00,0x00,0x00); |
746 | foreground.setRgb(0x18,0xB2,0xB2); | 749 | foreground.setRgb(0x18,0xB2,0xB2); |
747 | cfg.writeEntry("Schema","17"); | 750 | cfg.writeEntry("Schema","17"); |
748 | colorMenu->setItemChecked(-17,TRUE); | 751 | colorMenu->setItemChecked(-17,TRUE); |
749 | } | 752 | } |
750 | if(iD==-18) {// Black, Gold | 753 | if(iD==-18) {// Black, Gold |
751 | background.setRgb(0x00,0x00,0x00); | 754 | background.setRgb(0x00,0x00,0x00); |
752 | foreground.setRgb(255,215,0); | 755 | foreground.setRgb(255,215,0); |
753 | cfg.writeEntry("Schema","18"); | 756 | cfg.writeEntry("Schema","18"); |
754 | colorMenu->setItemChecked(-18,TRUE); | 757 | colorMenu->setItemChecked(-18,TRUE); |
755 | } | 758 | } |
756 | #ifdef QWS_QT_OPIE | 759 | #ifdef QT_QWS_OPIE |
757 | if(iD==-19) { | 760 | if(iD==-19) { |
758 | // Custom | 761 | // Custom |
759 | qDebug("do custom"); | 762 | qDebug("do custom"); |
760 | if(fromMenu) { | 763 | if(fromMenu) { |
761 | ColorPopupMenu* penColorPopupMenu = new ColorPopupMenu(Qt::black, this, "foreground color"); | 764 | ColorPopupMenu* penColorPopupMenu = new ColorPopupMenu(Qt::black, this, "foreground color"); |
762 | connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, | 765 | connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, |
763 | SLOT(changeForegroundColor(const QColor&))); | 766 | SLOT(changeForegroundColor(const QColor&))); |
764 | penColorPopupMenu->exec(); | 767 | penColorPopupMenu->exec(); |
765 | } | 768 | } |
766 | cfg.writeEntry("Schema","19"); | 769 | cfg.writeEntry("Schema","19"); |
767 | if(!fromMenu) { | 770 | if(!fromMenu) { |
768 | foreground.setNamedColor(cfg.readEntry("foreground","")); | 771 | foreground.setNamedColor(cfg.readEntry("foreground","")); |
@@ -788,25 +791,25 @@ void Konsole::colorMenuSelected(int iD) | |||
788 | update(); | 791 | update(); |
789 | 792 | ||
790 | } | 793 | } |
791 | 794 | ||
792 | void Konsole::configMenuSelected(int iD) | 795 | void Konsole::configMenuSelected(int iD) |
793 | { | 796 | { |
794 | // QString temp; | 797 | // QString temp; |
795 | // qDebug( temp.sprintf("configmenu %d",iD)); | 798 | // qDebug( temp.sprintf("configmenu %d",iD)); |
796 | TEWidget* te = getTe(); | 799 | TEWidget* te = getTe(); |
797 | Config cfg("Konsole"); | 800 | Config cfg("Konsole"); |
798 | cfg.setGroup("Menubar"); | 801 | cfg.setGroup("Menubar"); |
799 | int i,j; | 802 | int i,j; |
800 | #ifdef QWS_QT_OPIE | 803 | #ifdef QT_QWS_OPIE |
801 | i=-29;j=-30; | 804 | i=-29;j=-30; |
802 | #else | 805 | #else |
803 | i=-28;j=-29; | 806 | i=-28;j=-29; |
804 | #endif | 807 | #endif |
805 | 808 | ||
806 | if(iD == -4) { | 809 | if(iD == -4) { |
807 | cfg.setGroup("Tabs"); | 810 | cfg.setGroup("Tabs"); |
808 | QString tmp=cfg.readEntry("Position","Bottom"); | 811 | QString tmp=cfg.readEntry("Position","Bottom"); |
809 | 812 | ||
810 | if(tmp=="Top") { | 813 | if(tmp=="Top") { |
811 | tab->setTabPosition(QTabWidget::Bottom); | 814 | tab->setTabPosition(QTabWidget::Bottom); |
812 | configMenu->changeItem( iD,"Tabs on Top"); | 815 | configMenu->changeItem( iD,"Tabs on Top"); |
@@ -991,49 +994,49 @@ void Konsole::parseCommandLine() { | |||
991 | void Konsole::changeForegroundColor(const QColor &color) { | 994 | void Konsole::changeForegroundColor(const QColor &color) { |
992 | Config cfg("Konsole"); | 995 | Config cfg("Konsole"); |
993 | cfg.setGroup("Colors"); | 996 | cfg.setGroup("Colors"); |
994 | int r, g, b; | 997 | int r, g, b; |
995 | color.rgb(&r,&g,&b); | 998 | color.rgb(&r,&g,&b); |
996 | foreground.setRgb(r,g,b); | 999 | foreground.setRgb(r,g,b); |
997 | 1000 | ||
998 | cfg.writeEntry("foreground",color.name()); | 1001 | cfg.writeEntry("foreground",color.name()); |
999 | qDebug("foreground "+color.name()); | 1002 | qDebug("foreground "+color.name()); |
1000 | cfg.write(); | 1003 | cfg.write(); |
1001 | 1004 | ||
1002 | qDebug("do other dialog"); | 1005 | qDebug("do other dialog"); |
1003 | #ifdef QWS_QT_OPIE | 1006 | #ifdef QT_QWS_OPIE |
1004 | 1007 | ||
1005 | ColorPopupMenu* penColorPopupMenu2 = new ColorPopupMenu(Qt::black, this,"background color"); | 1008 | ColorPopupMenu* penColorPopupMenu2 = new ColorPopupMenu(Qt::black, this,"background color"); |
1006 | connect(penColorPopupMenu2, SIGNAL(colorSelected(const QColor&)), this, | 1009 | connect(penColorPopupMenu2, SIGNAL(colorSelected(const QColor&)), this, |
1007 | SLOT(changeBackgroundColor(const QColor&))); | 1010 | SLOT(changeBackgroundColor(const QColor&))); |
1008 | penColorPopupMenu2->exec(); | 1011 | penColorPopupMenu2->exec(); |
1009 | #endif | 1012 | #endif |
1010 | } | 1013 | } |
1011 | 1014 | ||
1012 | void Konsole::changeBackgroundColor(const QColor &color) { | 1015 | void Konsole::changeBackgroundColor(const QColor &color) { |
1013 | 1016 | ||
1014 | qDebug("Change background"); | 1017 | qDebug("Change background"); |
1015 | Config cfg("Konsole"); | 1018 | Config cfg("Konsole"); |
1016 | cfg.setGroup("Colors"); | 1019 | cfg.setGroup("Colors"); |
1017 | int r, g, b; | 1020 | int r, g, b; |
1018 | color.rgb(&r,&g,&b); | 1021 | color.rgb(&r,&g,&b); |
1019 | background.setRgb(r,g,b); | 1022 | background.setRgb(r,g,b); |
1020 | cfg.writeEntry("background",color.name()); | 1023 | cfg.writeEntry("background",color.name()); |
1021 | qDebug("background "+color.name()); | 1024 | qDebug("background "+color.name()); |
1022 | cfg.write(); | 1025 | cfg.write(); |
1023 | } | 1026 | } |
1024 | 1027 | ||
1025 | void Konsole::doWrap() { | 1028 | void Konsole::doWrap() { |
1026 | int i; | 1029 | int i; |
1027 | #ifdef QWS_QT_OPIE | 1030 | #ifdef QT_QWS_OPIE |
1028 | i=-29; | 1031 | i=-29; |
1029 | #else | 1032 | #else |
1030 | i=-28; | 1033 | i=-28; |
1031 | #endif | 1034 | #endif |
1032 | 1035 | ||
1033 | Config cfg("Konsole"); | 1036 | Config cfg("Konsole"); |
1034 | cfg.setGroup("ScrollBar"); | 1037 | cfg.setGroup("ScrollBar"); |
1035 | TEWidget* te = getTe(); | 1038 | TEWidget* te = getTe(); |
1036 | if( !cfg.readBoolEntry("HorzScroll",0)) { | 1039 | if( !cfg.readBoolEntry("HorzScroll",0)) { |
1037 | te->setWrapAt(0); | 1040 | te->setWrapAt(0); |
1038 | configMenu->setItemChecked( i,TRUE); | 1041 | configMenu->setItemChecked( i,TRUE); |
1039 | } else { | 1042 | } else { |