summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/konsole.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp
index bd33ba6..217d8d8 100644
--- a/core/apps/embeddedkonsole/konsole.cpp
+++ b/core/apps/embeddedkonsole/konsole.cpp
@@ -545,301 +545,301 @@ void Konsole::changeColumns(int columns)
545{ 545{
546 TEWidget* te = getTe(); 546 TEWidget* te = getTe();
547 if (te != 0) { 547 if (te != 0) {
548 setColLin(columns,te->Lines()); 548 setColLin(columns,te->Lines());
549 te->update(); 549 te->update();
550 } 550 }
551} 551}
552 552
553//FIXME: If a child dies during session swap, 553//FIXME: If a child dies during session swap,
554// this routine might be called before 554// this routine might be called before
555// session swap is completed. 555// session swap is completed.
556 556
557void Konsole::doneSession(TESession*, int ) 557void Konsole::doneSession(TESession*, int )
558{ 558{
559 TEWidget *te = getTe(); 559 TEWidget *te = getTe();
560 if (te != 0) { 560 if (te != 0) {
561 te->currentSession->setConnect(FALSE); 561 te->currentSession->setConnect(FALSE);
562 tab->removeTab(te); 562 tab->removeTab(te);
563 delete te->currentSession; 563 delete te->currentSession;
564 delete te; 564 delete te;
565 nsessions--; 565 nsessions--;
566 } 566 }
567 567
568 if (nsessions == 0) { 568 if (nsessions == 0) {
569 close(); 569 close();
570 } 570 }
571} 571}
572 572
573void Konsole::newSession() { 573void Konsole::newSession() {
574 if(nsessions < 15) { // seems to be something weird about 16 tabs on the Zaurus.... memory? 574 if(nsessions < 15) { // seems to be something weird about 16 tabs on the Zaurus.... memory?
575 TEWidget* te = new TEWidget(tab); 575 TEWidget* te = new TEWidget(tab);
576// te->setBackgroundMode(PaletteBase); //we want transparent!! 576// te->setBackgroundMode(PaletteBase); //we want transparent!!
577 te->setVTFont(fonts.at(cfont)->getFont()); 577 te->setVTFont(fonts.at(cfont)->getFont());
578 tab->addTab(te); 578 tab->addTab(te);
579 TESession* se = new TESession(this, te, se_pgm, se_args, "xterm"); 579 TESession* se = new TESession(this, te, se_pgm, se_args, "xterm");
580 te->currentSession = se; 580 te->currentSession = se;
581 connect( se, SIGNAL(done(TESession*,int)), this, SLOT(doneSession(TESession*,int)) ); 581 connect( se, SIGNAL(done(TESession*,int)), this, SLOT(doneSession(TESession*,int)) );
582 se->run(); 582 se->run();
583 se->setConnect(TRUE); 583 se->setConnect(TRUE);
584 se->setHistory(b_scroll); 584 se->setHistory(b_scroll);
585 tab->setCurrentPage(nsessions); 585 tab->setCurrentPage(nsessions);
586 nsessions++; 586 nsessions++;
587 setColor(); 587 setColor();
588 } 588 }
589} 589}
590 590
591TEWidget* Konsole::getTe() { 591TEWidget* Konsole::getTe() {
592 if (nsessions) { 592 if (nsessions) {
593 return (TEWidget *) tab->currentPage(); 593 return (TEWidget *) tab->currentPage();
594 } else { 594 } else {
595 return 0; 595 return 0;
596 } 596 }
597} 597}
598 598
599void Konsole::switchSession(QWidget* w) { 599void Konsole::switchSession(QWidget* w) {
600 TEWidget* te = (TEWidget *) w; 600 TEWidget* te = (TEWidget *) w;
601 601
602 QFont teFnt = te->getVTFont(); 602 QFont teFnt = te->getVTFont();
603 for(uint i = 0; i < fonts.count(); i++) { 603 for(uint i = 0; i < fonts.count(); i++) {
604 VTFont *fnt = fonts.at(i); 604 VTFont *fnt = fonts.at(i);
605 bool cf = fnt->getFont() == teFnt; 605 bool cf = fnt->getFont() == teFnt;
606 fontList->setItemChecked(i, cf); 606 fontList->setItemChecked(i, cf);
607 if (cf) { 607 if (cf) {
608 cfont = i; 608 cfont = i;
609 } 609 }
610 } 610 }
611} 611}
612 612
613/// ------------------------------- some new stuff by L.J. Potter 613/// ------------------------------- some new stuff by L.J. Potter
614void Konsole::colorMenuSelected(int iD) 614void Konsole::colorMenuSelected(int iD)
615{ // this is NOT pretty, elegant or anything else besides functional 615{ // this is NOT pretty, elegant or anything else besides functional
616// QString temp; 616// QString temp;
617// qDebug( temp.sprintf("colormenu %d", iD)); 617// qDebug( temp.sprintf("colormenu %d", iD));
618 TEWidget* te = getTe(); 618 TEWidget* te = getTe();
619 Config cfg("Konsole"); 619 Config cfg("Konsole");
620 cfg.setGroup("Colors"); 620 cfg.setGroup("Colors");
621 QColor foreground; 621 QColor foreground;
622 QColor background; 622 QColor background;
623 colorMenu->setItemChecked(lastSelectedMenu,FALSE); 623 colorMenu->setItemChecked(lastSelectedMenu,FALSE);
624 ColorEntry m_table[TABLE_COLORS]; 624 ColorEntry m_table[TABLE_COLORS];
625 const ColorEntry * defaultCt=te->getdefaultColorTable(); 625 const ColorEntry * defaultCt=te->getdefaultColorTable();
626 /////////// fore back 626 /////////// fore back
627 int i; 627 int i;
628 if(iD==-9) { // default default 628 if(iD==-9) { // default default
629 for (i = 0; i < TABLE_COLORS; i++) { 629 for (i = 0; i < TABLE_COLORS; i++) {
630 m_table[i].color = defaultCt[i].color; 630 m_table[i].color = defaultCt[i].color;
631 if(i==1 || i == 11) 631 if(i==1 || i == 11)
632 m_table[i].transparent=1; 632 m_table[i].transparent=1;
633 cfg.writeEntry("Schema","98"); 633 cfg.writeEntry("Schema","98");
634 colorMenu->setItemChecked(-9,TRUE); 634 colorMenu->setItemChecked(-9,TRUE);
635 } 635 }
636 } else { 636 } else {
637 if(iD==-6) { // green black 637 if(iD==-6) { // green black
638 foreground.setRgb(0x18,255,0x18); 638 foreground.setRgb(0x18,255,0x18);
639 background.setRgb(0x00,0x00,0x00); 639 background.setRgb(0x00,0x00,0x00);
640 cfg.writeEntry("Schema","6"); 640 cfg.writeEntry("Schema","6");
641 colorMenu->setItemChecked(-6,TRUE); 641 colorMenu->setItemChecked(-6,TRUE);
642 } 642 }
643 if(iD==-7) { // black white 643 if(iD==-7) { // black white
644 foreground.setRgb(0x00,0x00,0x00); 644 foreground.setRgb(0x00,0x00,0x00);
645 background.setRgb(0xFF,0xFF,0xFF); 645 background.setRgb(0xFF,0xFF,0xFF);
646 cfg.writeEntry("Schema","7"); 646 cfg.writeEntry("Schema","7");
647 colorMenu->setItemChecked(-7,TRUE); 647 colorMenu->setItemChecked(-7,TRUE);
648 } 648 }
649 if(iD==-8) { // white black 649 if(iD==-8) { // white black
650 foreground.setRgb(0xFF,0xFF,0xFF); 650 foreground.setRgb(0xFF,0xFF,0xFF);
651 background.setRgb(0x00,0x00,0x00); 651 background.setRgb(0x00,0x00,0x00);
652 cfg.writeEntry("Schema","8"); 652 cfg.writeEntry("Schema","8");
653 colorMenu->setItemChecked(-8,TRUE); 653 colorMenu->setItemChecked(-8,TRUE);
654 } 654 }
655 if(iD==-10) {// Black, Red 655 if(iD==-10) {// Black, Red
656 foreground.setRgb(0x00,0x00,0x00); 656 foreground.setRgb(0x00,0x00,0x00);
657 background.setRgb(0xB2,0x18,0x18); 657 background.setRgb(0xB2,0x18,0x18);
658 cfg.writeEntry("Schema","10"); 658 cfg.writeEntry("Schema","10");
659 colorMenu->setItemChecked(-10,TRUE); 659 colorMenu->setItemChecked(-10,TRUE);
660 } 660 }
661 if(iD==-11) {// Red, Black 661 if(iD==-11) {// Red, Black
662 foreground.setRgb(230,31,31); //0xB2,0x18,0x18 662 foreground.setRgb(230,31,31); //0xB2,0x18,0x18
663 background.setRgb(0x00,0x00,0x00); 663 background.setRgb(0x00,0x00,0x00);
664 cfg.writeEntry("Schema","11"); 664 cfg.writeEntry("Schema","11");
665 colorMenu->setItemChecked(-11,TRUE); 665 colorMenu->setItemChecked(-11,TRUE);
666 } 666 }
667 if(iD==-12) {// Green, Yellow - is ugly 667 if(iD==-12) {// Green, Yellow - is ugly
668// foreground.setRgb(0x18,0xB2,0x18); 668// foreground.setRgb(0x18,0xB2,0x18);
669 foreground.setRgb(36,139,10); 669 foreground.setRgb(36,139,10);
670// background.setRgb(0xB2,0x68,0x18); 670// background.setRgb(0xB2,0x68,0x18);
671 background.setRgb(255,255,0); 671 background.setRgb(255,255,0);
672 cfg.writeEntry("Schema","12"); 672 cfg.writeEntry("Schema","12");
673 colorMenu->setItemChecked(-12,TRUE); 673 colorMenu->setItemChecked(-12,TRUE);
674 } 674 }
675 if(iD==-13) {// Blue, Magenta 675 if(iD==-13) {// Blue, Magenta
676 foreground.setRgb(0x18,0xB2,0xB2); 676 foreground.setRgb(0x18,0xB2,0xB2);
677 background.setRgb(0x18,0x18,0xB2); 677 background.setRgb(0x18,0x18,0xB2);
678 cfg.writeEntry("Schema","13"); 678 cfg.writeEntry("Schema","13");
679 colorMenu->setItemChecked(-13,TRUE); 679 colorMenu->setItemChecked(-13,TRUE);
680 } 680 }
681 if(iD==-14) {// Magenta, Blue 681 if(iD==-14) {// Magenta, Blue
682 foreground.setRgb(0x18,0x18,0xB2); 682 foreground.setRgb(0x18,0x18,0xB2);
683 background.setRgb(0x18,0xB2,0xB2); 683 background.setRgb(0x18,0xB2,0xB2);
684 cfg.writeEntry("Schema","14"); 684 cfg.writeEntry("Schema","14");
685 colorMenu->setItemChecked(-14,TRUE); 685 colorMenu->setItemChecked(-14,TRUE);
686 } 686 }
687 if(iD==-15) {// Cyan, White 687 if(iD==-15) {// Cyan, White
688 foreground.setRgb(0x18,0xB2,0xB2); 688 foreground.setRgb(0x18,0xB2,0xB2);
689 background.setRgb(0xFF,0xFF,0xFF); 689 background.setRgb(0xFF,0xFF,0xFF);
690 cfg.writeEntry("Schema","15"); 690 cfg.writeEntry("Schema","15");
691 colorMenu->setItemChecked(-15,TRUE); 691 colorMenu->setItemChecked(-15,TRUE);
692 } 692 }
693 if(iD==-16) {// White, Cyan 693 if(iD==-16) {// White, Cyan
694 background.setRgb(0x18,0xB2,0xB2); 694 background.setRgb(0x18,0xB2,0xB2);
695 foreground.setRgb(0xFF,0xFF,0xFF); 695 foreground.setRgb(0xFF,0xFF,0xFF);
696 cfg.writeEntry("Schema","16"); 696 cfg.writeEntry("Schema","16");
697 colorMenu->setItemChecked(-16,TRUE); 697 colorMenu->setItemChecked(-16,TRUE);
698 } 698 }
699 if(iD==-17) {// Black, Blue 699 if(iD==-17) {// Black, Blue
700 background.setRgb(0x00,0x00,0x00); 700 background.setRgb(0x00,0x00,0x00);
701 foreground.setRgb(0x18,0xB2,0xB2); 701 foreground.setRgb(0x18,0xB2,0xB2);
702 cfg.writeEntry("Schema","17"); 702 cfg.writeEntry("Schema","17");
703 colorMenu->setItemChecked(-17,TRUE); 703 colorMenu->setItemChecked(-17,TRUE);
704 } 704 }
705 if(iD==-18) {// Black, Gold 705 if(iD==-18) {// Black, Gold
706 background.setRgb(0x00,0x00,0x00); 706 background.setRgb(0x00,0x00,0x00);
707 foreground.setRgb(255,215,0); 707 foreground.setRgb(255,215,0);
708 cfg.writeEntry("Schema","18"); 708 cfg.writeEntry("Schema","18");
709 colorMenu->setItemChecked(-18,TRUE); 709 colorMenu->setItemChecked(-18,TRUE);
710 } 710 }
711 711
712 for (i = 0; i < TABLE_COLORS; i++) { 712 for (i = 0; i < TABLE_COLORS; i++) {
713 if(i==0 || i == 10) { 713 if(i==0 || i == 10) {
714 m_table[i].color = foreground; 714 m_table[i].color = foreground;
715 } 715 }
716 else if(i==1 || i == 11) { 716 else if(i==1 || i == 11) {
717 m_table[i].color = background; m_table[i].transparent=0; 717 m_table[i].color = background; m_table[i].transparent=0;
718 } 718 }
719 else 719 else
720 m_table[i].color = defaultCt[i].color; 720 m_table[i].color = defaultCt[i].color;
721 } 721 }
722 } 722 }
723 lastSelectedMenu = iD; 723 lastSelectedMenu = iD;
724 te->setColorTable(m_table); 724 te->setColorTable(m_table);
725 update(); 725 update();
726} 726}
727 727
728void Konsole::configMenuSelected(int iD) 728void Konsole::configMenuSelected(int iD)
729{ 729{
730// QString temp; 730// QString temp;
731// qDebug( temp.sprintf("configmenu %d",iD)); 731// qDebug( temp.sprintf("configmenu %d",iD));
732 TEWidget* te = getTe(); 732 TEWidget* te = getTe();
733 Config cfg("Konsole"); 733 Config cfg("Konsole");
734 cfg.setGroup("Menubar"); 734 cfg.setGroup("Menubar");
735 if( iD == -4) { 735 if( iD == -4) {
736 cfg.setGroup("Tabs"); 736 cfg.setGroup("Tabs");
737 QString tmp=cfg.readEntry("Position","Top"); 737 QString tmp=cfg.readEntry("Position","Bottom");
738 738
739 if(tmp=="Top") { 739 if(tmp=="Top") {
740 tab->setTabPosition(QTabWidget::Bottom); 740 tab->setTabPosition(QTabWidget::Bottom);
741 configMenu->changeItem( iD,"Tabs on Top"); 741 configMenu->changeItem( iD,"Tabs on Top");
742 cfg.writeEntry("Position","Bottom"); 742 cfg.writeEntry("Position","Bottom");
743 } else { 743 } else {
744 tab->setTabPosition(QTabWidget::Top); 744 tab->setTabPosition(QTabWidget::Top);
745 configMenu->changeItem( iD,"Tabs on Bottom"); 745 configMenu->changeItem( iD,"Tabs on Bottom");
746 cfg.writeEntry("Position","Top"); 746 cfg.writeEntry("Position","Top");
747 } 747 }
748 } 748 }
749} 749}
750 750
751void Konsole::changeCommand(const QString &text, int c) 751void Konsole::changeCommand(const QString &text, int c)
752{ 752{
753 Config cfg("Konsole"); 753 Config cfg("Konsole");
754 cfg.setGroup("Commands"); 754 cfg.setGroup("Commands");
755 if(commonCmds[c] != text) { 755 if(commonCmds[c] != text) {
756 cfg.writeEntry(QString::number(c),text); 756 cfg.writeEntry(QString::number(c),text);
757 commonCombo->clearEdit(); 757 commonCombo->clearEdit();
758 commonCombo->setCurrentItem(c); 758 commonCombo->setCurrentItem(c);
759 } 759 }
760} 760}
761 761
762void Konsole::setColor() 762void Konsole::setColor()
763{ 763{
764 Config cfg("Konsole"); 764 Config cfg("Konsole");
765 cfg.setGroup("Colors"); 765 cfg.setGroup("Colors");
766 int scheme = cfg.readNumEntry("Schema",1); 766 int scheme = cfg.readNumEntry("Schema",1);
767 if(scheme != 1) colorMenuSelected( -scheme); 767 if(scheme != 1) colorMenuSelected( -scheme);
768} 768}
769 769
770void Konsole::scrollMenuSelected(int index) 770void Konsole::scrollMenuSelected(int index)
771{ 771{
772// QString temp; 772// QString temp;
773// qDebug( temp.sprintf("scrollbar menu %d",index)); 773// qDebug( temp.sprintf("scrollbar menu %d",index));
774 TEWidget* te = getTe(); 774 TEWidget* te = getTe();
775 Config cfg("Konsole"); 775 Config cfg("Konsole");
776 cfg.setGroup("Scrollbar"); 776 cfg.setGroup("Scrollbar");
777 switch( index){ 777 switch( index){
778 case -24: 778 case -24:
779 te->setScrollbarLocation(0); 779 te->setScrollbarLocation(0);
780 cfg.writeEntry("Position",0); 780 cfg.writeEntry("Position",0);
781 break; 781 break;
782 case -25: 782 case -25:
783 te->setScrollbarLocation(1); 783 te->setScrollbarLocation(1);
784 cfg.writeEntry("Position",1); 784 cfg.writeEntry("Position",1);
785 break; 785 break;
786 case -26: 786 case -26:
787 te->setScrollbarLocation(2); 787 te->setScrollbarLocation(2);
788 cfg.writeEntry("Position",2); 788 cfg.writeEntry("Position",2);
789 break; 789 break;
790 }; 790 };
791 791
792} 792}
793 793
794void Konsole::editCommandListMenuSelected(int iD) 794void Konsole::editCommandListMenuSelected(int iD)
795{ 795{
796// QString temp; 796// QString temp;
797// qDebug( temp.sprintf("edit command list %d",iD)); 797// qDebug( temp.sprintf("edit command list %d",iD));
798 TEWidget* te = getTe(); 798 TEWidget* te = getTe();
799 Config cfg("Konsole"); 799 Config cfg("Konsole");
800 cfg.setGroup("Menubar"); 800 cfg.setGroup("Menubar");
801 if( iD == -3) { 801 if( iD == -3) {
802 if(!secondToolBar->isHidden()) { 802 if(!secondToolBar->isHidden()) {
803 secondToolBar->hide(); 803 secondToolBar->hide();
804 configMenu->changeItem( iD,"Show Command List"); 804 configMenu->changeItem( iD,"Show Command List");
805 cfg.writeEntry("Hidden","TRUE"); 805 cfg.writeEntry("Hidden","TRUE");
806 configMenu->setItemEnabled(-22 ,FALSE); 806 configMenu->setItemEnabled(-22 ,FALSE);
807 } else { 807 } else {
808 secondToolBar->show(); 808 secondToolBar->show();
809 configMenu->changeItem( iD,"Hide Command List"); 809 configMenu->changeItem( iD,"Hide Command List");
810 cfg.writeEntry("Hidden","FALSE"); 810 cfg.writeEntry("Hidden","FALSE");
811 configMenu->setItemEnabled(-22 ,TRUE); 811 configMenu->setItemEnabled(-22 ,TRUE);
812 812
813 if(cfg.readEntry("EditEnabled","FALSE")=="TRUE") { 813 if(cfg.readEntry("EditEnabled","FALSE")=="TRUE") {
814 configMenu->setItemChecked(-22,TRUE); 814 configMenu->setItemChecked(-22,TRUE);
815 commonCombo->setEditable( TRUE ); 815 commonCombo->setEditable( TRUE );
816 } else { 816 } else {
817 configMenu->setItemChecked(-22,FALSE); 817 configMenu->setItemChecked(-22,FALSE);
818 commonCombo->setEditable( FALSE ); 818 commonCombo->setEditable( FALSE );
819 } 819 }
820 } 820 }
821 } 821 }
822 if( iD == -22) { 822 if( iD == -22) {
823 cfg.setGroup("Commands"); 823 cfg.setGroup("Commands");
824// qDebug("enableCommandEdit"); 824// qDebug("enableCommandEdit");
825 if( !configMenu->isItemChecked(iD) ) { 825 if( !configMenu->isItemChecked(iD) ) {
826 commonCombo->setEditable( TRUE ); 826 commonCombo->setEditable( TRUE );
827 configMenu->setItemChecked(iD,TRUE); 827 configMenu->setItemChecked(iD,TRUE);
828 commonCombo->setCurrentItem(0); 828 commonCombo->setCurrentItem(0);
829 cfg.writeEntry("EditEnabled","TRUE"); 829 cfg.writeEntry("EditEnabled","TRUE");
830 } else { 830 } else {
831 commonCombo->setEditable( FALSE ); 831 commonCombo->setEditable( FALSE );
832 configMenu->setItemChecked(iD,FALSE); 832 configMenu->setItemChecked(iD,FALSE);
833 cfg.writeEntry("EditEnabled","FALSE"); 833 cfg.writeEntry("EditEnabled","FALSE");
834 commonCombo->setFocusPolicy(QWidget::NoFocus); 834 commonCombo->setFocusPolicy(QWidget::NoFocus);
835 te->setFocus(); 835 te->setFocus();
836 } 836 }
837 } 837 }
838 if(iD == -23) { 838 if(iD == -23) {
839 // "edit commands" 839 // "edit commands"
840 CommandEditDialog *m = new CommandEditDialog(this); 840 CommandEditDialog *m = new CommandEditDialog(this);
841 connect(m,SIGNAL(commandsEdited()),this,SLOT(initCommandList())); 841 connect(m,SIGNAL(commandsEdited()),this,SLOT(initCommandList()));
842 m->showMaximized(); 842 m->showMaximized();
843 } 843 }
844 844
845} 845}