summaryrefslogtreecommitdiff
path: root/library
Unidiff
Diffstat (limited to 'library') (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index b1b7ed4..9286f9f 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -620,193 +620,195 @@ QPEApplication::QPEApplication( int & argc, char **argv, Type t )
620 pidChannel = new QCopChannel( channel, this ); 620 pidChannel = new QCopChannel( channel, this );
621 connect( pidChannel, SIGNAL( received( const QCString &, const QByteArray & ) ), 621 connect( pidChannel, SIGNAL( received( const QCString &, const QByteArray & ) ),
622 this, SLOT( pidMessage( const QCString &, const QByteArray & ) ) ); 622 this, SLOT( pidMessage( const QCString &, const QByteArray & ) ) );
623 623
624 if ( f.isOpen() ) { 624 if ( f.isOpen() ) {
625 d->keep_running = FALSE; 625 d->keep_running = FALSE;
626 QDataStream ds( &f ); 626 QDataStream ds( &f );
627 QCString channel, message; 627 QCString channel, message;
628 QByteArray data; 628 QByteArray data;
629 while ( !ds.atEnd() ) { 629 while ( !ds.atEnd() ) {
630 ds >> channel >> message >> data; 630 ds >> channel >> message >> data;
631 d->enqueueQCop( channel, message, data ); 631 d->enqueueQCop( channel, message, data );
632 } 632 }
633 633
634 flock( f.handle(), LOCK_UN ); 634 flock( f.handle(), LOCK_UN );
635 f.close(); 635 f.close();
636 f.remove(); 636 f.remove();
637 } 637 }
638 638
639 for ( int a = 0; a < argc; a++ ) { 639 for ( int a = 0; a < argc; a++ ) {
640 if ( qstrcmp( argv[ a ], "-preload" ) == 0 ) { 640 if ( qstrcmp( argv[ a ], "-preload" ) == 0 ) {
641 argv[ a ] = argv[ a + 1 ]; 641 argv[ a ] = argv[ a + 1 ];
642 a++; 642 a++;
643 d->preloaded = TRUE; 643 d->preloaded = TRUE;
644 argc -= 1; 644 argc -= 1;
645 } 645 }
646 else if ( qstrcmp( argv[ a ], "-preload-show" ) == 0 ) { 646 else if ( qstrcmp( argv[ a ], "-preload-show" ) == 0 ) {
647 argv[ a ] = argv[ a + 1 ]; 647 argv[ a ] = argv[ a + 1 ];
648 a++; 648 a++;
649 d->preloaded = TRUE; 649 d->preloaded = TRUE;
650 d->forceshow = TRUE; 650 d->forceshow = TRUE;
651 argc -= 1; 651 argc -= 1;
652 } 652 }
653 } 653 }
654 654
655 /* overide stored arguments */ 655 /* overide stored arguments */
656 setArgs( argc, argv ); 656 setArgs( argc, argv );
657 657
658#endif 658#endif
659#else 659#else
660 initApp( argc, argv ); 660 initApp( argc, argv );
661#endif 661#endif
662 // qwsSetDecoration( new QPEDecoration() ); 662 // qwsSetDecoration( new QPEDecoration() );
663 663
664#ifndef QT_NO_TRANSLATION 664#ifndef QT_NO_TRANSLATION
665 665
666 QStringList langs = Global::languageList(); 666 QStringList langs = Global::languageList();
667 for ( QStringList::ConstIterator it = langs.begin(); it != langs.end(); ++it ) { 667 for ( QStringList::ConstIterator it = langs.begin(); it != langs.end(); ++it ) {
668 QString lang = *it; 668 QString lang = *it;
669 669
670 installTranslation( lang + "/libopie.qm"); 670 installTranslation( lang + "/libopie.qm");
671 installTranslation( lang + "/libqpe.qm" ); 671 installTranslation( lang + "/libqpe.qm" );
672 installTranslation( lang + "/" + d->appName + ".qm" ); 672 installTranslation( lang + "/" + d->appName + ".qm" );
673 673
674 674
675 //###language/font hack; should look it up somewhere 675 //###language/font hack; should look it up somewhere
676#ifdef QWS 676#ifdef QWS
677 677
678 if ( lang == "ja" || lang == "zh_CN" || lang == "zh_TW" || lang == "ko" ) { 678 if ( lang == "ja" || lang == "zh_CN" || lang == "zh_TW" || lang == "ko" ) {
679 QFont fn = FontManager::unicodeFont( FontManager::Proportional ); 679 QFont fn = FontManager::unicodeFont( FontManager::Proportional );
680 setFont( fn ); 680 setFont( fn );
681 } 681 }
682#endif 682#endif
683 } 683 }
684#endif 684#endif
685 685
686 applyStyle(); 686 applyStyle();
687 687
688 if ( type() == GuiServer ) { 688 if ( type() == GuiServer ) {
689 setVolume(); 689 setVolume();
690 } 690 }
691 691
692 installEventFilter( this ); 692 installEventFilter( this );
693 693
694 QPEMenuToolFocusManager::initialize(); 694 QPEMenuToolFocusManager::initialize();
695 695
696#ifdef QT_NO_QWS_CURSOR 696#ifdef QT_NO_QWS_CURSOR
697 // if we have no cursor, probably don't want tooltips 697 // if we have no cursor, probably don't want tooltips
698 QToolTip::setEnabled( FALSE ); 698 QToolTip::setEnabled( FALSE );
699#endif 699#endif
700} 700}
701 701
702 702
703#ifdef QTOPIA_INTERNAL_INITAPP 703#ifdef QTOPIA_INTERNAL_INITAPP
704void QPEApplication::initApp( int argc, char **argv ) 704void QPEApplication::initApp( int argc, char **argv )
705{ 705{
706 delete pidChannel; 706 delete pidChannel;
707 d->keep_running = TRUE; 707 d->keep_running = TRUE;
708 d->preloaded = FALSE; 708 d->preloaded = FALSE;
709 d->forceshow = FALSE; 709 d->forceshow = FALSE;
710 710
711 QCString channel = QCString(argv[0]); 711 QCString channel = QCString(argv[0]);
712 712
713 channel.replace(QRegExp(".*/"),""); 713 channel.replace(QRegExp(".*/"),"");
714 d->appName = channel; 714 d->appName = channel;
715 715
716 #if QT_VERSION > 235
716 qt_fbdpy->setIdentity( channel ); // In Qt/E 2.3.6 717 qt_fbdpy->setIdentity( channel ); // In Qt/E 2.3.6
718 #endif
717 719
718 channel = "QPE/Application/" + channel; 720 channel = "QPE/Application/" + channel;
719 pidChannel = new QCopChannel( channel, this); 721 pidChannel = new QCopChannel( channel, this);
720 connect( pidChannel, SIGNAL(received(const QCString &, const QByteArray &)), 722 connect( pidChannel, SIGNAL(received(const QCString &, const QByteArray &)),
721 this, SLOT(pidMessage(const QCString &, const QByteArray &))); 723 this, SLOT(pidMessage(const QCString &, const QByteArray &)));
722 724
723 processQCopFile(); 725 processQCopFile();
724 d->keep_running = d->qcopq.isEmpty(); 726 d->keep_running = d->qcopq.isEmpty();
725 727
726 for (int a=0; a<argc; a++) { 728 for (int a=0; a<argc; a++) {
727 if ( qstrcmp(argv[a],"-preload")==0 ) { 729 if ( qstrcmp(argv[a],"-preload")==0 ) {
728 argv[a] = argv[a+1]; 730 argv[a] = argv[a+1];
729 a++; 731 a++;
730 d->preloaded = TRUE; 732 d->preloaded = TRUE;
731 argc-=1; 733 argc-=1;
732 } else if ( qstrcmp(argv[a],"-preload-show")==0 ) { 734 } else if ( qstrcmp(argv[a],"-preload-show")==0 ) {
733 argv[a] = argv[a+1]; 735 argv[a] = argv[a+1];
734 a++; 736 a++;
735 d->preloaded = TRUE; 737 d->preloaded = TRUE;
736 d->forceshow = TRUE; 738 d->forceshow = TRUE;
737 argc-=1; 739 argc-=1;
738 } 740 }
739 } 741 }
740 742
741 /* overide stored arguments */ 743 /* overide stored arguments */
742 setArgs(argc, argv); 744 setArgs(argc, argv);
743} 745}
744#endif 746#endif
745 747
746 748
747static QPtrDict<void>* inputMethodDict = 0; 749static QPtrDict<void>* inputMethodDict = 0;
748static void createInputMethodDict() 750static void createInputMethodDict()
749{ 751{
750 if ( !inputMethodDict ) 752 if ( !inputMethodDict )
751 inputMethodDict = new QPtrDict<void>; 753 inputMethodDict = new QPtrDict<void>;
752} 754}
753 755
754/*! 756/*!
755 Returns the currently set hint to the system as to whether 757 Returns the currently set hint to the system as to whether
756 widget \a w has any use for text input methods. 758 widget \a w has any use for text input methods.
757 759
758 760
759 \sa setInputMethodHint() InputMethodHint 761 \sa setInputMethodHint() InputMethodHint
760*/ 762*/
761QPEApplication::InputMethodHint QPEApplication::inputMethodHint( QWidget * w ) 763QPEApplication::InputMethodHint QPEApplication::inputMethodHint( QWidget * w )
762{ 764{
763 if ( inputMethodDict && w ) 765 if ( inputMethodDict && w )
764 return ( InputMethodHint ) ( int ) inputMethodDict->find( w ); 766 return ( InputMethodHint ) ( int ) inputMethodDict->find( w );
765 return Normal; 767 return Normal;
766} 768}
767 769
768/*! 770/*!
769 \enum QPEApplication::InputMethodHint 771 \enum QPEApplication::InputMethodHint
770 772
771 \value Normal the application sometimes needs text input (the default). 773 \value Normal the application sometimes needs text input (the default).
772 \value AlwaysOff the application never needs text input. 774 \value AlwaysOff the application never needs text input.
773 \value AlwaysOn the application always needs text input. 775 \value AlwaysOn the application always needs text input.
774*/ 776*/
775 777
776/*! 778/*!
777 Hints to the system that widget \a w has use for text input methods 779 Hints to the system that widget \a w has use for text input methods
778 as specified by \a mode. 780 as specified by \a mode.
779 781
780 \sa inputMethodHint() InputMethodHint 782 \sa inputMethodHint() InputMethodHint
781*/ 783*/
782void QPEApplication::setInputMethodHint( QWidget * w, InputMethodHint mode ) 784void QPEApplication::setInputMethodHint( QWidget * w, InputMethodHint mode )
783{ 785{
784 createInputMethodDict(); 786 createInputMethodDict();
785 if ( mode == Normal ) { 787 if ( mode == Normal ) {
786 inputMethodDict->remove 788 inputMethodDict->remove
787 ( w ); 789 ( w );
788 } 790 }
789 else { 791 else {
790 inputMethodDict->insert( w, ( void* ) mode ); 792 inputMethodDict->insert( w, ( void* ) mode );
791 } 793 }
792} 794}
793 795
794class HackDialog : public QDialog 796class HackDialog : public QDialog
795{ 797{
796public: 798public:
797 void acceptIt() 799 void acceptIt()
798 { 800 {
799 accept(); 801 accept();
800 } 802 }
801 void rejectIt() 803 void rejectIt()
802 { 804 {
803 reject(); 805 reject();
804 } 806 }
805}; 807};
806 808
807 809
808void QPEApplication::mapToDefaultAction( QWSKeyEvent * ke, int key ) 810void QPEApplication::mapToDefaultAction( QWSKeyEvent * ke, int key )
809{ 811{
810 // specialised actions for certain widgets. May want to 812 // specialised actions for certain widgets. May want to
811 // add more stuff here. 813 // add more stuff here.
812 if ( activePopupWidget() && activePopupWidget() ->inherits( "QListBox" ) 814 if ( activePopupWidget() && activePopupWidget() ->inherits( "QListBox" )