author | zecke <zecke> | 2002-10-18 12:47:45 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-18 12:47:45 (UTC) |
commit | a574a09dd7b24091a4d2093c8b046ccd32e78d63 (patch) (unidiff) | |
tree | 36408789ef101637ed28c1bb5aa8cb00c5197472 | |
parent | 605e9ccf2bcfa8e16059a1ce023baa2c41d47c88 (diff) | |
download | opie-a574a09dd7b24091a4d2093c8b046ccd32e78d63.zip opie-a574a09dd7b24091a4d2093c8b046ccd32e78d63.tar.gz opie-a574a09dd7b24091a4d2093c8b046ccd32e78d63.tar.bz2 |
If a dialog get's accepted call QDialog::accept and not reject
Now Opie is fully working under X11
Thanks mallum for the one and only matchbox
-rw-r--r-- | x11/libqpe-x11/qpe/qpeapplication.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/x11/libqpe-x11/qpe/qpeapplication.cpp b/x11/libqpe-x11/qpe/qpeapplication.cpp index 75a8189..49115d8 100644 --- a/x11/libqpe-x11/qpe/qpeapplication.cpp +++ b/x11/libqpe-x11/qpe/qpeapplication.cpp | |||
@@ -675,114 +675,114 @@ void QPEApplication::tryQuit() { | |||
675 | 675 | ||
676 | quit(); | 676 | quit(); |
677 | } | 677 | } |
678 | void QPEApplication::hideOrQuit() { | 678 | void QPEApplication::hideOrQuit() { |
679 | qWarning("hide or close"); | 679 | qWarning("hide or close"); |
680 | processEvents(); | 680 | processEvents(); |
681 | qWarning("past processing"); | 681 | qWarning("past processing"); |
682 | 682 | ||
683 | // If we are a preloaded application we don't actually quit, so emit | 683 | // If we are a preloaded application we don't actually quit, so emit |
684 | // a System message indicating we're quasi-closing. | 684 | // a System message indicating we're quasi-closing. |
685 | if ( d->preloaded && d->qpe_main_widget ) | 685 | if ( d->preloaded && d->qpe_main_widget ) |
686 | 686 | ||
687 | { | 687 | { |
688 | qWarning("hiding"); | 688 | qWarning("hiding"); |
689 | QCopEnvelope e("QPE/System", "fastAppHiding(QString)" ); | 689 | QCopEnvelope e("QPE/System", "fastAppHiding(QString)" ); |
690 | e << d->appName; | 690 | e << d->appName; |
691 | d->qpe_main_widget->hide(); | 691 | d->qpe_main_widget->hide(); |
692 | } | 692 | } |
693 | else | 693 | else |
694 | quit(); | 694 | quit(); |
695 | } | 695 | } |
696 | 696 | ||
697 | /*! | 697 | /*! |
698 | \internal | 698 | \internal |
699 | */ | 699 | */ |
700 | void QPEApplication::prepareForTermination( bool willrestart ) | 700 | void QPEApplication::prepareForTermination( bool willrestart ) |
701 | { | 701 | { |
702 | if ( willrestart ) { | 702 | if ( willrestart ) { |
703 | // Draw a big wait icon, the image can be altered in later revisions | 703 | // Draw a big wait icon, the image can be altered in later revisions |
704 | // QWidget *d = QApplication::desktop(); | 704 | // QWidget *d = QApplication::desktop(); |
705 | QImage img = Resource::loadImage( "launcher/new_wait" ); | 705 | QImage img = Resource::loadImage( "launcher/new_wait" ); |
706 | QPixmap pix; | 706 | QPixmap pix; |
707 | pix.convertFromImage( img.smoothScale( 1 * img.width(), 1 * img.height() ) ); | 707 | pix.convertFromImage( img.smoothScale( 1 * img.width(), 1 * img.height() ) ); |
708 | QLabel *lblWait = new QLabel( 0, "wait hack!", QWidget::WStyle_Customize | | 708 | QLabel *lblWait = new QLabel( 0, "wait hack!", QWidget::WStyle_Customize | |
709 | QWidget::WStyle_NoBorder | QWidget::WStyle_Tool ); | 709 | QWidget::WStyle_NoBorder | QWidget::WStyle_Tool ); |
710 | lblWait->setPixmap( pix ); | 710 | lblWait->setPixmap( pix ); |
711 | lblWait->setAlignment( QWidget::AlignCenter ); | 711 | lblWait->setAlignment( QWidget::AlignCenter ); |
712 | lblWait->show(); | 712 | lblWait->show(); |
713 | lblWait->showMaximized(); | 713 | lblWait->showMaximized(); |
714 | } | 714 | } |
715 | #ifndef SINGLE_APP | 715 | #ifndef SINGLE_APP |
716 | { QCopEnvelope envelope( "QPE/System", "forceQuit()" ); | 716 | { QCopEnvelope envelope( "QPE/System", "forceQuit()" ); |
717 | } | 717 | } |
718 | processEvents(); // ensure the message goes out. | 718 | processEvents(); // ensure the message goes out. |
719 | sleep( 1 ); // You have 1 second to comply. | 719 | sleep( 1 ); // You have 1 second to comply. |
720 | #endif | 720 | #endif |
721 | } | 721 | } |
722 | int QPEApplication::x11ClientMessage(QWidget* w, XEvent* event, bool b ) { | 722 | int QPEApplication::x11ClientMessage(QWidget* w, XEvent* event, bool b ) { |
723 | qWarning("X11 ClientMessage %d %d", event->type, ClientMessage); | 723 | qWarning("X11 ClientMessage %d %d", event->type, ClientMessage); |
724 | if ( event->type == ClientMessage ) { | 724 | if ( event->type == ClientMessage ) { |
725 | if ( (event->xclient.message_type == d->wm_protocols) && | 725 | if ( (event->xclient.message_type == d->wm_protocols) && |
726 | (event->xclient.data.l[0] == d->wm_context_accept ) ) { | 726 | (event->xclient.data.l[0] == d->wm_context_accept ) ) { |
727 | qWarning("accepted!!!"); | 727 | qWarning("accepted!!!"); |
728 | /* | 728 | /* |
729 | * I'm not sure if we should use activeWidget | 729 | * I'm not sure if we should use activeWidget |
730 | * or activeModalWidget | 730 | * or activeModalWidget |
731 | * a QDialog could be not modal too | 731 | * a QDialog could be not modal too |
732 | */ | 732 | */ |
733 | if ( w->inherits("QDialog" ) ) { | 733 | if ( w->inherits("QDialog" ) ) { |
734 | qWarning("inherits QDialog!!!"); | 734 | qWarning("inherits QDialog!!!"); |
735 | QDialog* dia = (QDialog*)w; | 735 | QDialog* dia = (QDialog*)w; |
736 | /* | 736 | /* |
737 | * call it directly or via QTimer::singleShot? | 737 | * call it directly or via QTimer::singleShot? |
738 | */ | 738 | */ |
739 | QTimer::singleShot(0, dia, SLOT(reject() ) ); | 739 | QTimer::singleShot(0, dia, SLOT(accept() ) ); |
740 | return 0; | 740 | return 0; |
741 | } | 741 | } |
742 | 742 | ||
743 | } | 743 | } |
744 | } | 744 | } |
745 | return QApplication::x11ClientMessage(w, event, b ); | 745 | return QApplication::x11ClientMessage(w, event, b ); |
746 | } | 746 | } |
747 | 747 | ||
748 | #define KeyPress XKeyPress | 748 | #define KeyPress XKeyPress |
749 | #define KeyRelease XKeyRelease | 749 | #define KeyRelease XKeyRelease |
750 | 750 | ||
751 | #if defined(QT_QWS_IPAQ) || defined(QT_QWS_EBX) | 751 | #if defined(QT_QWS_IPAQ) || defined(QT_QWS_EBX) |
752 | 752 | ||
753 | // The libraries with the skiff package (and possibly others) have | 753 | // The libraries with the skiff package (and possibly others) have |
754 | // completely useless implementations of builtin new and delete that | 754 | // completely useless implementations of builtin new and delete that |
755 | // use about 50% of your CPU. Here we revert to the simple libc | 755 | // use about 50% of your CPU. Here we revert to the simple libc |
756 | // functions. | 756 | // functions. |
757 | 757 | ||
758 | void* operator new[]( size_t size ) | 758 | void* operator new[]( size_t size ) |
759 | { | 759 | { |
760 | return malloc( size ); | 760 | return malloc( size ); |
761 | } | 761 | } |
762 | 762 | ||
763 | void* operator new( size_t size ) | 763 | void* operator new( size_t size ) |
764 | { | 764 | { |
765 | return malloc( size ); | 765 | return malloc( size ); |
766 | } | 766 | } |
767 | 767 | ||
768 | void operator delete[]( void* p ) | 768 | void operator delete[]( void* p ) |
769 | { | 769 | { |
770 | free( p ); | 770 | free( p ); |
771 | } | 771 | } |
772 | 772 | ||
773 | void operator delete[]( void* p, size_t /*size*/ ) | 773 | void operator delete[]( void* p, size_t /*size*/ ) |
774 | { | 774 | { |
775 | free( p ); | 775 | free( p ); |
776 | } | 776 | } |
777 | 777 | ||
778 | void operator delete( void* p ) | 778 | void operator delete( void* p ) |
779 | { | 779 | { |
780 | free( p ); | 780 | free( p ); |
781 | } | 781 | } |
782 | 782 | ||
783 | void operator delete( void* p, size_t /*size*/ ) | 783 | void operator delete( void* p, size_t /*size*/ ) |
784 | { | 784 | { |
785 | free( p ); | 785 | free( p ); |
786 | } | 786 | } |
787 | 787 | ||
788 | #endif | 788 | #endif |