summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/konsole.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp
index eda3135..9c1167b 100644
--- a/core/apps/embeddedkonsole/konsole.cpp
+++ b/core/apps/embeddedkonsole/konsole.cpp
@@ -492,199 +492,199 @@ void Konsole::hitTab()
492 } 492 }
493} 493}
494 494
495void Konsole::hitPaste() 495void Konsole::hitPaste()
496{ 496{
497 TEWidget* te = getTe(); 497 TEWidget* te = getTe();
498 if (te != 0) { 498 if (te != 0) {
499 te->pasteClipboard(); 499 te->pasteClipboard();
500 } 500 }
501} 501}
502 502
503void Konsole::hitUp() 503void Konsole::hitUp()
504{ 504{
505 TEWidget* te = getTe(); 505 TEWidget* te = getTe();
506 if (te != 0) { 506 if (te != 0) {
507 QKeyEvent ke( QKeyEvent::KeyPress, Qt::Key_Up, 0, 0); 507 QKeyEvent ke( QKeyEvent::KeyPress, Qt::Key_Up, 0, 0);
508 QApplication::sendEvent( te, &ke ); 508 QApplication::sendEvent( te, &ke );
509 } 509 }
510} 510}
511 511
512void Konsole::hitDown() 512void Konsole::hitDown()
513{ 513{
514 TEWidget* te = getTe(); 514 TEWidget* te = getTe();
515 if (te != 0) { 515 if (te != 0) {
516 QKeyEvent ke( QKeyEvent::KeyPress, Qt::Key_Down, 0, 0); 516 QKeyEvent ke( QKeyEvent::KeyPress, Qt::Key_Down, 0, 0);
517 QApplication::sendEvent( te, &ke ); 517 QApplication::sendEvent( te, &ke );
518 } 518 }
519} 519}
520 520
521/** 521/**
522 This function calculates the size of the external widget 522 This function calculates the size of the external widget
523 needed for the internal widget to be 523 needed for the internal widget to be
524 */ 524 */
525QSize Konsole::calcSize(int columns, int lines) { 525QSize Konsole::calcSize(int columns, int lines) {
526 TEWidget* te = getTe(); 526 TEWidget* te = getTe();
527 if (te != 0) { 527 if (te != 0) {
528 QSize size = te->calcSize(columns, lines); 528 QSize size = te->calcSize(columns, lines);
529 return size; 529 return size;
530 } else { 530 } else {
531 QSize size; 531 QSize size;
532 return size; 532 return size;
533 } 533 }
534} 534}
535 535
536/** 536/**
537 sets application window to a size based on columns X lines of the te 537 sets application window to a size based on columns X lines of the te
538 guest widget. Call with (0,0) for setting default size. 538 guest widget. Call with (0,0) for setting default size.
539*/ 539*/
540 540
541void Konsole::setColLin(int columns, int lines) 541void Konsole::setColLin(int columns, int lines)
542{ 542{
543 qDebug("konsole::setColLin:: Columns %d", columns); 543 qDebug("konsole::setColLin:: Columns %d", columns);
544 544
545 if ((columns==0) || (lines==0)) 545 if ((columns==0) || (lines==0))
546 { 546 {
547 if (defaultSize.isEmpty()) // not in config file : set default value 547 if (defaultSize.isEmpty()) // not in config file : set default value
548 { 548 {
549 defaultSize = calcSize(80,24); 549 defaultSize = calcSize(80,24);
550 // notifySize(24,80); // set menu items (strange arg order !) 550 // notifySize(24,80); // set menu items (strange arg order !)
551 } 551 }
552 resize(defaultSize); 552 resize(defaultSize);
553 } else { 553 } else {
554 resize(calcSize(columns, lines)); 554 resize(calcSize(columns, lines));
555 // notifySize(lines,columns); // set menu items (strange arg order !) 555 // notifySize(lines,columns); // set menu items (strange arg order !)
556 } 556 }
557} 557}
558 558
559/* 559/*
560void Konsole::setFont(int fontno) 560void Konsole::setFont(int fontno)
561{ 561{
562 QFont f; 562 QFont f;
563 if (fontno == 0) 563 if (fontno == 0)
564 f = defaultFont = QFont( "Helvetica", 12 ); 564 f = defaultFont = QFont( "Helvetica", 12 );
565 else 565 else
566 if (fonts[fontno][0] == '-') 566 if (fonts[fontno][0] == '-')
567 f.setRawName( fonts[fontno] ); 567 f.setRawName( fonts[fontno] );
568 else 568 else
569 { 569 {
570 f.setFamily(fonts[fontno]); 570 f.setFamily(fonts[fontno]);
571 f.setRawMode( TRUE ); 571 f.setRawMode( TRUE );
572 } 572 }
573 if ( !f.exactMatch() && fontno != 0) 573 if ( !f.exactMatch() && fontno != 0)
574 { 574 {
575 QString msg = i18n("Font `%1' not found.\nCheck README.linux.console for help.").arg(fonts[fontno]); 575 QString msg = i18n("Font `%1' not found.\nCheck README.linux.console for help.").arg(fonts[fontno]);
576 QMessageBox(this, msg); 576 QMessageBox(this, msg);
577 return; 577 return;
578 } 578 }
579 if (se) se->setFontNo(fontno); 579 if (se) se->setFontNo(fontno);
580 te->setVTFont(f); 580 te->setVTFont(f);
581 n_font = fontno; 581 n_font = fontno;
582} 582}
583*/ 583*/
584 584
585// --| color selection |------------------------------------------------------- 585// --| color selection |-------------------------------------------------------
586 586
587void Konsole::changeColumns(int columns) 587void Konsole::changeColumns(int columns)
588{ 588{ //FIXME this seems to cause silliness when reset command is executed
589 qDebug("change columns"); 589// qDebug("change columns");
590 TEWidget* te = getTe(); 590// TEWidget* te = getTe();
591 if (te != 0) { 591// if (te != 0) {
592 setColLin(columns,te->Lines()); 592// setColLin(columns,te->Lines());
593 te->update(); 593// te->update();
594 } 594// }
595} 595}
596 596
597//FIXME: If a child dies during session swap, 597//FIXME: If a child dies during session swap,
598// this routine might be called before 598// this routine might be called before
599// session swap is completed. 599// session swap is completed.
600 600
601void Konsole::doneSession(TESession*, int ) 601void Konsole::doneSession(TESession*, int )
602{ 602{
603 TEWidget *te = getTe(); 603 TEWidget *te = getTe();
604 if (te != 0) { 604 if (te != 0) {
605 te->currentSession->setConnect(FALSE); 605 te->currentSession->setConnect(FALSE);
606 tab->removeTab(te); 606 tab->removeTab(te);
607 delete te->currentSession; 607 delete te->currentSession;
608 delete te; 608 delete te;
609 nsessions--; 609 nsessions--;
610 } 610 }
611 611
612 if (nsessions == 0) { 612 if (nsessions == 0) {
613 close(); 613 close();
614 } 614 }
615} 615}
616 616
617void Konsole::newSession() { 617void Konsole::newSession() {
618 if(nsessions < 15) { // seems to be something weird about 16 tabs on the Zaurus.... memory? 618 if(nsessions < 15) { // seems to be something weird about 16 tabs on the Zaurus.... memory?
619 TEWidget* te = new TEWidget(tab); 619 TEWidget* te = new TEWidget(tab);
620 Config c("Konsole"); 620 Config c("Konsole");
621 c.setGroup("Menubar"); 621 c.setGroup("Menubar");
622 te->useBeep=c.readBoolEntry("useBeep",0); 622 te->useBeep=c.readBoolEntry("useBeep",0);
623 623
624// te->setBackgroundMode(PaletteBase); //we want transparent!! 624// te->setBackgroundMode(PaletteBase); //we want transparent!!
625 te->setVTFont(fonts.at(cfont)->getFont()); 625 te->setVTFont(fonts.at(cfont)->getFont());
626 tab->addTab(te); 626 tab->addTab(te);
627 TESession* se = new TESession(this, te, se_pgm, se_args, "xterm"); 627 TESession* se = new TESession(this, te, se_pgm, se_args, "xterm");
628 te->currentSession = se; 628 te->currentSession = se;
629 connect( se, SIGNAL(done(TESession*,int)), this, SLOT(doneSession(TESession*,int)) ); 629 connect( se, SIGNAL(done(TESession*,int)), this, SLOT(doneSession(TESession*,int)) );
630 se->run(); 630 se->run();
631 se->setConnect(TRUE); 631 se->setConnect(TRUE);
632 se->setHistory(b_scroll); 632 se->setHistory(b_scroll);
633 tab->setCurrentPage(nsessions); 633 tab->setCurrentPage(nsessions);
634 nsessions++; 634 nsessions++;
635 doWrap(); 635 doWrap();
636 setColor(); 636 setColor();
637 } 637 }
638} 638}
639 639
640TEWidget* Konsole::getTe() { 640TEWidget* Konsole::getTe() {
641 if (nsessions) { 641 if (nsessions) {
642 return (TEWidget *) tab->currentPage(); 642 return (TEWidget *) tab->currentPage();
643 } else { 643 } else {
644 return 0; 644 return 0;
645 } 645 }
646} 646}
647 647
648void Konsole::switchSession(QWidget* w) { 648void Konsole::switchSession(QWidget* w) {
649 TEWidget* te = (TEWidget *) w; 649 TEWidget* te = (TEWidget *) w;
650 650
651 QFont teFnt = te->getVTFont(); 651 QFont teFnt = te->getVTFont();
652 for(uint i = 0; i < fonts.count(); i++) { 652 for(uint i = 0; i < fonts.count(); i++) {
653 VTFont *fnt = fonts.at(i); 653 VTFont *fnt = fonts.at(i);
654 bool cf = fnt->getFont() == teFnt; 654 bool cf = fnt->getFont() == teFnt;
655 fontList->setItemChecked(i, cf); 655 fontList->setItemChecked(i, cf);
656 if (cf) { 656 if (cf) {
657 cfont = i; 657 cfont = i;
658 } 658 }
659 } 659 }
660} 660}
661 661
662void Konsole::colorMenuIsSelected(int iD) { 662void Konsole::colorMenuIsSelected(int iD) {
663 fromMenu = TRUE; 663 fromMenu = TRUE;
664 colorMenuSelected(iD); 664 colorMenuSelected(iD);
665} 665}
666 666
667/// ------------------------------- some new stuff by L.J. Potter 667/// ------------------------------- some new stuff by L.J. Potter
668void Konsole::colorMenuSelected(int iD) 668void Konsole::colorMenuSelected(int iD)
669{ // this is NOT pretty, elegant or anything else besides functional 669{ // this is NOT pretty, elegant or anything else besides functional
670// QString temp; 670// QString temp;
671// qDebug( temp.sprintf("colormenu %d", iD)); 671// qDebug( temp.sprintf("colormenu %d", iD));
672 672
673 TEWidget* te = getTe(); 673 TEWidget* te = getTe();
674 Config cfg("Konsole"); 674 Config cfg("Konsole");
675 cfg.setGroup("Colors"); 675 cfg.setGroup("Colors");
676// QColor foreground; 676// QColor foreground;
677// QColor background; 677// QColor background;
678 colorMenu->setItemChecked(lastSelectedMenu,FALSE); 678 colorMenu->setItemChecked(lastSelectedMenu,FALSE);
679 ColorEntry m_table[TABLE_COLORS]; 679 ColorEntry m_table[TABLE_COLORS];
680 const ColorEntry * defaultCt=te->getdefaultColorTable(); 680 const ColorEntry * defaultCt=te->getdefaultColorTable();
681 /////////// fore back 681 /////////// fore back
682 int i; 682 int i;
683 if(iD==-9) { // default default 683 if(iD==-9) { // default default
684 for (i = 0; i < TABLE_COLORS; i++) { 684 for (i = 0; i < TABLE_COLORS; i++) {
685 m_table[i].color = defaultCt[i].color; 685 m_table[i].color = defaultCt[i].color;
686 if(i==1 || i == 11) 686 if(i==1 || i == 11)
687 m_table[i].transparent=1; 687 m_table[i].transparent=1;
688 cfg.writeEntry("Schema","9"); 688 cfg.writeEntry("Schema","9");
689 colorMenu->setItemChecked(-9,TRUE); 689 colorMenu->setItemChecked(-9,TRUE);
690 } 690 }