Diffstat (limited to 'core/apps/embeddedkonsole/konsole.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/apps/embeddedkonsole/konsole.cpp | 68 |
1 files changed, 40 insertions, 28 deletions
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp index 5a68c81..ebff05e 100644 --- a/core/apps/embeddedkonsole/konsole.cpp +++ b/core/apps/embeddedkonsole/konsole.cpp | |||
@@ -326,96 +326,100 @@ void Konsole::init(const char* _pgm, QStrList & _args) | |||
326 | a = new QAction( tr("Up"), Resource::loadPixmap( "konsole/up" ), QString::null, 0, this, 0 ); | 326 | a = new QAction( tr("Up"), Resource::loadPixmap( "konsole/up" ), QString::null, 0, this, 0 ); |
327 | connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar ); | 327 | connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar ); |
328 | a = new QAction( tr("Down"), Resource::loadPixmap( "konsole/down" ), QString::null, 0, this, 0 ); | 328 | a = new QAction( tr("Down"), Resource::loadPixmap( "konsole/down" ), QString::null, 0, this, 0 ); |
329 | connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar ); | 329 | connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar ); |
330 | a = new QAction( tr("Paste"), Resource::loadPixmap( "paste" ), QString::null, 0, this, 0 ); | 330 | a = new QAction( tr("Paste"), Resource::loadPixmap( "paste" ), QString::null, 0, this, 0 ); |
331 | connect( a, SIGNAL( activated() ), this, SLOT( hitPaste() ) ); a->addTo( toolbar ); | 331 | connect( a, SIGNAL( activated() ), this, SLOT( hitPaste() ) ); a->addTo( toolbar ); |
332 | /* | 332 | /* |
333 | a = new QAction( tr("Up"), Resource::loadPixmap( "up" ), QString::null, 0, this, 0 ); | 333 | a = new QAction( tr("Up"), Resource::loadPixmap( "up" ), QString::null, 0, this, 0 ); |
334 | connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar ); | 334 | connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar ); |
335 | a = new QAction( tr("Down"), Resource::loadPixmap( "down" ), QString::null, 0, this, 0 ); | 335 | a = new QAction( tr("Down"), Resource::loadPixmap( "down" ), QString::null, 0, this, 0 ); |
336 | connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar ); | 336 | connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar ); |
337 | */ | 337 | */ |
338 | 338 | ||
339 | secondToolBar = new QPEToolBar( this ); | 339 | secondToolBar = new QPEToolBar( this ); |
340 | secondToolBar->setHorizontalStretchable( TRUE ); | 340 | secondToolBar->setHorizontalStretchable( TRUE ); |
341 | 341 | ||
342 | commonCombo = new QComboBox( secondToolBar ); | 342 | commonCombo = new QComboBox( secondToolBar ); |
343 | commonCombo->setMaximumWidth(236); | 343 | commonCombo->setMaximumWidth(236); |
344 | 344 | ||
345 | editCommandListMenu->insertItem( tr( "Quick Edit" ) ); | 345 | editCommandListMenu->insertItem( tr( "Quick Edit" ) ); |
346 | if( listHidden) { | 346 | if( listHidden) { |
347 | secondToolBar->hide(); | 347 | secondToolBar->hide(); |
348 | editCommandListMenu->setItemEnabled(-23 ,FALSE); | 348 | editCommandListMenu->setItemEnabled(-23 ,FALSE); |
349 | } | 349 | } |
350 | editCommandListMenu->insertItem(tr( "Edit" ) ); | 350 | editCommandListMenu->insertItem(tr( "Edit" ) ); |
351 | 351 | ||
352 | cfg.setGroup("Commands"); | 352 | cfg.setGroup("Commands"); |
353 | commonCombo->setInsertionPolicy(QComboBox::AtCurrent); | 353 | commonCombo->setInsertionPolicy(QComboBox::AtCurrent); |
354 | 354 | ||
355 | initCommandList(); | 355 | initCommandList(); |
356 | // for (int i = 0; commonCmds[i] != NULL; i++) { | 356 | // for (int i = 0; commonCmds[i] != NULL; i++) { |
357 | // commonCombo->insertItem( commonCmds[i], i ); | 357 | // commonCombo->insertItem( commonCmds[i], i ); |
358 | // tmp = cfg.readEntry( QString::number(i),""); | 358 | // tmp = cfg.readEntry( QString::number(i),""); |
359 | // if(tmp != "") | 359 | // if(tmp != "") |
360 | // commonCombo->changeItem( tmp,i ); | 360 | // commonCombo->changeItem( tmp,i ); |
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 | configMenu->insertItem(tr( "Wrap" )); |
374 | int jut = configMenu->insertItem(tr( "Use Beep" )); | ||
375 | cfg.setGroup("Menubar"); | ||
376 | configMenu->setItemChecked(jut, cfg.readBoolEntry("useBeep",0)); | ||
377 | |||
374 | 378 | ||
375 | //scrollMenuSelected(-29); | 379 | //scrollMenuSelected(-29); |
376 | // cfg.setGroup("ScrollBar"); | 380 | // cfg.setGroup("ScrollBar"); |
377 | // if(cfg.readBoolEntry("HorzScroll",0)) { | 381 | // if(cfg.readBoolEntry("HorzScroll",0)) { |
378 | // if(cfg.readNumEntry("Position",2) == 0) | 382 | // if(cfg.readNumEntry("Position",2) == 0) |
379 | // te->setScrollbarLocation(1); | 383 | // te->setScrollbarLocation(1); |
380 | // else | 384 | // else |
381 | // te->setScrollbarLocation(0); | 385 | // te->setScrollbarLocation(0); |
382 | // te->setScrollbarLocation( cfg.readNumEntry("Position",2)); | 386 | // te->setScrollbarLocation( cfg.readNumEntry("Position",2)); |
383 | // te->setWrapAt(120); | 387 | // te->setWrapAt(120); |
384 | // } | 388 | // } |
385 | // create applications ///////////////////////////////////////////////////// | 389 | // create applications ///////////////////////////////////////////////////// |
386 | setCentralWidget(tab); | 390 | setCentralWidget(tab); |
387 | 391 | ||
388 | // load keymaps //////////////////////////////////////////////////////////// | 392 | // load keymaps //////////////////////////////////////////////////////////// |
389 | KeyTrans::loadAll(); | 393 | KeyTrans::loadAll(); |
390 | for (int i = 0; i < KeyTrans::count(); i++) | 394 | for (int i = 0; i < KeyTrans::count(); i++) |
391 | { KeyTrans* s = KeyTrans::find(i); | 395 | { KeyTrans* s = KeyTrans::find(i); |
392 | assert( s ); | 396 | assert( s ); |
393 | } | 397 | } |
394 | 398 | ||
395 | se_pgm = _pgm; | 399 | se_pgm = _pgm; |
396 | se_args = _args; | 400 | se_args = _args; |
397 | se_args.prepend("--login"); | 401 | se_args.prepend("--login"); |
398 | parseCommandLine(); | 402 | parseCommandLine(); |
399 | // read and apply default values /////////////////////////////////////////// | 403 | // read and apply default values /////////////////////////////////////////// |
400 | resize(321, 321); // Dummy. | 404 | resize(321, 321); // Dummy. |
401 | QSize currentSize = size(); | 405 | QSize currentSize = size(); |
402 | if (currentSize != size()) | 406 | if (currentSize != size()) |
403 | defaultSize = size(); | 407 | defaultSize = size(); |
404 | } | 408 | } |
405 | 409 | ||
406 | void Konsole::show() | 410 | void Konsole::show() |
407 | { | 411 | { |
408 | if ( !nsessions ) { | 412 | if ( !nsessions ) { |
409 | newSession(); | 413 | newSession(); |
410 | } | 414 | } |
411 | QMainWindow::show(); | 415 | QMainWindow::show(); |
412 | 416 | ||
413 | } | 417 | } |
414 | 418 | ||
415 | void Konsole::initSession(const char*, QStrList &) | 419 | void Konsole::initSession(const char*, QStrList &) |
416 | { | 420 | { |
417 | QMainWindow::show(); | 421 | QMainWindow::show(); |
418 | } | 422 | } |
419 | 423 | ||
420 | Konsole::~Konsole() | 424 | Konsole::~Konsole() |
421 | { | 425 | { |
@@ -742,136 +746,145 @@ void Konsole::colorMenuSelected(int iD) | |||
742 | foreground.setRgb(0x18,0xB2,0xB2); | 746 | foreground.setRgb(0x18,0xB2,0xB2); |
743 | cfg.writeEntry("Schema","17"); | 747 | cfg.writeEntry("Schema","17"); |
744 | colorMenu->setItemChecked(-17,TRUE); | 748 | colorMenu->setItemChecked(-17,TRUE); |
745 | } | 749 | } |
746 | if(iD==-18) {// Black, Gold | 750 | if(iD==-18) {// Black, Gold |
747 | background.setRgb(0x00,0x00,0x00); | 751 | background.setRgb(0x00,0x00,0x00); |
748 | foreground.setRgb(255,215,0); | 752 | foreground.setRgb(255,215,0); |
749 | cfg.writeEntry("Schema","18"); | 753 | cfg.writeEntry("Schema","18"); |
750 | colorMenu->setItemChecked(-18,TRUE); | 754 | colorMenu->setItemChecked(-18,TRUE); |
751 | } | 755 | } |
752 | #ifdef QWS_QT_OPIE | 756 | #ifdef QWS_QT_OPIE |
753 | if(iD==-19) { | 757 | if(iD==-19) { |
754 | // Custom | 758 | // Custom |
755 | qDebug("do custom"); | 759 | qDebug("do custom"); |
756 | if(fromMenu) { | 760 | if(fromMenu) { |
757 | ColorPopupMenu* penColorPopupMenu = new ColorPopupMenu(Qt::black, this, "foreground color"); | 761 | ColorPopupMenu* penColorPopupMenu = new ColorPopupMenu(Qt::black, this, "foreground color"); |
758 | connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, | 762 | connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, |
759 | SLOT(changeForegroundColor(const QColor&))); | 763 | SLOT(changeForegroundColor(const QColor&))); |
760 | penColorPopupMenu->exec(); | 764 | penColorPopupMenu->exec(); |
761 | } | 765 | } |
762 | cfg.writeEntry("Schema","19"); | 766 | cfg.writeEntry("Schema","19"); |
763 | if(!fromMenu) { | 767 | if(!fromMenu) { |
764 | foreground.setNamedColor(cfg.readEntry("foreground","")); | 768 | foreground.setNamedColor(cfg.readEntry("foreground","")); |
765 | background.setNamedColor(cfg.readEntry("background","")); | 769 | background.setNamedColor(cfg.readEntry("background","")); |
766 | } | 770 | } |
767 | fromMenu=FALSE; | 771 | fromMenu=FALSE; |
768 | colorMenu->setItemChecked(-19,TRUE); | 772 | colorMenu->setItemChecked(-19,TRUE); |
769 | } | 773 | } |
770 | #endif | 774 | #endif |
771 | for (i = 0; i < TABLE_COLORS; i++) { | 775 | for (i = 0; i < TABLE_COLORS; i++) { |
772 | if(i==0 || i == 10) { | 776 | if(i==0 || i == 10) { |
773 | m_table[i].color = foreground; | 777 | m_table[i].color = foreground; |
774 | } | 778 | } |
775 | else if(i==1 || i == 11) { | 779 | else if(i==1 || i == 11) { |
776 | m_table[i].color = background; m_table[i].transparent=0; | 780 | m_table[i].color = background; m_table[i].transparent=0; |
777 | } | 781 | } |
778 | else | 782 | else |
779 | m_table[i].color = defaultCt[i].color; | 783 | m_table[i].color = defaultCt[i].color; |
780 | } | 784 | } |
781 | } | 785 | } |
782 | lastSelectedMenu = iD; | 786 | lastSelectedMenu = iD; |
783 | te->setColorTable(m_table); | 787 | te->setColorTable(m_table); |
784 | update(); | 788 | update(); |
785 | 789 | ||
786 | } | 790 | } |
787 | 791 | ||
788 | void Konsole::configMenuSelected(int iD) | 792 | void Konsole::configMenuSelected(int iD) |
789 | { | 793 | { |
790 | // QString temp; | 794 | // QString temp; |
791 | // qDebug( temp.sprintf("configmenu %d",iD)); | 795 | // qDebug( temp.sprintf("configmenu %d",iD)); |
792 | TEWidget* te = getTe(); | 796 | TEWidget* te = getTe(); |
793 | Config cfg("Konsole"); | 797 | Config cfg("Konsole"); |
794 | cfg.setGroup("Menubar"); | 798 | cfg.setGroup("Menubar"); |
795 | if( iD == -4) { | 799 | int i,j; |
796 | cfg.setGroup("Tabs"); | ||
797 | QString tmp=cfg.readEntry("Position","Bottom"); | ||
798 | |||
799 | if(tmp=="Top") { | ||
800 | tab->setTabPosition(QTabWidget::Bottom); | ||
801 | configMenu->changeItem( iD,"Tabs on Top"); | ||
802 | cfg.writeEntry("Position","Bottom"); | ||
803 | } else { | ||
804 | tab->setTabPosition(QTabWidget::Top); | ||
805 | configMenu->changeItem( iD,"Tabs on Bottom"); | ||
806 | cfg.writeEntry("Position","Top"); | ||
807 | } | ||
808 | } | ||
809 | int i; | ||
810 | #ifdef QWS_QT_OPIE | 800 | #ifdef QWS_QT_OPIE |
811 | i=-29; | 801 | i=-29;j=-30; |
812 | #else | 802 | #else |
813 | i=-28; | 803 | i=-28;j=-29; |
814 | #endif | 804 | #endif |
815 | 805 | ||
816 | if( iD == i) { | 806 | if(iD == -4) { |
817 | cfg.setGroup("ScrollBar"); | 807 | cfg.setGroup("Tabs"); |
808 | QString tmp=cfg.readEntry("Position","Bottom"); | ||
809 | |||
810 | if(tmp=="Top") { | ||
811 | tab->setTabPosition(QTabWidget::Bottom); | ||
812 | configMenu->changeItem( iD,"Tabs on Top"); | ||
813 | cfg.writeEntry("Position","Bottom"); | ||
814 | } else { | ||
815 | tab->setTabPosition(QTabWidget::Top); | ||
816 | configMenu->changeItem( iD,"Tabs on Bottom"); | ||
817 | cfg.writeEntry("Position","Top"); | ||
818 | } | ||
819 | } | ||
820 | if(iD == i) { | ||
821 | cfg.setGroup("ScrollBar"); | ||
818 | bool b=cfg.readBoolEntry("HorzScroll",0); | 822 | bool b=cfg.readBoolEntry("HorzScroll",0); |
819 | b=!b; | 823 | b=!b; |
820 | cfg.writeEntry("HorzScroll", b ); | 824 | cfg.writeEntry("HorzScroll", b ); |
821 | cfg.write(); | 825 | cfg.write(); |
822 | doWrap(); | 826 | doWrap(); |
823 | if(cfg.readNumEntry("Position",2) == 0) { | 827 | if(cfg.readNumEntry("Position",2) == 0) { |
824 | te->setScrollbarLocation(1); | 828 | te->setScrollbarLocation(1); |
825 | } else { | 829 | } else { |
826 | te->setScrollbarLocation(0); | 830 | te->setScrollbarLocation(0); |
827 | } | 831 | } |
828 | te->setScrollbarLocation( cfg.readNumEntry("Position",2)); | 832 | te->setScrollbarLocation( cfg.readNumEntry("Position",2)); |
829 | } | 833 | } |
834 | if(iD == j) { | ||
835 | cfg.setGroup("Menubar"); | ||
836 | bool b=cfg.readBoolEntry("useBeep",0); | ||
837 | b=!b; | ||
838 | cfg.writeEntry("useBeep", b ); | ||
839 | cfg.write(); | ||
840 | configMenu->setItemChecked(j,b); | ||
841 | te->useBeep=b; | ||
842 | } | ||
830 | } | 843 | } |
831 | 844 | ||
832 | void Konsole::changeCommand(const QString &text, int c) | 845 | void Konsole::changeCommand(const QString &text, int c) |
833 | { | 846 | { |
834 | Config cfg("Konsole"); | 847 | Config cfg("Konsole"); |
835 | cfg.setGroup("Commands"); | 848 | cfg.setGroup("Commands"); |
836 | if(commonCmds[c] != text) { | 849 | if(commonCmds[c] != text) { |
837 | cfg.writeEntry(QString::number(c),text); | 850 | cfg.writeEntry(QString::number(c),text); |
838 | commonCombo->clearEdit(); | 851 | commonCombo->clearEdit(); |
839 | commonCombo->setCurrentItem(c); | 852 | commonCombo->setCurrentItem(c); |
840 | } | 853 | } |
841 | } | 854 | } |
842 | 855 | ||
843 | void Konsole::setColor() | 856 | void Konsole::setColor() |
844 | { | 857 | { |
845 | Config cfg("Konsole"); | 858 | Config cfg("Konsole"); |
846 | cfg.setGroup("Colors"); | 859 | cfg.setGroup("Colors"); |
847 | int scheme = cfg.readNumEntry("Schema",1); | 860 | int scheme = cfg.readNumEntry("Schema",1); |
848 | if(scheme != 1) colorMenuSelected( -scheme); | 861 | if(scheme != 1) colorMenuSelected( -scheme); |
849 | } | 862 | } |
850 | 863 | ||
851 | void Konsole::scrollMenuSelected(int index) | 864 | void Konsole::scrollMenuSelected(int index) |
852 | { | 865 | { |
853 | qDebug( "scrollbar menu %d",index); | 866 | qDebug( "scrollbar menu %d",index); |
854 | TEWidget* te = getTe(); | 867 | TEWidget* te = getTe(); |
855 | Config cfg("Konsole"); | 868 | Config cfg("Konsole"); |
856 | cfg.setGroup("ScrollBar"); | 869 | cfg.setGroup("ScrollBar"); |
857 | switch( index){ | 870 | switch( index){ |
858 | case -25: | 871 | case -25: |
859 | te->setScrollbarLocation(0); | 872 | te->setScrollbarLocation(0); |
860 | cfg.writeEntry("Position",0); | 873 | cfg.writeEntry("Position",0); |
861 | break; | 874 | break; |
862 | case -26: | 875 | case -26: |
863 | te->setScrollbarLocation(1); | 876 | te->setScrollbarLocation(1); |
864 | cfg.writeEntry("Position",1); | 877 | cfg.writeEntry("Position",1); |
865 | break; | 878 | break; |
866 | case -27: | 879 | case -27: |
867 | te->setScrollbarLocation(2); | 880 | te->setScrollbarLocation(2); |
868 | cfg.writeEntry("Position",2); | 881 | cfg.writeEntry("Position",2); |
869 | break; | 882 | break; |
870 | // case -29: { | 883 | // case -29: { |
871 | // bool b=cfg.readBoolEntry("HorzScroll",0); | 884 | // bool b=cfg.readBoolEntry("HorzScroll",0); |
872 | // cfg.writeEntry("HorzScroll", !b ); | 885 | // cfg.writeEntry("HorzScroll", !b ); |
873 | // cfg.write(); | 886 | // cfg.write(); |
874 | // if(cfg.readNumEntry("Position",2) == 0) { | 887 | // if(cfg.readNumEntry("Position",2) == 0) { |
875 | // te->setScrollbarLocation(1); | 888 | // te->setScrollbarLocation(1); |
876 | // te->setWrapAt(0); | 889 | // te->setWrapAt(0); |
877 | // } else { | 890 | // } else { |
@@ -936,97 +949,96 @@ void Konsole::editCommandListMenuSelected(int iD) | |||
936 | } | 949 | } |
937 | 950 | ||
938 | } | 951 | } |
939 | 952 | ||
940 | // $QPEDIR/bin/qcop QPE/Application/embeddedkonsole 'setDocument(QString)' 'ssh -V' | 953 | // $QPEDIR/bin/qcop QPE/Application/embeddedkonsole 'setDocument(QString)' 'ssh -V' |
941 | void Konsole::setDocument( const QString &cmd) { | 954 | void Konsole::setDocument( const QString &cmd) { |
942 | newSession(); | 955 | newSession(); |
943 | TEWidget* te = getTe(); | 956 | TEWidget* te = getTe(); |
944 | if(cmd.find("-e", 0, TRUE) != -1) { | 957 | if(cmd.find("-e", 0, TRUE) != -1) { |
945 | QString cmd2; | 958 | QString cmd2; |
946 | cmd2=cmd.right(cmd.length()-3)+" &"; | 959 | cmd2=cmd.right(cmd.length()-3)+" &"; |
947 | system(cmd2.latin1()); | 960 | system(cmd2.latin1()); |
948 | if(startUp <= 1 && nsessions < 2) { | 961 | if(startUp <= 1 && nsessions < 2) { |
949 | doneSession(getTe()->currentSession, 0); | 962 | doneSession(getTe()->currentSession, 0); |
950 | exit(0); | 963 | exit(0); |
951 | } else | 964 | } else |
952 | doneSession(getTe()->currentSession, 0); | 965 | doneSession(getTe()->currentSession, 0); |
953 | } else { | 966 | } else { |
954 | if (te != 0) { | 967 | if (te != 0) { |
955 | te->emitText(cmd+"\r"); | 968 | te->emitText(cmd+"\r"); |
956 | } | 969 | } |
957 | } | 970 | } |
958 | startUp++; | 971 | startUp++; |
959 | } | 972 | } |
960 | 973 | ||
961 | void Konsole::parseCommandLine() { | 974 | void Konsole::parseCommandLine() { |
962 | QString cmd; | 975 | QString cmd; |
963 | // newSession(); | 976 | // newSession(); |
964 | for (int i=1;i< qApp->argc();i++) { | 977 | for (int i=1;i< qApp->argc();i++) { |
965 | if( QString(qApp->argv()[i]) == "-e") { | 978 | if( QString(qApp->argv()[i]) == "-e") { |
966 | i++; | 979 | i++; |
967 | for ( int j=i;j< qApp->argc();j++) { | 980 | for ( int j=i;j< qApp->argc();j++) { |
968 | cmd+=QString(qApp->argv()[j])+" "; | 981 | cmd+=QString(qApp->argv()[j])+" "; |
969 | } | 982 | } |
970 | cmd.stripWhiteSpace(); | 983 | cmd.stripWhiteSpace(); |
971 | system(cmd.latin1()); | 984 | system(cmd.latin1()); |
972 | exit(0);//close(); | 985 | exit(0);//close(); |
973 | } // end -e switch | 986 | } // end -e switch |
974 | } | 987 | } |
975 | startUp++; | 988 | startUp++; |
976 | } | 989 | } |
977 | 990 | ||
978 | void Konsole::changeForegroundColor(const QColor &color) { | 991 | void Konsole::changeForegroundColor(const QColor &color) { |
979 | Config cfg("Konsole"); | 992 | Config cfg("Konsole"); |
980 | cfg.setGroup("Colors"); | 993 | cfg.setGroup("Colors"); |
981 | int r, g, b; | 994 | int r, g, b; |
982 | color.rgb(&r,&g,&b); | 995 | color.rgb(&r,&g,&b); |
983 | foreground.setRgb(r,g,b); | 996 | foreground.setRgb(r,g,b); |
984 | // QString colors; | 997 | |
985 | // colors.sprintf("%d,%d,%d"color.red,color.green,color.blue); | ||
986 | cfg.writeEntry("foreground",color.name()); | 998 | cfg.writeEntry("foreground",color.name()); |
999 | qDebug("foreground "+color.name()); | ||
987 | cfg.write(); | 1000 | cfg.write(); |
988 | 1001 | ||
989 | qDebug("do other dialog"); | 1002 | qDebug("do other dialog"); |
990 | #ifdef QWS_QT_OPIE | 1003 | #ifdef QWS_QT_OPIE |
991 | 1004 | ||
992 | ColorPopupMenu* penColorPopupMenu2 = new ColorPopupMenu(Qt::black, this,"background color"); | 1005 | ColorPopupMenu* penColorPopupMenu2 = new ColorPopupMenu(Qt::black, this,"background color"); |
993 | connect(penColorPopupMenu2, SIGNAL(colorSelected(const QColor&)), this, | 1006 | connect(penColorPopupMenu2, SIGNAL(colorSelected(const QColor&)), this, |
994 | SLOT(changeBackgroundColor(const QColor&))); | 1007 | SLOT(changeBackgroundColor(const QColor&))); |
995 | penColorPopupMenu2->exec(); | 1008 | penColorPopupMenu2->exec(); |
996 | #endif | 1009 | #endif |
997 | } | 1010 | } |
998 | 1011 | ||
999 | void Konsole::changeBackgroundColor(const QColor &color) { | 1012 | void Konsole::changeBackgroundColor(const QColor &color) { |
1000 | 1013 | ||
1001 | qDebug("Change background"); | 1014 | qDebug("Change background"); |
1002 | Config cfg("Konsole"); | 1015 | Config cfg("Konsole"); |
1003 | cfg.setGroup("Colors"); | 1016 | cfg.setGroup("Colors"); |
1004 | int r, g, b; | 1017 | int r, g, b; |
1005 | color.rgb(&r,&g,&b); | 1018 | color.rgb(&r,&g,&b); |
1006 | background.setRgb(r,g,b); | 1019 | background.setRgb(r,g,b); |
1007 | // QString colors; | ||
1008 | // colors.sprintf("%d,%d,%d"color.red,color.green,color.blue); | ||
1009 | cfg.writeEntry("background",color.name()); | 1020 | cfg.writeEntry("background",color.name()); |
1021 | qDebug("background "+color.name()); | ||
1010 | cfg.write(); | 1022 | cfg.write(); |
1011 | } | 1023 | } |
1012 | 1024 | ||
1013 | void Konsole::doWrap() { | 1025 | void Konsole::doWrap() { |
1014 | int i; | 1026 | int i; |
1015 | #ifdef QWS_QT_OPIE | 1027 | #ifdef QWS_QT_OPIE |
1016 | i=-29; | 1028 | i=-29; |
1017 | #else | 1029 | #else |
1018 | i=-28; | 1030 | i=-28; |
1019 | #endif | 1031 | #endif |
1020 | 1032 | ||
1021 | Config cfg("Konsole"); | 1033 | Config cfg("Konsole"); |
1022 | cfg.setGroup("ScrollBar"); | 1034 | cfg.setGroup("ScrollBar"); |
1023 | TEWidget* te = getTe(); | 1035 | TEWidget* te = getTe(); |
1024 | if( !cfg.readBoolEntry("HorzScroll",0)) { | 1036 | if( !cfg.readBoolEntry("HorzScroll",0)) { |
1025 | te->setWrapAt(0); | 1037 | te->setWrapAt(0); |
1026 | configMenu->setItemChecked( i,TRUE); | 1038 | configMenu->setItemChecked( i,TRUE); |
1027 | } else { | 1039 | } else { |
1028 | te->setWrapAt(90); | 1040 | // te->setWrapAt(90); |
1029 | // te->setWrapAt(120); | 1041 | te->setWrapAt(120); |
1030 | configMenu->setItemChecked( i,FALSE); | 1042 | configMenu->setItemChecked( i,FALSE); |
1031 | } | 1043 | } |
1032 | } | 1044 | } |