summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/mainwindow.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp10
1 files changed, 3 insertions, 7 deletions
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,114 +662,110 @@ 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
767void MainWindow::slotSaveSession() { 763void MainWindow::slotSaveSession() {
768 if (!currentSession() ) { 764 if (!currentSession() ) {
769 QMessageBox::information(this, tr("Save Connection"), 765 QMessageBox::information(this, tr("Save Connection"),
770 tr("<qt>There is no Connection.</qt>"), 1 ); 766 tr("<qt>There is no Connection.</qt>"), 1 );
771 return; 767 return;
772 } 768 }
773 manager()->add( currentSession()->profile() ); 769 manager()->add( currentSession()->profile() );
774 manager()->save(); 770 manager()->save();
775 populateProfiles(); 771 populateProfiles();