-rw-r--r-- | core/launcher/desktop.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp index e58b08c..f90da1a 100644 --- a/core/launcher/desktop.cpp +++ b/core/launcher/desktop.cpp | |||
@@ -641,96 +641,102 @@ void Desktop::toggleSymbolInput() | |||
641 | tb->toggleSymbolInput(); | 641 | tb->toggleSymbolInput(); |
642 | } | 642 | } |
643 | 643 | ||
644 | void Desktop::toggleNumLockState() | 644 | void Desktop::toggleNumLockState() |
645 | { | 645 | { |
646 | tb->toggleNumLockState(); | 646 | tb->toggleNumLockState(); |
647 | } | 647 | } |
648 | 648 | ||
649 | void Desktop::toggleCapsLockState() | 649 | void Desktop::toggleCapsLockState() |
650 | { | 650 | { |
651 | tb->toggleCapsLockState(); | 651 | tb->toggleCapsLockState(); |
652 | } | 652 | } |
653 | 653 | ||
654 | void Desktop::styleChange( QStyle &s ) | 654 | void Desktop::styleChange( QStyle &s ) |
655 | { | 655 | { |
656 | QWidget::styleChange( s ); | 656 | QWidget::styleChange( s ); |
657 | int displayw = qApp->desktop()->width(); | 657 | int displayw = qApp->desktop()->width(); |
658 | int displayh = qApp->desktop()->height(); | 658 | int displayh = qApp->desktop()->height(); |
659 | 659 | ||
660 | QSize sz = tb->sizeHint(); | 660 | QSize sz = tb->sizeHint(); |
661 | 661 | ||
662 | tb->setGeometry( 0, displayh-sz.height(), displayw, sz.height() ); | 662 | tb->setGeometry( 0, displayh-sz.height(), displayw, sz.height() ); |
663 | } | 663 | } |
664 | 664 | ||
665 | void DesktopApplication::shutdown() | 665 | void DesktopApplication::shutdown() |
666 | { | 666 | { |
667 | if ( type() != GuiServer ) | 667 | if ( type() != GuiServer ) |
668 | return; | 668 | return; |
669 | ShutdownImpl *sd = new ShutdownImpl( 0, 0, WDestructiveClose ); | 669 | ShutdownImpl *sd = new ShutdownImpl( 0, 0, WDestructiveClose ); |
670 | connect( sd, SIGNAL(shutdown(ShutdownImpl::Type)), | 670 | connect( sd, SIGNAL(shutdown(ShutdownImpl::Type)), |
671 | this, SLOT(shutdown(ShutdownImpl::Type)) ); | 671 | this, SLOT(shutdown(ShutdownImpl::Type)) ); |
672 | sd->showMaximized(); | 672 | sd->showMaximized(); |
673 | } | 673 | } |
674 | 674 | ||
675 | void DesktopApplication::shutdown( ShutdownImpl::Type t ) | 675 | void DesktopApplication::shutdown( ShutdownImpl::Type t ) |
676 | { | 676 | { |
677 | switch ( t ) { | 677 | switch ( t ) { |
678 | case ShutdownImpl::ShutdownSystem: | 678 | case ShutdownImpl::ShutdownSystem: |
679 | execlp("shutdown", "shutdown", "-h", "now", (void*)0); | 679 | execlp("shutdown", "shutdown", "-h", "now", (void*)0); |
680 | break; | 680 | break; |
681 | case ShutdownImpl::RebootSystem: | 681 | case ShutdownImpl::RebootSystem: |
682 | execlp("shutdown", "shutdown", "-r", "now", (void*)0); | 682 | execlp("shutdown", "shutdown", "-r", "now", (void*)0); |
683 | break; | 683 | break; |
684 | case ShutdownImpl::RestartDesktop: | 684 | case ShutdownImpl::RestartDesktop: |
685 | restart(); | 685 | restart(); |
686 | break; | 686 | break; |
687 | case ShutdownImpl::TerminateDesktop: | 687 | case ShutdownImpl::TerminateDesktop: |
688 | prepareForTermination(FALSE); | 688 | prepareForTermination(FALSE); |
689 | |||
690 | // This is a workaround for a Qt bug | ||
691 | // clipboard applet has to stop its poll timer, or Qt/E | ||
692 | // will hang on quit() right before it emits aboutToQuit() | ||
693 | emit aboutToQuit ( ); | ||
694 | |||
689 | quit(); | 695 | quit(); |
690 | break; | 696 | break; |
691 | } | 697 | } |
692 | } | 698 | } |
693 | 699 | ||
694 | void DesktopApplication::restart() | 700 | void DesktopApplication::restart() |
695 | { | 701 | { |
696 | prepareForTermination(TRUE); | 702 | prepareForTermination(TRUE); |
697 | 703 | ||
698 | #ifdef Q_WS_QWS | 704 | #ifdef Q_WS_QWS |
699 | for ( int fd = 3; fd < 100; fd++ ) | 705 | for ( int fd = 3; fd < 100; fd++ ) |
700 | close( fd ); | 706 | close( fd ); |
701 | #if defined(QT_DEMO_SINGLE_FLOPPY) | 707 | #if defined(QT_DEMO_SINGLE_FLOPPY) |
702 | execl( "/sbin/init", "qpe", 0 ); | 708 | execl( "/sbin/init", "qpe", 0 ); |
703 | #elif defined(QT_QWS_CASSIOPEIA) | 709 | #elif defined(QT_QWS_CASSIOPEIA) |
704 | execl( "/bin/sh", "sh", 0 ); | 710 | execl( "/bin/sh", "sh", 0 ); |
705 | #else | 711 | #else |
706 | execl( (qpeDir()+"/bin/qpe").latin1(), "qpe", 0 ); | 712 | execl( (qpeDir()+"/bin/qpe").latin1(), "qpe", 0 ); |
707 | #endif | 713 | #endif |
708 | exit(1); | 714 | exit(1); |
709 | #endif | 715 | #endif |
710 | } | 716 | } |
711 | 717 | ||
712 | void Desktop::startTransferServer() | 718 | void Desktop::startTransferServer() |
713 | { | 719 | { |
714 | // start qcop bridge server | 720 | // start qcop bridge server |
715 | qcopBridge = new QCopBridge( 4243 ); | 721 | qcopBridge = new QCopBridge( 4243 ); |
716 | if ( !qcopBridge->ok() ) { | 722 | if ( !qcopBridge->ok() ) { |
717 | delete qcopBridge; | 723 | delete qcopBridge; |
718 | qcopBridge = 0; | 724 | qcopBridge = 0; |
719 | } | 725 | } |
720 | // start transfer server | 726 | // start transfer server |
721 | transferServer = new TransferServer( 4242 ); | 727 | transferServer = new TransferServer( 4242 ); |
722 | if ( !transferServer->ok() ) { | 728 | if ( !transferServer->ok() ) { |
723 | delete transferServer; | 729 | delete transferServer; |
724 | transferServer = 0; | 730 | transferServer = 0; |
725 | } | 731 | } |
726 | if ( !transferServer || !qcopBridge ) | 732 | if ( !transferServer || !qcopBridge ) |
727 | startTimer( 2000 ); | 733 | startTimer( 2000 ); |
728 | } | 734 | } |
729 | 735 | ||
730 | void Desktop::timerEvent( QTimerEvent *e ) | 736 | void Desktop::timerEvent( QTimerEvent *e ) |
731 | { | 737 | { |
732 | killTimer( e->timerId() ); | 738 | killTimer( e->timerId() ); |
733 | startTransferServer(); | 739 | startTransferServer(); |
734 | } | 740 | } |
735 | 741 | ||
736 | void Desktop::terminateServers() | 742 | void Desktop::terminateServers() |