summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console
Unidiff
Diffstat (limited to 'noncore/apps/opie-console') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/io_irda.cpp1
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp8
2 files changed, 3 insertions, 6 deletions
diff --git a/noncore/apps/opie-console/io_irda.cpp b/noncore/apps/opie-console/io_irda.cpp
index 9d27c85..a0f72ae 100644
--- a/noncore/apps/opie-console/io_irda.cpp
+++ b/noncore/apps/opie-console/io_irda.cpp
@@ -1,64 +1,65 @@
1#include "io_irda.h" 1#include "io_irda.h"
2 2
3IOIrda::IOIrda( const Profile &config ) : IOSerial( config ) { 3IOIrda::IOIrda( const Profile &config ) : IOSerial( config ) {
4 m_attach = 0; 4 m_attach = 0;
5} 5}
6 6
7 7
8IOIrda::~IOIrda() { 8IOIrda::~IOIrda() {
9 if ( m_attach ) { 9 if ( m_attach ) {
10 delete m_attach; 10 delete m_attach;
11 } 11 }
12} 12}
13 13
14 14
15void IOIrda::close() { 15void IOIrda::close() {
16 16
17 IOSerial::close(); 17 IOSerial::close();
18 // still need error handling 18 // still need error handling
19 delete m_attach; 19 delete m_attach;
20} 20}
21 21
22bool IOIrda::open() { 22bool IOIrda::open() {
23 bool ret; 23 bool ret;
24 24
25 // irdaattach here 25 // irdaattach here
26 m_attach = new Opie::Core::OProcess(); 26 m_attach = new Opie::Core::OProcess();
27 *m_attach << "irattach /dev/ttyS2 -s"; 27 *m_attach << "irattach /dev/ttyS2 -s";
28 28
29 connect( m_attach, SIGNAL( processExited(Opie::Core::OProcess*) ), 29 connect( m_attach, SIGNAL( processExited(Opie::Core::OProcess*) ),
30 this, SLOT( slotExited(Opie::Core::OProcess*) ) ); 30 this, SLOT( slotExited(Opie::Core::OProcess*) ) );
31 31
32 if ( m_attach->start() ) { 32 if ( m_attach->start() ) {
33 ret= IOSerial::open(); 33 ret= IOSerial::open();
34 } else { 34 } else {
35 // emit error!!! 35 // emit error!!!
36 delete m_attach; 36 delete m_attach;
37 m_attach = 0l; 37 m_attach = 0l;
38 ret = false;
38 } 39 }
39 return ret; 40 return ret;
40} 41}
41 42
42void IOIrda::reload( const Profile &config ) { 43void IOIrda::reload( const Profile &config ) {
43 m_device = config.readEntry("Device", IRDA_DEFAULT_DEVICE); 44 m_device = config.readEntry("Device", IRDA_DEFAULT_DEVICE);
44 m_baud = config.readNumEntry("Baud", IRDA_DEFAULT_BAUD); 45 m_baud = config.readNumEntry("Baud", IRDA_DEFAULT_BAUD);
45 m_parity = config.readNumEntry("Parity", IRDA_DEFAULT_PARITY); 46 m_parity = config.readNumEntry("Parity", IRDA_DEFAULT_PARITY);
46 m_dbits = config.readNumEntry("DataBits", IRDA_DEFAULT_DBITS); 47 m_dbits = config.readNumEntry("DataBits", IRDA_DEFAULT_DBITS);
47 m_sbits = config.readNumEntry("StopBits", IRDA_DEFAULT_SBITS); 48 m_sbits = config.readNumEntry("StopBits", IRDA_DEFAULT_SBITS);
48 m_flow = config.readNumEntry("Flow", IRDA_DEFAULT_FLOW); 49 m_flow = config.readNumEntry("Flow", IRDA_DEFAULT_FLOW);
49} 50}
50 51
51 52
52QString IOIrda::identifier() const { 53QString IOIrda::identifier() const {
53 return "irda"; 54 return "irda";
54} 55}
55 56
56QString IOIrda::name() const { 57QString IOIrda::name() const {
57 return "Irda IO Layer"; 58 return "Irda IO Layer";
58} 59}
59 60
60void IOIrda::slotExited(Opie::Core::OProcess* proc ){ 61void IOIrda::slotExited(Opie::Core::OProcess* proc ){
61 close(); 62 close();
62 delete proc; 63 delete proc;
63} 64}
64 65
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index aba7244..a884179 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -662,105 +662,101 @@ void MainWindow::slotSessionChanged( Session* ses ) {
662 } 662 }
663 663
664 m_kb->load(currentSession()->profile()); 664 m_kb->load(currentSession()->profile());
665 } 665 }
666} 666}
667 667
668void MainWindow::slotWrap() 668void MainWindow::slotWrap()
669{ 669{
670 if(m_curSession) 670 if(m_curSession)
671 { 671 {
672 EmulationHandler *e = m_curSession->emulationHandler(); 672 EmulationHandler *e = m_curSession->emulationHandler();
673 if(e) 673 if(e)
674 { 674 {
675 e->setWrap( m_isWrapped ? 80:0 ); 675 e->setWrap( m_isWrapped ? 80:0 );
676 m_isWrapped = !m_isWrapped; 676 m_isWrapped = !m_isWrapped;
677 } 677 }
678 } 678 }
679} 679}
680 680
681void MainWindow::slotFullscreen() { 681void MainWindow::slotFullscreen() {
682 682
683 683
684 684
685 if ( m_isFullscreen ) { 685 if ( m_isFullscreen ) {
686 ( m_curSession->widgetStack() )->reparent( savedParentFullscreen, 0, QPoint(0,0), true ); 686 ( m_curSession->widgetStack() )->reparent( savedParentFullscreen, 0, QPoint(0,0), true );
687 ( m_curSession->widgetStack() )->resize( savedParentFullscreen->width(), savedParentFullscreen->height() ); 687 ( m_curSession->widgetStack() )->resize( savedParentFullscreen->width(), savedParentFullscreen->height() );
688 ( m_curSession->emulationHandler() )->cornerButton()->hide(); 688 ( m_curSession->emulationHandler() )->cornerButton()->hide();
689 disconnect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); 689 disconnect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) );
690 690
691 } else { 691 } else {
692 savedParentFullscreen = ( m_curSession->widgetStack() )->parentWidget(); 692 savedParentFullscreen = ( m_curSession->widgetStack() )->parentWidget();
693 ( m_curSession->widgetStack() )->setFrameStyle( QFrame::NoFrame ); 693 ( m_curSession->widgetStack() )->setFrameStyle( QFrame::NoFrame );
694 ( m_curSession->widgetStack() )->reparent( 0, WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop 694 ( m_curSession->widgetStack() )->reparent( 0, WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop
695 , QPoint(0,0), false ); 695 , QPoint(0,0), false );
696 ( m_curSession->widgetStack() )->resize( qApp->desktop()->width(), qApp->desktop()->height() ); 696 ( m_curSession->widgetStack() )->resize( qApp->desktop()->width(), qApp->desktop()->height() );
697 ( m_curSession->widgetStack() )->setFocus(); 697 ( m_curSession->widgetStack() )->setFocus();
698 ( m_curSession->widgetStack() )->show(); 698 ( m_curSession->widgetStack() )->show();
699 699
700 ( ( m_curSession->emulationHandler() )->cornerButton() )->show(); 700 ( ( m_curSession->emulationHandler() )->cornerButton() )->show();
701 701
702 connect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); 702 connect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) );
703 } 703 }
704 704
705 m_isFullscreen = !m_isFullscreen; 705 m_isFullscreen = !m_isFullscreen;
706} 706}
707 707
708void MainWindow::slotScrollbarSelected(int index) 708void MainWindow::slotScrollbarSelected(int index)
709{ 709{
710 int loc; 710 int loc = 0;
711 711
712 Config cfg( "Konsole" ); 712 Config cfg( "Konsole" );
713 cfg.setGroup("ScrollBar"); 713 cfg.setGroup("ScrollBar");
714 if(index == sm_none) 714 if(index == sm_left)
715 {
716 loc = 0;
717 }
718 else if(index == sm_left)
719 { 715 {
720 loc = 1; 716 loc = 1;
721 } 717 }
722 else if(index == sm_right) 718 else if(index == sm_right)
723 { 719 {
724 loc = 2; 720 loc = 2;
725 } 721 }
726 722
727 cfg.writeEntry("Position", loc); 723 cfg.writeEntry("Position", loc);
728 724
729 if (currentSession()) { 725 if (currentSession()) {
730 currentSession()->emulationHandler()->setScrollbarLocation(loc); 726 currentSession()->emulationHandler()->setScrollbarLocation(loc);
731 } 727 }
732 728
733 m_scrollbar->setItemChecked(sm_none, index == sm_none); 729 m_scrollbar->setItemChecked(sm_none, index == sm_none);
734 m_scrollbar->setItemChecked(sm_left, index == sm_left); 730 m_scrollbar->setItemChecked(sm_left, index == sm_left);
735 m_scrollbar->setItemChecked(sm_right, index == sm_right); 731 m_scrollbar->setItemChecked(sm_right, index == sm_right);
736} 732}
737 733
738void MainWindow::slotKeyReceived(FKey k, ushort, ushort, bool pressed) { 734void MainWindow::slotKeyReceived(FKey k, ushort, ushort, bool pressed) {
739 735
740 if ( m_curSession ) { 736 if ( m_curSession ) {
741 737
742 QEvent::Type state; 738 QEvent::Type state;
743 739
744 if (pressed) state = QEvent::KeyPress; 740 if (pressed) state = QEvent::KeyPress;
745 else state = QEvent::KeyRelease; 741 else state = QEvent::KeyRelease;
746 742
747 QKeyEvent ke(state, k.qcode, k.unicode, 0, QString(QChar(k.unicode))); 743 QKeyEvent ke(state, k.qcode, k.unicode, 0, QString(QChar(k.unicode)));
748 744
749 // is this the best way to do this? cant figure out any other way to work 745 // is this the best way to do this? cant figure out any other way to work
750 QApplication::sendEvent((QObject *)m_curSession->widget(), &ke); 746 QApplication::sendEvent((QObject *)m_curSession->widget(), &ke);
751 ke.ignore(); 747 ke.ignore();
752 } 748 }
753} 749}
754void MainWindow::slotCopy() { 750void MainWindow::slotCopy() {
755 if (!currentSession() ) return; 751 if (!currentSession() ) return;
756 currentSession()->emulationHandler()->copy(); 752 currentSession()->emulationHandler()->copy();
757} 753}
758void MainWindow::slotPaste() { 754void MainWindow::slotPaste() {
759 if (!currentSession() ) return; 755 if (!currentSession() ) return;
760 currentSession()->emulationHandler()->paste(); 756 currentSession()->emulationHandler()->paste();
761} 757}
762 758
763/* 759/*
764 * Save the session 760 * Save the session
765 */ 761 */
766 762