author | leseb <leseb> | 2002-07-07 18:38:50 (UTC) |
---|---|---|
committer | leseb <leseb> | 2002-07-07 18:38:50 (UTC) |
commit | 29afb9794560f9aa2342bf971ece66336d052b17 (patch) (unidiff) | |
tree | 33a82050f295eded341ae9f81ddb281b98d2cc89 | |
parent | 5a6d27d4ef5a00dfa041323938acdbdf80c726fd (diff) | |
download | opie-29afb9794560f9aa2342bf971ece66336d052b17.zip opie-29afb9794560f9aa2342bf971ece66336d052b17.tar.gz opie-29afb9794560f9aa2342bf971ece66336d052b17.tar.bz2 |
Fix menu item index (again...)
-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 36b9b1e..63073c4 100644 --- a/core/apps/embeddedkonsole/konsole.cpp +++ b/core/apps/embeddedkonsole/konsole.cpp | |||
@@ -805,113 +805,113 @@ void Konsole::scrollMenuSelected(int index) | |||
805 | TEWidget* te = getTe(); | 805 | TEWidget* te = getTe(); |
806 | Config cfg("Konsole"); | 806 | Config cfg("Konsole"); |
807 | cfg.setGroup("ScrollBar"); | 807 | cfg.setGroup("ScrollBar"); |
808 | switch( index){ | 808 | switch( index){ |
809 | case -25: | 809 | case -25: |
810 | te->setScrollbarLocation(0); | 810 | te->setScrollbarLocation(0); |
811 | cfg.writeEntry("Position",0); | 811 | cfg.writeEntry("Position",0); |
812 | break; | 812 | break; |
813 | case -26: | 813 | case -26: |
814 | te->setScrollbarLocation(1); | 814 | te->setScrollbarLocation(1); |
815 | cfg.writeEntry("Position",1); | 815 | cfg.writeEntry("Position",1); |
816 | break; | 816 | break; |
817 | case -27: | 817 | case -27: |
818 | te->setScrollbarLocation(2); | 818 | te->setScrollbarLocation(2); |
819 | cfg.writeEntry("Position",2); | 819 | cfg.writeEntry("Position",2); |
820 | break; | 820 | break; |
821 | }; | 821 | }; |
822 | 822 | ||
823 | } | 823 | } |
824 | 824 | ||
825 | void Konsole::editCommandListMenuSelected(int iD) | 825 | void Konsole::editCommandListMenuSelected(int iD) |
826 | { | 826 | { |
827 | // QString temp; | 827 | // QString temp; |
828 | // qDebug( temp.sprintf("edit command list %d",iD)); | 828 | // qDebug( temp.sprintf("edit command list %d",iD)); |
829 | TEWidget* te = getTe(); | 829 | TEWidget* te = getTe(); |
830 | Config cfg("Konsole"); | 830 | Config cfg("Konsole"); |
831 | cfg.setGroup("Menubar"); | 831 | cfg.setGroup("Menubar"); |
832 | if( iD == -3) { | 832 | if( iD == -3) { |
833 | if(!secondToolBar->isHidden()) { | 833 | if(!secondToolBar->isHidden()) { |
834 | secondToolBar->hide(); | 834 | secondToolBar->hide(); |
835 | configMenu->changeItem( iD,tr( "Show Command List" )); | 835 | configMenu->changeItem( iD,tr( "Show Command List" )); |
836 | cfg.writeEntry("Hidden","TRUE"); | 836 | cfg.writeEntry("Hidden","TRUE"); |
837 | configMenu->setItemEnabled(-22 ,FALSE); | 837 | configMenu->setItemEnabled(-22 ,FALSE); |
838 | } else { | 838 | } else { |
839 | secondToolBar->show(); | 839 | secondToolBar->show(); |
840 | configMenu->changeItem( iD,tr( "Hide Command List" )); | 840 | configMenu->changeItem( iD,tr( "Hide Command List" )); |
841 | cfg.writeEntry("Hidden","FALSE"); | 841 | cfg.writeEntry("Hidden","FALSE"); |
842 | configMenu->setItemEnabled(-22 ,TRUE); | 842 | configMenu->setItemEnabled(-22 ,TRUE); |
843 | 843 | ||
844 | if(cfg.readEntry("EditEnabled","FALSE")=="TRUE") { | 844 | if(cfg.readEntry("EditEnabled","FALSE")=="TRUE") { |
845 | configMenu->setItemChecked(-22,TRUE); | 845 | configMenu->setItemChecked(-22,TRUE); |
846 | commonCombo->setEditable( TRUE ); | 846 | commonCombo->setEditable( TRUE ); |
847 | } else { | 847 | } else { |
848 | configMenu->setItemChecked(-22,FALSE); | 848 | configMenu->setItemChecked(-22,FALSE); |
849 | commonCombo->setEditable( FALSE ); | 849 | commonCombo->setEditable( FALSE ); |
850 | } | 850 | } |
851 | } | 851 | } |
852 | } | 852 | } |
853 | if( iD == -22) { | 853 | if( iD == -23) { |
854 | cfg.setGroup("Commands"); | 854 | cfg.setGroup("Commands"); |
855 | // qDebug("enableCommandEdit"); | 855 | // qDebug("enableCommandEdit"); |
856 | if( !configMenu->isItemChecked(iD) ) { | 856 | if( !configMenu->isItemChecked(iD) ) { |
857 | commonCombo->setEditable( TRUE ); | 857 | commonCombo->setEditable( TRUE ); |
858 | configMenu->setItemChecked(iD,TRUE); | 858 | configMenu->setItemChecked(iD,TRUE); |
859 | commonCombo->setCurrentItem(0); | 859 | commonCombo->setCurrentItem(0); |
860 | cfg.writeEntry("EditEnabled","TRUE"); | 860 | cfg.writeEntry("EditEnabled","TRUE"); |
861 | } else { | 861 | } else { |
862 | commonCombo->setEditable( FALSE ); | 862 | commonCombo->setEditable( FALSE ); |
863 | configMenu->setItemChecked(iD,FALSE); | 863 | configMenu->setItemChecked(iD,FALSE); |
864 | cfg.writeEntry("EditEnabled","FALSE"); | 864 | cfg.writeEntry("EditEnabled","FALSE"); |
865 | commonCombo->setFocusPolicy(QWidget::NoFocus); | 865 | commonCombo->setFocusPolicy(QWidget::NoFocus); |
866 | te->setFocus(); | 866 | te->setFocus(); |
867 | } | 867 | } |
868 | } | 868 | } |
869 | if(iD == -23) { | 869 | if(iD == -24) { |
870 | // "edit commands" | 870 | // "edit commands" |
871 | CommandEditDialog *m = new CommandEditDialog(this); | 871 | CommandEditDialog *m = new CommandEditDialog(this); |
872 | connect(m,SIGNAL(commandsEdited()),this,SLOT(initCommandList())); | 872 | connect(m,SIGNAL(commandsEdited()),this,SLOT(initCommandList())); |
873 | m->showMaximized(); | 873 | m->showMaximized(); |
874 | } | 874 | } |
875 | 875 | ||
876 | } | 876 | } |
877 | 877 | ||
878 | // $QPEDIR/bin/qcop QPE/Application/embeddedkonsole 'setDocument(QString)' 'ssh -V' | 878 | // $QPEDIR/bin/qcop QPE/Application/embeddedkonsole 'setDocument(QString)' 'ssh -V' |
879 | void Konsole::setDocument( const QString &cmd) { | 879 | void Konsole::setDocument( const QString &cmd) { |
880 | newSession(); | 880 | newSession(); |
881 | TEWidget* te = getTe(); | 881 | TEWidget* te = getTe(); |
882 | if(cmd.find("-e", 0, TRUE) != -1) { | 882 | if(cmd.find("-e", 0, TRUE) != -1) { |
883 | QString cmd2; | 883 | QString cmd2; |
884 | cmd2=cmd.right(cmd.length()-3)+" &"; | 884 | cmd2=cmd.right(cmd.length()-3)+" &"; |
885 | system(cmd2.latin1()); | 885 | system(cmd2.latin1()); |
886 | if(startUp <= 1 && nsessions < 2) { | 886 | if(startUp <= 1 && nsessions < 2) { |
887 | doneSession(getTe()->currentSession, 0); | 887 | doneSession(getTe()->currentSession, 0); |
888 | exit(0); | 888 | exit(0); |
889 | } else | 889 | } else |
890 | doneSession(getTe()->currentSession, 0); | 890 | doneSession(getTe()->currentSession, 0); |
891 | } else { | 891 | } else { |
892 | if (te != 0) { | 892 | if (te != 0) { |
893 | te->emitText(cmd+"\r"); | 893 | te->emitText(cmd+"\r"); |
894 | } | 894 | } |
895 | } | 895 | } |
896 | startUp++; | 896 | startUp++; |
897 | } | 897 | } |
898 | 898 | ||
899 | void Konsole::parseCommandLine() { | 899 | void Konsole::parseCommandLine() { |
900 | QString cmd; | 900 | QString cmd; |
901 | // newSession(); | 901 | // newSession(); |
902 | for (int i=1;i< qApp->argc();i++) { | 902 | for (int i=1;i< qApp->argc();i++) { |
903 | if( QString(qApp->argv()[i]) == "-e") { | 903 | if( QString(qApp->argv()[i]) == "-e") { |
904 | i++; | 904 | i++; |
905 | for ( int j=i;j< qApp->argc();j++) { | 905 | for ( int j=i;j< qApp->argc();j++) { |
906 | cmd+=QString(qApp->argv()[j])+" "; | 906 | cmd+=QString(qApp->argv()[j])+" "; |
907 | } | 907 | } |
908 | cmd.stripWhiteSpace(); | 908 | cmd.stripWhiteSpace(); |
909 | system(cmd.latin1()); | 909 | system(cmd.latin1()); |
910 | exit(0);//close(); | 910 | exit(0);//close(); |
911 | } // end -e switch | 911 | } // end -e switch |
912 | } | 912 | } |
913 | startUp++; | 913 | startUp++; |
914 | } | 914 | } |
915 | 915 | ||
916 | void Konsole::changeForegroundColor(const QColor &color) { | 916 | void Konsole::changeForegroundColor(const QColor &color) { |
917 | Config cfg("Konsole"); | 917 | Config cfg("Konsole"); |