author | llornkcor <llornkcor> | 2002-12-05 18:36:11 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-12-05 18:36:11 (UTC) |
commit | 05757f4914d19f9c392be1e60e5ec972027886bf (patch) (unidiff) | |
tree | 0096190bb2cf832d90ca93968952b9eccf3d3149 | |
parent | 418fd5dab5503755aa1783d404576252684d4a96 (diff) | |
download | opie-05757f4914d19f9c392be1e60e5ec972027886bf.zip opie-05757f4914d19f9c392be1e60e5ec972027886bf.tar.gz opie-05757f4914d19f9c392be1e60e5ec972027886bf.tar.bz2 |
fix beep so all sessions are the same
-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 | |||
@@ -571,101 +571,99 @@ void Konsole::setFont(int fontno) | |||
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; |