-rw-r--r-- | core/apps/embeddedkonsole/konsole.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp index 9be4674..275a9a8 100644 --- a/core/apps/embeddedkonsole/konsole.cpp +++ b/core/apps/embeddedkonsole/konsole.cpp | |||
@@ -427,389 +427,387 @@ void Konsole::initSession(const char*, QStrList &) | |||
427 | 427 | ||
428 | Konsole::~Konsole() | 428 | Konsole::~Konsole() |
429 | { | 429 | { |
430 | while (nsessions > 0) { | 430 | while (nsessions > 0) { |
431 | doneSession(getTe()->currentSession, 0); | 431 | doneSession(getTe()->currentSession, 0); |
432 | } | 432 | } |
433 | 433 | ||
434 | Config cfg("Konsole"); | 434 | Config cfg("Konsole"); |
435 | cfg.setGroup("Konsole"); | 435 | cfg.setGroup("Konsole"); |
436 | cfg.writeEntry("FontID", cfont); | 436 | cfg.writeEntry("FontID", cfont); |
437 | } | 437 | } |
438 | 438 | ||
439 | void Konsole::fontChanged(int f) | 439 | void Konsole::fontChanged(int f) |
440 | { | 440 | { |
441 | VTFont* font = fonts.at(f); | 441 | VTFont* font = fonts.at(f); |
442 | if (font != 0) { | 442 | if (font != 0) { |
443 | for(uint i = 0; i < fonts.count(); i++) { | 443 | for(uint i = 0; i < fonts.count(); i++) { |
444 | fontList->setItemChecked(i, (i == (uint) f) ? TRUE : FALSE); | 444 | fontList->setItemChecked(i, (i == (uint) f) ? TRUE : FALSE); |
445 | } | 445 | } |
446 | 446 | ||
447 | cfont = f; | 447 | cfont = f; |
448 | 448 | ||
449 | TEWidget* te = getTe(); | 449 | TEWidget* te = getTe(); |
450 | if (te != 0) { | 450 | if (te != 0) { |
451 | te->setVTFont(font->getFont()); | 451 | te->setVTFont(font->getFont()); |
452 | } | 452 | } |
453 | } | 453 | } |
454 | } | 454 | } |
455 | 455 | ||
456 | 456 | ||
457 | void Konsole::enterCommand(int c) | 457 | void Konsole::enterCommand(int c) |
458 | { | 458 | { |
459 | TEWidget* te = getTe(); | 459 | TEWidget* te = getTe(); |
460 | if (te != 0) { | 460 | if (te != 0) { |
461 | if(!commonCombo->editable()) { | 461 | if(!commonCombo->editable()) { |
462 | QString text = commonCombo->text(c); //commonCmds[c]; | 462 | QString text = commonCombo->text(c); //commonCmds[c]; |
463 | te->emitText(text); | 463 | te->emitText(text); |
464 | } else { | 464 | } else { |
465 | changeCommand( commonCombo->text(c), c); | 465 | changeCommand( commonCombo->text(c), c); |
466 | } | 466 | } |
467 | } | 467 | } |
468 | } | 468 | } |
469 | 469 | ||
470 | void Konsole::hitEnter() | 470 | void Konsole::hitEnter() |
471 | { | 471 | { |
472 | TEWidget* te = getTe(); | 472 | TEWidget* te = getTe(); |
473 | if (te != 0) { | 473 | if (te != 0) { |
474 | te->emitText(QString("\r")); | 474 | te->emitText(QString("\r")); |
475 | } | 475 | } |
476 | } | 476 | } |
477 | 477 | ||
478 | void Konsole::hitSpace() | 478 | void Konsole::hitSpace() |
479 | { | 479 | { |
480 | TEWidget* te = getTe(); | 480 | TEWidget* te = getTe(); |
481 | if (te != 0) { | 481 | if (te != 0) { |
482 | te->emitText(QString(" ")); | 482 | te->emitText(QString(" ")); |
483 | } | 483 | } |
484 | } | 484 | } |
485 | 485 | ||
486 | void Konsole::hitTab() | 486 | void Konsole::hitTab() |
487 | { | 487 | { |
488 | TEWidget* te = getTe(); | 488 | TEWidget* te = getTe(); |
489 | if (te != 0) { | 489 | if (te != 0) { |
490 | te->emitText(QString("\t")); | 490 | te->emitText(QString("\t")); |
491 | } | 491 | } |
492 | } | 492 | } |
493 | 493 | ||
494 | void Konsole::hitPaste() | 494 | void Konsole::hitPaste() |
495 | { | 495 | { |
496 | TEWidget* te = getTe(); | 496 | TEWidget* te = getTe(); |
497 | if (te != 0) { | 497 | if (te != 0) { |
498 | te->pasteClipboard(); | 498 | te->pasteClipboard(); |
499 | } | 499 | } |
500 | } | 500 | } |
501 | 501 | ||
502 | void Konsole::hitUp() | 502 | void Konsole::hitUp() |
503 | { | 503 | { |
504 | TEWidget* te = getTe(); | 504 | TEWidget* te = getTe(); |
505 | if (te != 0) { | 505 | if (te != 0) { |
506 | QKeyEvent ke( QKeyEvent::KeyPress, Qt::Key_Up, 0, 0); | 506 | QKeyEvent ke( QKeyEvent::KeyPress, Qt::Key_Up, 0, 0); |
507 | QApplication::sendEvent( te, &ke ); | 507 | QApplication::sendEvent( te, &ke ); |
508 | } | 508 | } |
509 | } | 509 | } |
510 | 510 | ||
511 | void Konsole::hitDown() | 511 | void Konsole::hitDown() |
512 | { | 512 | { |
513 | TEWidget* te = getTe(); | 513 | TEWidget* te = getTe(); |
514 | if (te != 0) { | 514 | if (te != 0) { |
515 | QKeyEvent ke( QKeyEvent::KeyPress, Qt::Key_Down, 0, 0); | 515 | QKeyEvent ke( QKeyEvent::KeyPress, Qt::Key_Down, 0, 0); |
516 | QApplication::sendEvent( te, &ke ); | 516 | QApplication::sendEvent( te, &ke ); |
517 | } | 517 | } |
518 | } | 518 | } |
519 | 519 | ||
520 | /** | 520 | /** |
521 | This function calculates the size of the external widget | 521 | This function calculates the size of the external widget |
522 | needed for the internal widget to be | 522 | needed for the internal widget to be |
523 | */ | 523 | */ |
524 | QSize Konsole::calcSize(int columns, int lines) { | 524 | QSize Konsole::calcSize(int columns, int lines) { |
525 | TEWidget* te = getTe(); | 525 | TEWidget* te = getTe(); |
526 | if (te != 0) { | 526 | if (te != 0) { |
527 | QSize size = te->calcSize(columns, lines); | 527 | QSize size = te->calcSize(columns, lines); |
528 | return size; | 528 | return size; |
529 | } else { | 529 | } else { |
530 | QSize size; | 530 | QSize size; |
531 | return size; | 531 | return size; |
532 | } | 532 | } |
533 | } | 533 | } |
534 | 534 | ||
535 | /** | 535 | /** |
536 | sets application window to a size based on columns X lines of the te | 536 | sets application window to a size based on columns X lines of the te |
537 | guest widget. Call with (0,0) for setting default size. | 537 | guest widget. Call with (0,0) for setting default size. |
538 | */ | 538 | */ |
539 | 539 | ||
540 | void Konsole::setColLin(int columns, int lines) | 540 | void Konsole::setColLin(int columns, int lines) |
541 | { | 541 | { |
542 | qDebug("konsole::setColLin:: Columns %d", columns); | 542 | qDebug("konsole::setColLin:: Columns %d", columns); |
543 | 543 | ||
544 | if ((columns==0) || (lines==0)) | 544 | if ((columns==0) || (lines==0)) |
545 | { | 545 | { |
546 | if (defaultSize.isEmpty()) // not in config file : set default value | 546 | if (defaultSize.isEmpty()) // not in config file : set default value |
547 | { | 547 | { |
548 | defaultSize = calcSize(80,24); | 548 | defaultSize = calcSize(80,24); |
549 | // notifySize(24,80); // set menu items (strange arg order !) | 549 | // notifySize(24,80); // set menu items (strange arg order !) |
550 | } | 550 | } |
551 | resize(defaultSize); | 551 | resize(defaultSize); |
552 | } else { | 552 | } else { |
553 | resize(calcSize(columns, lines)); | 553 | resize(calcSize(columns, lines)); |
554 | // notifySize(lines,columns); // set menu items (strange arg order !) | 554 | // notifySize(lines,columns); // set menu items (strange arg order !) |
555 | } | 555 | } |
556 | } | 556 | } |
557 | 557 | ||
558 | /* | 558 | /* |
559 | void Konsole::setFont(int fontno) | 559 | void Konsole::setFont(int fontno) |
560 | { | 560 | { |
561 | QFont f; | 561 | QFont f; |
562 | if (fontno == 0) | 562 | if (fontno == 0) |
563 | f = defaultFont = QFont( "Helvetica", 12 ); | 563 | f = defaultFont = QFont( "Helvetica", 12 ); |
564 | else | 564 | else |
565 | if (fonts[fontno][0] == '-') | 565 | if (fonts[fontno][0] == '-') |
566 | f.setRawName( fonts[fontno] ); | 566 | f.setRawName( fonts[fontno] ); |
567 | else | 567 | else |
568 | { | 568 | { |
569 | f.setFamily(fonts[fontno]); | 569 | f.setFamily(fonts[fontno]); |
570 | f.setRawMode( TRUE ); | 570 | f.setRawMode( TRUE ); |
571 | } | 571 | } |
572 | if ( !f.exactMatch() && fontno != 0) | 572 | if ( !f.exactMatch() && fontno != 0) |
573 | { | 573 | { |
574 | QString msg = i18n("Font `%1' not found.\nCheck README.linux.console for help.").arg(fonts[fontno]); | 574 | QString msg = i18n("Font `%1' not found.\nCheck README.linux.console for help.").arg(fonts[fontno]); |
575 | QMessageBox(this, msg); | 575 | QMessageBox(this, msg); |
576 | return; | 576 | return; |
577 | } | 577 | } |
578 | if (se) se->setFontNo(fontno); | 578 | if (se) se->setFontNo(fontno); |
579 | te->setVTFont(f); | 579 | te->setVTFont(f); |
580 | n_font = fontno; | 580 | n_font = fontno; |
581 | } | 581 | } |
582 | */ | 582 | */ |
583 | 583 | ||
584 | // --| color selection |------------------------------------------------------- | 584 | // --| color selection |------------------------------------------------------- |
585 | 585 | ||
586 | void Konsole::changeColumns(int columns) | 586 | void Konsole::changeColumns(int columns) |
587 | { | 587 | { |
588 | qDebug("change columns"); | 588 | qDebug("change columns"); |
589 | TEWidget* te = getTe(); | 589 | TEWidget* te = getTe(); |
590 | if (te != 0) { | 590 | if (te != 0) { |
591 | setColLin(columns,te->Lines()); | 591 | setColLin(columns,te->Lines()); |
592 | te->update(); | 592 | te->update(); |
593 | } | 593 | } |
594 | } | 594 | } |
595 | 595 | ||
596 | //FIXME: If a child dies during session swap, | 596 | //FIXME: If a child dies during session swap, |
597 | // this routine might be called before | 597 | // this routine might be called before |
598 | // session swap is completed. | 598 | // session swap is completed. |
599 | 599 | ||
600 | void Konsole::doneSession(TESession*, int ) | 600 | void Konsole::doneSession(TESession*, int ) |
601 | { | 601 | { |
602 | TEWidget *te = getTe(); | 602 | TEWidget *te = getTe(); |
603 | if (te != 0) { | 603 | if (te != 0) { |
604 | te->currentSession->setConnect(FALSE); | 604 | te->currentSession->setConnect(FALSE); |
605 | tab->removeTab(te); | 605 | tab->removeTab(te); |
606 | delete te->currentSession; | 606 | delete te->currentSession; |
607 | delete te; | 607 | delete te; |
608 | nsessions--; | 608 | nsessions--; |
609 | } | 609 | } |
610 | 610 | ||
611 | if (nsessions == 0) { | 611 | if (nsessions == 0) { |
612 | close(); | 612 | close(); |
613 | } | 613 | } |
614 | } | 614 | } |
615 | 615 | ||
616 | void Konsole::newSession() { | 616 | void Konsole::newSession() { |
617 | if(nsessions < 15) { // seems to be something weird about 16 tabs on the Zaurus.... memory? | 617 | if(nsessions < 15) { // seems to be something weird about 16 tabs on the Zaurus.... memory? |
618 | TEWidget* te = new TEWidget(tab); | 618 | TEWidget* te = new TEWidget(tab); |
619 | if(nsessions == 0) { //set this the first time only | 619 | Config c("Konsole"); |
620 | Config c("Konsole"); | 620 | c.setGroup("Menubar"); |
621 | c.setGroup("Menubar"); | 621 | te->useBeep=c.readBoolEntry("useBeep",0); |
622 | te->useBeep=c.readBoolEntry("useBeep",0); | ||
623 | } | ||
624 | 622 | ||
625 | // te->setBackgroundMode(PaletteBase); //we want transparent!! | 623 | // te->setBackgroundMode(PaletteBase); //we want transparent!! |
626 | te->setVTFont(fonts.at(cfont)->getFont()); | 624 | te->setVTFont(fonts.at(cfont)->getFont()); |
627 | tab->addTab(te); | 625 | tab->addTab(te); |
628 | TESession* se = new TESession(this, te, se_pgm, se_args, "xterm"); | 626 | TESession* se = new TESession(this, te, se_pgm, se_args, "xterm"); |
629 | te->currentSession = se; | 627 | te->currentSession = se; |
630 | connect( se, SIGNAL(done(TESession*,int)), this, SLOT(doneSession(TESession*,int)) ); | 628 | connect( se, SIGNAL(done(TESession*,int)), this, SLOT(doneSession(TESession*,int)) ); |
631 | se->run(); | 629 | se->run(); |
632 | se->setConnect(TRUE); | 630 | se->setConnect(TRUE); |
633 | se->setHistory(b_scroll); | 631 | se->setHistory(b_scroll); |
634 | tab->setCurrentPage(nsessions); | 632 | tab->setCurrentPage(nsessions); |
635 | nsessions++; | 633 | nsessions++; |
636 | doWrap(); | 634 | doWrap(); |
637 | setColor(); | 635 | setColor(); |
638 | } | 636 | } |
639 | } | 637 | } |
640 | 638 | ||
641 | TEWidget* Konsole::getTe() { | 639 | TEWidget* Konsole::getTe() { |
642 | if (nsessions) { | 640 | if (nsessions) { |
643 | return (TEWidget *) tab->currentPage(); | 641 | return (TEWidget *) tab->currentPage(); |
644 | } else { | 642 | } else { |
645 | return 0; | 643 | return 0; |
646 | } | 644 | } |
647 | } | 645 | } |
648 | 646 | ||
649 | void Konsole::switchSession(QWidget* w) { | 647 | void Konsole::switchSession(QWidget* w) { |
650 | TEWidget* te = (TEWidget *) w; | 648 | TEWidget* te = (TEWidget *) w; |
651 | 649 | ||
652 | QFont teFnt = te->getVTFont(); | 650 | QFont teFnt = te->getVTFont(); |
653 | for(uint i = 0; i < fonts.count(); i++) { | 651 | for(uint i = 0; i < fonts.count(); i++) { |
654 | VTFont *fnt = fonts.at(i); | 652 | VTFont *fnt = fonts.at(i); |
655 | bool cf = fnt->getFont() == teFnt; | 653 | bool cf = fnt->getFont() == teFnt; |
656 | fontList->setItemChecked(i, cf); | 654 | fontList->setItemChecked(i, cf); |
657 | if (cf) { | 655 | if (cf) { |
658 | cfont = i; | 656 | cfont = i; |
659 | } | 657 | } |
660 | } | 658 | } |
661 | } | 659 | } |
662 | 660 | ||
663 | void Konsole::colorMenuIsSelected(int iD) { | 661 | void Konsole::colorMenuIsSelected(int iD) { |
664 | fromMenu = TRUE; | 662 | fromMenu = TRUE; |
665 | colorMenuSelected(iD); | 663 | colorMenuSelected(iD); |
666 | } | 664 | } |
667 | 665 | ||
668 | /// ------------------------------- some new stuff by L.J. Potter | 666 | /// ------------------------------- some new stuff by L.J. Potter |
669 | void Konsole::colorMenuSelected(int iD) | 667 | void Konsole::colorMenuSelected(int iD) |
670 | { // this is NOT pretty, elegant or anything else besides functional | 668 | { // this is NOT pretty, elegant or anything else besides functional |
671 | // QString temp; | 669 | // QString temp; |
672 | // qDebug( temp.sprintf("colormenu %d", iD)); | 670 | // qDebug( temp.sprintf("colormenu %d", iD)); |
673 | TEWidget* te = getTe(); | 671 | TEWidget* te = getTe(); |
674 | Config cfg("Konsole"); | 672 | Config cfg("Konsole"); |
675 | cfg.setGroup("Colors"); | 673 | cfg.setGroup("Colors"); |
676 | // QColor foreground; | 674 | // QColor foreground; |
677 | // QColor background; | 675 | // QColor background; |
678 | colorMenu->setItemChecked(lastSelectedMenu,FALSE); | 676 | colorMenu->setItemChecked(lastSelectedMenu,FALSE); |
679 | ColorEntry m_table[TABLE_COLORS]; | 677 | ColorEntry m_table[TABLE_COLORS]; |
680 | const ColorEntry * defaultCt=te->getdefaultColorTable(); | 678 | const ColorEntry * defaultCt=te->getdefaultColorTable(); |
681 | /////////// fore back | 679 | /////////// fore back |
682 | int i; | 680 | int i; |
683 | if(iD==-9) { // default default | 681 | if(iD==-9) { // default default |
684 | for (i = 0; i < TABLE_COLORS; i++) { | 682 | for (i = 0; i < TABLE_COLORS; i++) { |
685 | m_table[i].color = defaultCt[i].color; | 683 | m_table[i].color = defaultCt[i].color; |
686 | if(i==1 || i == 11) | 684 | if(i==1 || i == 11) |
687 | m_table[i].transparent=1; | 685 | m_table[i].transparent=1; |
688 | cfg.writeEntry("Schema","9"); | 686 | cfg.writeEntry("Schema","9"); |
689 | colorMenu->setItemChecked(-9,TRUE); | 687 | colorMenu->setItemChecked(-9,TRUE); |
690 | } | 688 | } |
691 | } else { | 689 | } else { |
692 | if(iD==-6) { // green black | 690 | if(iD==-6) { // green black |
693 | foreground.setRgb(0x18,255,0x18); | 691 | foreground.setRgb(0x18,255,0x18); |
694 | background.setRgb(0x00,0x00,0x00); | 692 | background.setRgb(0x00,0x00,0x00); |
695 | cfg.writeEntry("Schema","6"); | 693 | cfg.writeEntry("Schema","6"); |
696 | colorMenu->setItemChecked(-6,TRUE); | 694 | colorMenu->setItemChecked(-6,TRUE); |
697 | } | 695 | } |
698 | if(iD==-7) { // black white | 696 | if(iD==-7) { // black white |
699 | foreground.setRgb(0x00,0x00,0x00); | 697 | foreground.setRgb(0x00,0x00,0x00); |
700 | background.setRgb(0xFF,0xFF,0xFF); | 698 | background.setRgb(0xFF,0xFF,0xFF); |
701 | cfg.writeEntry("Schema","7"); | 699 | cfg.writeEntry("Schema","7"); |
702 | colorMenu->setItemChecked(-7,TRUE); | 700 | colorMenu->setItemChecked(-7,TRUE); |
703 | } | 701 | } |
704 | if(iD==-8) { // white black | 702 | if(iD==-8) { // white black |
705 | foreground.setRgb(0xFF,0xFF,0xFF); | 703 | foreground.setRgb(0xFF,0xFF,0xFF); |
706 | background.setRgb(0x00,0x00,0x00); | 704 | background.setRgb(0x00,0x00,0x00); |
707 | cfg.writeEntry("Schema","8"); | 705 | cfg.writeEntry("Schema","8"); |
708 | colorMenu->setItemChecked(-8,TRUE); | 706 | colorMenu->setItemChecked(-8,TRUE); |
709 | } | 707 | } |
710 | if(iD==-10) {// Black, Red | 708 | if(iD==-10) {// Black, Red |
711 | foreground.setRgb(0x00,0x00,0x00); | 709 | foreground.setRgb(0x00,0x00,0x00); |
712 | background.setRgb(0xB2,0x18,0x18); | 710 | background.setRgb(0xB2,0x18,0x18); |
713 | cfg.writeEntry("Schema","10"); | 711 | cfg.writeEntry("Schema","10"); |
714 | colorMenu->setItemChecked(-10,TRUE); | 712 | colorMenu->setItemChecked(-10,TRUE); |
715 | } | 713 | } |
716 | if(iD==-11) {// Red, Black | 714 | if(iD==-11) {// Red, Black |
717 | foreground.setRgb(230,31,31); //0xB2,0x18,0x18 | 715 | foreground.setRgb(230,31,31); //0xB2,0x18,0x18 |
718 | background.setRgb(0x00,0x00,0x00); | 716 | background.setRgb(0x00,0x00,0x00); |
719 | cfg.writeEntry("Schema","11"); | 717 | cfg.writeEntry("Schema","11"); |
720 | colorMenu->setItemChecked(-11,TRUE); | 718 | colorMenu->setItemChecked(-11,TRUE); |
721 | } | 719 | } |
722 | if(iD==-12) {// Green, Yellow - is ugly | 720 | if(iD==-12) {// Green, Yellow - is ugly |
723 | // foreground.setRgb(0x18,0xB2,0x18); | 721 | // foreground.setRgb(0x18,0xB2,0x18); |
724 | foreground.setRgb(36,139,10); | 722 | foreground.setRgb(36,139,10); |
725 | // background.setRgb(0xB2,0x68,0x18); | 723 | // background.setRgb(0xB2,0x68,0x18); |
726 | background.setRgb(255,255,0); | 724 | background.setRgb(255,255,0); |
727 | cfg.writeEntry("Schema","12"); | 725 | cfg.writeEntry("Schema","12"); |
728 | colorMenu->setItemChecked(-12,TRUE); | 726 | colorMenu->setItemChecked(-12,TRUE); |
729 | } | 727 | } |
730 | if(iD==-13) {// Blue, Magenta | 728 | if(iD==-13) {// Blue, Magenta |
731 | foreground.setRgb(0x18,0xB2,0xB2); | 729 | foreground.setRgb(0x18,0xB2,0xB2); |
732 | background.setRgb(0x18,0x18,0xB2); | 730 | background.setRgb(0x18,0x18,0xB2); |
733 | cfg.writeEntry("Schema","13"); | 731 | cfg.writeEntry("Schema","13"); |
734 | colorMenu->setItemChecked(-13,TRUE); | 732 | colorMenu->setItemChecked(-13,TRUE); |
735 | } | 733 | } |
736 | if(iD==-14) {// Magenta, Blue | 734 | if(iD==-14) {// Magenta, Blue |
737 | foreground.setRgb(0x18,0x18,0xB2); | 735 | foreground.setRgb(0x18,0x18,0xB2); |
738 | background.setRgb(0x18,0xB2,0xB2); | 736 | background.setRgb(0x18,0xB2,0xB2); |
739 | cfg.writeEntry("Schema","14"); | 737 | cfg.writeEntry("Schema","14"); |
740 | colorMenu->setItemChecked(-14,TRUE); | 738 | colorMenu->setItemChecked(-14,TRUE); |
741 | } | 739 | } |
742 | if(iD==-15) {// Cyan, White | 740 | if(iD==-15) {// Cyan, White |
743 | foreground.setRgb(0x18,0xB2,0xB2); | 741 | foreground.setRgb(0x18,0xB2,0xB2); |
744 | background.setRgb(0xFF,0xFF,0xFF); | 742 | background.setRgb(0xFF,0xFF,0xFF); |
745 | cfg.writeEntry("Schema","15"); | 743 | cfg.writeEntry("Schema","15"); |
746 | colorMenu->setItemChecked(-15,TRUE); | 744 | colorMenu->setItemChecked(-15,TRUE); |
747 | } | 745 | } |
748 | if(iD==-16) {// White, Cyan | 746 | if(iD==-16) {// White, Cyan |
749 | background.setRgb(0x18,0xB2,0xB2); | 747 | background.setRgb(0x18,0xB2,0xB2); |
750 | foreground.setRgb(0xFF,0xFF,0xFF); | 748 | foreground.setRgb(0xFF,0xFF,0xFF); |
751 | cfg.writeEntry("Schema","16"); | 749 | cfg.writeEntry("Schema","16"); |
752 | colorMenu->setItemChecked(-16,TRUE); | 750 | colorMenu->setItemChecked(-16,TRUE); |
753 | } | 751 | } |
754 | if(iD==-17) {// Black, Blue | 752 | if(iD==-17) {// Black, Blue |
755 | background.setRgb(0x00,0x00,0x00); | 753 | background.setRgb(0x00,0x00,0x00); |
756 | foreground.setRgb(0x18,0xB2,0xB2); | 754 | foreground.setRgb(0x18,0xB2,0xB2); |
757 | cfg.writeEntry("Schema","17"); | 755 | cfg.writeEntry("Schema","17"); |
758 | colorMenu->setItemChecked(-17,TRUE); | 756 | colorMenu->setItemChecked(-17,TRUE); |
759 | } | 757 | } |
760 | if(iD==-18) {// Black, Gold | 758 | if(iD==-18) {// Black, Gold |
761 | background.setRgb(0x00,0x00,0x00); | 759 | background.setRgb(0x00,0x00,0x00); |
762 | foreground.setRgb(255,215,0); | 760 | foreground.setRgb(255,215,0); |
763 | cfg.writeEntry("Schema","18"); | 761 | cfg.writeEntry("Schema","18"); |
764 | colorMenu->setItemChecked(-18,TRUE); | 762 | colorMenu->setItemChecked(-18,TRUE); |
765 | } | 763 | } |
766 | #ifdef QT_QWS_OPIE | 764 | #ifdef QT_QWS_OPIE |
767 | if(iD==-19) { | 765 | if(iD==-19) { |
768 | // Custom | 766 | // Custom |
769 | qDebug("do custom"); | 767 | qDebug("do custom"); |
770 | if(fromMenu) { | 768 | if(fromMenu) { |
771 | ColorPopupMenu* penColorPopupMenu = new ColorPopupMenu(Qt::black, this, "foreground color"); | 769 | ColorPopupMenu* penColorPopupMenu = new ColorPopupMenu(Qt::black, this, "foreground color"); |
772 | connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, | 770 | connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, |
773 | SLOT(changeForegroundColor(const QColor&))); | 771 | SLOT(changeForegroundColor(const QColor&))); |
774 | penColorPopupMenu->exec(); | 772 | penColorPopupMenu->exec(); |
775 | } | 773 | } |
776 | cfg.writeEntry("Schema","19"); | 774 | cfg.writeEntry("Schema","19"); |
777 | if(!fromMenu) { | 775 | if(!fromMenu) { |
778 | foreground.setNamedColor(cfg.readEntry("foreground","")); | 776 | foreground.setNamedColor(cfg.readEntry("foreground","")); |
779 | background.setNamedColor(cfg.readEntry("background","")); | 777 | background.setNamedColor(cfg.readEntry("background","")); |
780 | } | 778 | } |
781 | fromMenu=FALSE; | 779 | fromMenu=FALSE; |
782 | colorMenu->setItemChecked(-19,TRUE); | 780 | colorMenu->setItemChecked(-19,TRUE); |
783 | } | 781 | } |
784 | #endif | 782 | #endif |
785 | for (i = 0; i < TABLE_COLORS; i++) { | 783 | for (i = 0; i < TABLE_COLORS; i++) { |
786 | if(i==0 || i == 10) { | 784 | if(i==0 || i == 10) { |
787 | m_table[i].color = foreground; | 785 | m_table[i].color = foreground; |
788 | } | 786 | } |
789 | else if(i==1 || i == 11) { | 787 | else if(i==1 || i == 11) { |
790 | m_table[i].color = background; m_table[i].transparent=0; | 788 | m_table[i].color = background; m_table[i].transparent=0; |
791 | } | 789 | } |
792 | else | 790 | else |
793 | m_table[i].color = defaultCt[i].color; | 791 | m_table[i].color = defaultCt[i].color; |
794 | } | 792 | } |
795 | } | 793 | } |
796 | lastSelectedMenu = iD; | 794 | lastSelectedMenu = iD; |
797 | te->setColorTable(m_table); | 795 | te->setColorTable(m_table); |
798 | update(); | 796 | update(); |
799 | 797 | ||
800 | } | 798 | } |
801 | 799 | ||
802 | void Konsole::configMenuSelected(int iD) | 800 | void Konsole::configMenuSelected(int iD) |
803 | { | 801 | { |
804 | // QString temp; | 802 | // QString temp; |
805 | // qDebug( temp.sprintf("configmenu %d",iD)); | 803 | // qDebug( temp.sprintf("configmenu %d",iD)); |
806 | TEWidget* te = getTe(); | 804 | TEWidget* te = getTe(); |
807 | Config cfg("Konsole"); | 805 | Config cfg("Konsole"); |
808 | cfg.setGroup("Menubar"); | 806 | cfg.setGroup("Menubar"); |
809 | int i,j; | 807 | int i,j; |
810 | #ifdef QT_QWS_OPIE | 808 | #ifdef QT_QWS_OPIE |
811 | i=-29;j=-30; | 809 | i=-29;j=-30; |
812 | #else | 810 | #else |
813 | i=-28;j=-29; | 811 | i=-28;j=-29; |
814 | #endif | 812 | #endif |
815 | 813 | ||