author | zecke <zecke> | 2003-04-13 16:42:26 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-04-13 16:42:26 (UTC) |
commit | 3bd592876c43c11ed44b2f3725d4c7425ebceb09 (patch) (unidiff) | |
tree | 9396bed490c6b167e955977024021650e5509c30 | |
parent | 78d427d8eceac5cb0a92e4f46b7aa3b784d2c214 (diff) | |
download | opie-3bd592876c43c11ed44b2f3725d4c7425ebceb09.zip opie-3bd592876c43c11ed44b2f3725d4c7425ebceb09.tar.gz opie-3bd592876c43c11ed44b2f3725d4c7425ebceb09.tar.bz2 |
make it compile
-rw-r--r-- | core/apps/embeddedkonsole/konsole.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp index 9c1167b..c324c35 100644 --- a/core/apps/embeddedkonsole/konsole.cpp +++ b/core/apps/embeddedkonsole/konsole.cpp | |||
@@ -707,129 +707,129 @@ void Konsole::colorMenuSelected(int iD) | |||
707 | cfg.writeEntry("Schema","8"); | 707 | cfg.writeEntry("Schema","8"); |
708 | colorMenu->setItemChecked(-8,TRUE); | 708 | colorMenu->setItemChecked(-8,TRUE); |
709 | } | 709 | } |
710 | if(iD==-10) {// Black, Red | 710 | if(iD==-10) {// Black, Red |
711 | foreground.setRgb(0x00,0x00,0x00); | 711 | foreground.setRgb(0x00,0x00,0x00); |
712 | background.setRgb(0xB2,0x18,0x18); | 712 | background.setRgb(0xB2,0x18,0x18); |
713 | cfg.writeEntry("Schema","10"); | 713 | cfg.writeEntry("Schema","10"); |
714 | colorMenu->setItemChecked(-10,TRUE); | 714 | colorMenu->setItemChecked(-10,TRUE); |
715 | } | 715 | } |
716 | if(iD==-11) {// Red, Black | 716 | if(iD==-11) {// Red, Black |
717 | foreground.setRgb(230,31,31); //0xB2,0x18,0x18 | 717 | foreground.setRgb(230,31,31); //0xB2,0x18,0x18 |
718 | background.setRgb(0x00,0x00,0x00); | 718 | background.setRgb(0x00,0x00,0x00); |
719 | cfg.writeEntry("Schema","11"); | 719 | cfg.writeEntry("Schema","11"); |
720 | colorMenu->setItemChecked(-11,TRUE); | 720 | colorMenu->setItemChecked(-11,TRUE); |
721 | } | 721 | } |
722 | if(iD==-12) {// Green, Yellow - is ugly | 722 | if(iD==-12) {// Green, Yellow - is ugly |
723 | // foreground.setRgb(0x18,0xB2,0x18); | 723 | // foreground.setRgb(0x18,0xB2,0x18); |
724 | foreground.setRgb(36,139,10); | 724 | foreground.setRgb(36,139,10); |
725 | // background.setRgb(0xB2,0x68,0x18); | 725 | // background.setRgb(0xB2,0x68,0x18); |
726 | background.setRgb(255,255,0); | 726 | background.setRgb(255,255,0); |
727 | cfg.writeEntry("Schema","12"); | 727 | cfg.writeEntry("Schema","12"); |
728 | colorMenu->setItemChecked(-12,TRUE); | 728 | colorMenu->setItemChecked(-12,TRUE); |
729 | } | 729 | } |
730 | if(iD==-13) {// Blue, Magenta | 730 | if(iD==-13) {// Blue, Magenta |
731 | foreground.setRgb(0x18,0xB2,0xB2); | 731 | foreground.setRgb(0x18,0xB2,0xB2); |
732 | background.setRgb(0x18,0x18,0xB2); | 732 | background.setRgb(0x18,0x18,0xB2); |
733 | cfg.writeEntry("Schema","13"); | 733 | cfg.writeEntry("Schema","13"); |
734 | colorMenu->setItemChecked(-13,TRUE); | 734 | colorMenu->setItemChecked(-13,TRUE); |
735 | } | 735 | } |
736 | if(iD==-14) {// Magenta, Blue | 736 | if(iD==-14) {// Magenta, Blue |
737 | foreground.setRgb(0x18,0x18,0xB2); | 737 | foreground.setRgb(0x18,0x18,0xB2); |
738 | background.setRgb(0x18,0xB2,0xB2); | 738 | background.setRgb(0x18,0xB2,0xB2); |
739 | cfg.writeEntry("Schema","14"); | 739 | cfg.writeEntry("Schema","14"); |
740 | colorMenu->setItemChecked(-14,TRUE); | 740 | colorMenu->setItemChecked(-14,TRUE); |
741 | } | 741 | } |
742 | if(iD==-15) {// Cyan, White | 742 | if(iD==-15) {// Cyan, White |
743 | foreground.setRgb(0x18,0xB2,0xB2); | 743 | foreground.setRgb(0x18,0xB2,0xB2); |
744 | background.setRgb(0xFF,0xFF,0xFF); | 744 | background.setRgb(0xFF,0xFF,0xFF); |
745 | cfg.writeEntry("Schema","15"); | 745 | cfg.writeEntry("Schema","15"); |
746 | colorMenu->setItemChecked(-15,TRUE); | 746 | colorMenu->setItemChecked(-15,TRUE); |
747 | } | 747 | } |
748 | if(iD==-16) {// White, Cyan | 748 | if(iD==-16) {// White, Cyan |
749 | background.setRgb(0x18,0xB2,0xB2); | 749 | background.setRgb(0x18,0xB2,0xB2); |
750 | foreground.setRgb(0xFF,0xFF,0xFF); | 750 | foreground.setRgb(0xFF,0xFF,0xFF); |
751 | cfg.writeEntry("Schema","16"); | 751 | cfg.writeEntry("Schema","16"); |
752 | colorMenu->setItemChecked(-16,TRUE); | 752 | colorMenu->setItemChecked(-16,TRUE); |
753 | } | 753 | } |
754 | if(iD==-17) {// Black, Blue | 754 | if(iD==-17) {// Black, Blue |
755 | background.setRgb(0x00,0x00,0x00); | 755 | background.setRgb(0x00,0x00,0x00); |
756 | foreground.setRgb(0x18,0xB2,0xB2); | 756 | foreground.setRgb(0x18,0xB2,0xB2); |
757 | cfg.writeEntry("Schema","17"); | 757 | cfg.writeEntry("Schema","17"); |
758 | colorMenu->setItemChecked(-17,TRUE); | 758 | colorMenu->setItemChecked(-17,TRUE); |
759 | } | 759 | } |
760 | if(iD==-18) {// Black, Gold | 760 | if(iD==-18) {// Black, Gold |
761 | background.setRgb(0x00,0x00,0x00); | 761 | background.setRgb(0x00,0x00,0x00); |
762 | foreground.setRgb(255,215,0); | 762 | foreground.setRgb(255,215,0); |
763 | cfg.writeEntry("Schema","18"); | 763 | cfg.writeEntry("Schema","18"); |
764 | colorMenu->setItemChecked(-18,TRUE); | 764 | colorMenu->setItemChecked(-18,TRUE); |
765 | } | 765 | } |
766 | #ifdef QT_QWS_OPIE | 766 | #ifdef QT_QWS_OPIE |
767 | if(iD==-19) { | 767 | if(iD==-19) { |
768 | // Custom | 768 | // Custom |
769 | qDebug("do custom"); | 769 | qDebug("do custom"); |
770 | if(fromMenu) { | 770 | if(fromMenu) { |
771 | ColorPopupMenu* penColorPopupMenu = new ColorPopupMenu(Qt::black, this, "foreground color"); | 771 | OColorPopupMenu* penColorPopupMenu = new OColorPopupMenu(Qt::black, this, "foreground color"); |
772 | connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, | 772 | connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, |
773 | SLOT(changeForegroundColor(const QColor&))); | 773 | SLOT(changeForegroundColor(const QColor&))); |
774 | penColorPopupMenu->exec(); | 774 | penColorPopupMenu->exec(); |
775 | } | 775 | } |
776 | cfg.writeEntry("Schema","19"); | 776 | cfg.writeEntry("Schema","19"); |
777 | if(!fromMenu) { | 777 | if(!fromMenu) { |
778 | foreground.setNamedColor(cfg.readEntry("foreground","")); | 778 | foreground.setNamedColor(cfg.readEntry("foreground","")); |
779 | background.setNamedColor(cfg.readEntry("background","")); | 779 | background.setNamedColor(cfg.readEntry("background","")); |
780 | } | 780 | } |
781 | fromMenu=FALSE; | 781 | fromMenu=FALSE; |
782 | colorMenu->setItemChecked(-19,TRUE); | 782 | colorMenu->setItemChecked(-19,TRUE); |
783 | } | 783 | } |
784 | #endif | 784 | #endif |
785 | for (i = 0; i < TABLE_COLORS; i++) { | 785 | for (i = 0; i < TABLE_COLORS; i++) { |
786 | if(i==0 || i == 10) { | 786 | if(i==0 || i == 10) { |
787 | m_table[i].color = foreground; | 787 | m_table[i].color = foreground; |
788 | } | 788 | } |
789 | else if(i==1 || i == 11) { | 789 | else if(i==1 || i == 11) { |
790 | m_table[i].color = background; m_table[i].transparent=0; | 790 | m_table[i].color = background; m_table[i].transparent=0; |
791 | } | 791 | } |
792 | else | 792 | else |
793 | m_table[i].color = defaultCt[i].color; | 793 | m_table[i].color = defaultCt[i].color; |
794 | } | 794 | } |
795 | } | 795 | } |
796 | lastSelectedMenu = iD; | 796 | lastSelectedMenu = iD; |
797 | te->setColorTable(m_table); | 797 | te->setColorTable(m_table); |
798 | update(); | 798 | update(); |
799 | 799 | ||
800 | } | 800 | } |
801 | 801 | ||
802 | void Konsole::configMenuSelected(int iD) | 802 | void Konsole::configMenuSelected(int iD) |
803 | { | 803 | { |
804 | // QString temp; | 804 | // QString temp; |
805 | // qDebug( temp.sprintf("configmenu %d",iD)); | 805 | // qDebug( temp.sprintf("configmenu %d",iD)); |
806 | 806 | ||
807 | TEWidget* te = getTe(); | 807 | TEWidget* te = getTe(); |
808 | Config cfg("Konsole"); | 808 | Config cfg("Konsole"); |
809 | cfg.setGroup("Menubar"); | 809 | cfg.setGroup("Menubar"); |
810 | int i,j; | 810 | int i,j; |
811 | #ifdef QT_QWS_OPIE | 811 | #ifdef QT_QWS_OPIE |
812 | i=-29;j=-30; | 812 | i=-29;j=-30; |
813 | #else | 813 | #else |
814 | i=-28;j=-29; | 814 | i=-28;j=-29; |
815 | #endif | 815 | #endif |
816 | 816 | ||
817 | if(iD == -4) { | 817 | if(iD == -4) { |
818 | cfg.setGroup("Tabs"); | 818 | cfg.setGroup("Tabs"); |
819 | QString tmp=cfg.readEntry("Position","Bottom"); | 819 | QString tmp=cfg.readEntry("Position","Bottom"); |
820 | 820 | ||
821 | if(tmp=="Top") { | 821 | if(tmp=="Top") { |
822 | tab->setTabPosition(QTabWidget::Bottom); | 822 | tab->setTabPosition(QTabWidget::Bottom); |
823 | configMenu->changeItem( iD, tr("Tabs on Top")); | 823 | configMenu->changeItem( iD, tr("Tabs on Top")); |
824 | cfg.writeEntry("Position","Bottom"); | 824 | cfg.writeEntry("Position","Bottom"); |
825 | } else { | 825 | } else { |
826 | tab->setTabPosition(QTabWidget::Top); | 826 | tab->setTabPosition(QTabWidget::Top); |
827 | configMenu->changeItem( iD, tr("Tabs on Bottom")); | 827 | configMenu->changeItem( iD, tr("Tabs on Bottom")); |
828 | cfg.writeEntry("Position","Top"); | 828 | cfg.writeEntry("Position","Top"); |
829 | } | 829 | } |
830 | } | 830 | } |
831 | if(iD == i) { | 831 | if(iD == i) { |
832 | cfg.setGroup("ScrollBar"); | 832 | cfg.setGroup("ScrollBar"); |
833 | bool b=cfg.readBoolEntry("HorzScroll",0); | 833 | bool b=cfg.readBoolEntry("HorzScroll",0); |
834 | b=!b; | 834 | b=!b; |
835 | cfg.writeEntry("HorzScroll", b ); | 835 | cfg.writeEntry("HorzScroll", b ); |
@@ -959,104 +959,104 @@ void Konsole::editCommandListMenuSelected(int iD) | |||
959 | te->setFocus(); | 959 | te->setFocus(); |
960 | } | 960 | } |
961 | } | 961 | } |
962 | if(iD == -24) { | 962 | if(iD == -24) { |
963 | // "edit commands" | 963 | // "edit commands" |
964 | CommandEditDialog *m = new CommandEditDialog(this); | 964 | CommandEditDialog *m = new CommandEditDialog(this); |
965 | connect(m,SIGNAL(commandsEdited()),this,SLOT(initCommandList())); | 965 | connect(m,SIGNAL(commandsEdited()),this,SLOT(initCommandList())); |
966 | m->showMaximized(); | 966 | m->showMaximized(); |
967 | } | 967 | } |
968 | 968 | ||
969 | } | 969 | } |
970 | 970 | ||
971 | // $QPEDIR/bin/qcop QPE/Application/embeddedkonsole 'setDocument(QString)' 'ssh -V' | 971 | // $QPEDIR/bin/qcop QPE/Application/embeddedkonsole 'setDocument(QString)' 'ssh -V' |
972 | void Konsole::setDocument( const QString &cmd) { | 972 | void Konsole::setDocument( const QString &cmd) { |
973 | newSession(); | 973 | newSession(); |
974 | TEWidget* te = getTe(); | 974 | TEWidget* te = getTe(); |
975 | if(cmd.find("-e", 0, TRUE) != -1) { | 975 | if(cmd.find("-e", 0, TRUE) != -1) { |
976 | QString cmd2; | 976 | QString cmd2; |
977 | cmd2=cmd.right(cmd.length()-3)+" &"; | 977 | cmd2=cmd.right(cmd.length()-3)+" &"; |
978 | system(cmd2.latin1()); | 978 | system(cmd2.latin1()); |
979 | if(startUp <= 1 && nsessions < 2) { | 979 | if(startUp <= 1 && nsessions < 2) { |
980 | doneSession(getTe()->currentSession, 0); | 980 | doneSession(getTe()->currentSession, 0); |
981 | exit(0); | 981 | exit(0); |
982 | } else | 982 | } else |
983 | doneSession(getTe()->currentSession, 0); | 983 | doneSession(getTe()->currentSession, 0); |
984 | } else { | 984 | } else { |
985 | if (te != 0) { | 985 | if (te != 0) { |
986 | te->emitText(cmd+"\r"); | 986 | te->emitText(cmd+"\r"); |
987 | } | 987 | } |
988 | } | 988 | } |
989 | startUp++; | 989 | startUp++; |
990 | } | 990 | } |
991 | 991 | ||
992 | void Konsole::parseCommandLine() { | 992 | void Konsole::parseCommandLine() { |
993 | QString cmd; | 993 | QString cmd; |
994 | // newSession(); | 994 | // newSession(); |
995 | for (int i=1;i< qApp->argc();i++) { | 995 | for (int i=1;i< qApp->argc();i++) { |
996 | if( QString(qApp->argv()[i]) == "-e") { | 996 | if( QString(qApp->argv()[i]) == "-e") { |
997 | i++; | 997 | i++; |
998 | for ( int j=i;j< qApp->argc();j++) { | 998 | for ( int j=i;j< qApp->argc();j++) { |
999 | cmd+=QString(qApp->argv()[j])+" "; | 999 | cmd+=QString(qApp->argv()[j])+" "; |
1000 | } | 1000 | } |
1001 | cmd.stripWhiteSpace(); | 1001 | cmd.stripWhiteSpace(); |
1002 | system(cmd.latin1()); | 1002 | system(cmd.latin1()); |
1003 | exit(0);//close(); | 1003 | exit(0);//close(); |
1004 | } // end -e switch | 1004 | } // end -e switch |
1005 | } | 1005 | } |
1006 | startUp++; | 1006 | startUp++; |
1007 | } | 1007 | } |
1008 | 1008 | ||
1009 | void Konsole::changeForegroundColor(const QColor &color) { | 1009 | void Konsole::changeForegroundColor(const QColor &color) { |
1010 | Config cfg("Konsole"); | 1010 | Config cfg("Konsole"); |
1011 | cfg.setGroup("Colors"); | 1011 | cfg.setGroup("Colors"); |
1012 | int r, g, b; | 1012 | int r, g, b; |
1013 | color.rgb(&r,&g,&b); | 1013 | color.rgb(&r,&g,&b); |
1014 | foreground.setRgb(r,g,b); | 1014 | foreground.setRgb(r,g,b); |
1015 | 1015 | ||
1016 | cfg.writeEntry("foreground",color.name()); | 1016 | cfg.writeEntry("foreground",color.name()); |
1017 | qDebug("foreground "+color.name()); | 1017 | qDebug("foreground "+color.name()); |
1018 | cfg.write(); | 1018 | cfg.write(); |
1019 | 1019 | ||
1020 | qDebug("do other dialog"); | 1020 | qDebug("do other dialog"); |
1021 | #ifdef QT_QWS_OPIE | 1021 | #ifdef QT_QWS_OPIE |
1022 | 1022 | ||
1023 | ColorPopupMenu* penColorPopupMenu2 = new ColorPopupMenu(Qt::black, this,"background color"); | 1023 | OColorPopupMenu* penColorPopupMenu2 = new OColorPopupMenu(Qt::black, this,"background color"); |
1024 | connect(penColorPopupMenu2, SIGNAL(colorSelected(const QColor&)), this, | 1024 | connect(penColorPopupMenu2, SIGNAL(colorSelected(const QColor&)), this, |
1025 | SLOT(changeBackgroundColor(const QColor&))); | 1025 | SLOT(changeBackgroundColor(const QColor&))); |
1026 | penColorPopupMenu2->exec(); | 1026 | penColorPopupMenu2->exec(); |
1027 | #endif | 1027 | #endif |
1028 | } | 1028 | } |
1029 | 1029 | ||
1030 | void Konsole::changeBackgroundColor(const QColor &color) { | 1030 | void Konsole::changeBackgroundColor(const QColor &color) { |
1031 | 1031 | ||
1032 | qDebug("Change background"); | 1032 | qDebug("Change background"); |
1033 | Config cfg("Konsole"); | 1033 | Config cfg("Konsole"); |
1034 | cfg.setGroup("Colors"); | 1034 | cfg.setGroup("Colors"); |
1035 | int r, g, b; | 1035 | int r, g, b; |
1036 | color.rgb(&r,&g,&b); | 1036 | color.rgb(&r,&g,&b); |
1037 | background.setRgb(r,g,b); | 1037 | background.setRgb(r,g,b); |
1038 | cfg.writeEntry("background",color.name()); | 1038 | cfg.writeEntry("background",color.name()); |
1039 | qDebug("background "+color.name()); | 1039 | qDebug("background "+color.name()); |
1040 | cfg.write(); | 1040 | cfg.write(); |
1041 | } | 1041 | } |
1042 | 1042 | ||
1043 | void Konsole::doWrap() { | 1043 | void Konsole::doWrap() { |
1044 | int i; | 1044 | int i; |
1045 | #ifdef QT_QWS_OPIE | 1045 | #ifdef QT_QWS_OPIE |
1046 | i=-29; | 1046 | i=-29; |
1047 | #else | 1047 | #else |
1048 | i=-28; | 1048 | i=-28; |
1049 | #endif | 1049 | #endif |
1050 | 1050 | ||
1051 | Config cfg("Konsole"); | 1051 | Config cfg("Konsole"); |
1052 | cfg.setGroup("ScrollBar"); | 1052 | cfg.setGroup("ScrollBar"); |
1053 | TEWidget* te = getTe(); | 1053 | TEWidget* te = getTe(); |
1054 | if( !cfg.readBoolEntry("HorzScroll",0)) { | 1054 | if( !cfg.readBoolEntry("HorzScroll",0)) { |
1055 | te->setWrapAt(0); | 1055 | te->setWrapAt(0); |
1056 | configMenu->setItemChecked( i,TRUE); | 1056 | configMenu->setItemChecked( i,TRUE); |
1057 | } else { | 1057 | } else { |
1058 | // te->setWrapAt(90); | 1058 | // te->setWrapAt(90); |
1059 | te->setWrapAt(120); | 1059 | te->setWrapAt(120); |
1060 | configMenu->setItemChecked( i,FALSE); | 1060 | configMenu->setItemChecked( i,FALSE); |
1061 | } | 1061 | } |
1062 | } | 1062 | } |