summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index bdf67b9..533d7bd 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -747,129 +747,133 @@ bool QPEApplication::qwsEventFilter( QWSEvent * e )
747 active = activeWindow(); 747 active = activeWindow();
748 } 748 }
749 if ( !nfw && d->kbgrabber == 2 ) { 749 if ( !nfw && d->kbgrabber == 2 ) {
750 ungrabKeyboard(); 750 ungrabKeyboard();
751 d->kbregrab = TRUE; // want kb back when we're active 751 d->kbregrab = TRUE; // want kb back when we're active
752 } 752 }
753 } 753 }
754 else { 754 else {
755 // make sure our modal widget is ALWAYS on top 755 // make sure our modal widget is ALWAYS on top
756 QWidget *topm = activeModalWidget(); 756 QWidget *topm = activeModalWidget();
757 if ( topm ) { 757 if ( topm ) {
758 topm->raise(); 758 topm->raise();
759 } 759 }
760 if ( d->kbregrab ) { 760 if ( d->kbregrab ) {
761 grabKeyboard(); 761 grabKeyboard();
762 d->kbregrab = FALSE; 762 d->kbregrab = FALSE;
763 } 763 }
764 } 764 }
765 if ( fe->simpleData.get_focus && inputMethodDict ) { 765 if ( fe->simpleData.get_focus && inputMethodDict ) {
766 InputMethodHint m = inputMethodHint( QWidget::find( e->window() ) ); 766 InputMethodHint m = inputMethodHint( QWidget::find( e->window() ) );
767 if ( m == AlwaysOff ) 767 if ( m == AlwaysOff )
768 Global::hideInputMethod(); 768 Global::hideInputMethod();
769 if ( m == AlwaysOn ) 769 if ( m == AlwaysOn )
770 Global::showInputMethod(); 770 Global::showInputMethod();
771 } 771 }
772 } 772 }
773 return QApplication::qwsEventFilter( e ); 773 return QApplication::qwsEventFilter( e );
774} 774}
775#endif 775#endif
776 776
777/*! 777/*!
778 Destroys the QPEApplication. 778 Destroys the QPEApplication.
779*/ 779*/
780QPEApplication::~QPEApplication() 780QPEApplication::~QPEApplication()
781{ 781{
782 ungrabKeyboard(); 782 ungrabKeyboard();
783#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 783#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
784 // Need to delete QCopChannels early, since the display will 784 // Need to delete QCopChannels early, since the display will
785 // be gone by the time we get to ~QObject(). 785 // be gone by the time we get to ~QObject().
786 delete sysChannel; 786 delete sysChannel;
787 delete pidChannel; 787 delete pidChannel;
788#endif 788#endif
789 789
790 delete d; 790 delete d;
791} 791}
792 792
793/*! 793/*!
794 Returns <tt>$OPIEDIR/</tt>. 794 Returns <tt>$OPIEDIR/</tt>.
795*/ 795*/
796QString QPEApplication::qpeDir() 796QString QPEApplication::qpeDir()
797{ 797{
798 const char * base = getenv( "OPIEDIR" ); 798 const char * base = getenv( "OPIEDIR" );
799 if ( base ) 799 if ( base )
800 return QString( base ) + "/"; 800 return QString( base ) + "/";
801 801
802 return QString( "../" ); 802 return QString( "../" );
803} 803}
804 804
805/*! 805/*!
806 Returns the user's current Document directory. There is a trailing "/". 806 Returns the user's current Document directory. There is a trailing "/".
807 .. well, it does now,, and there's no trailing '/' 807 .. well, it does now,, and there's no trailing '/'
808*/ 808*/
809QString QPEApplication::documentDir() 809QString QPEApplication::documentDir()
810{ 810{
811 return QString( QDir::homeDirPath() + "/Documents"); 811 const char* base = getenv( "HOME");
812 if( base )
813 return QString( base ) + "/Documents";
814
815 return QString( "../Documents" );
812} 816}
813 817
814static int deforient = -1; 818static int deforient = -1;
815 819
816/*! 820/*!
817 \internal 821 \internal
818*/ 822*/
819int QPEApplication::defaultRotation() 823int QPEApplication::defaultRotation()
820{ 824{
821 if ( deforient < 0 ) { 825 if ( deforient < 0 ) {
822 QString d = getenv( "QWS_DISPLAY" ); 826 QString d = getenv( "QWS_DISPLAY" );
823 if ( d.contains( "Rot90" ) ) { 827 if ( d.contains( "Rot90" ) ) {
824 deforient = 90; 828 deforient = 90;
825 } 829 }
826 else if ( d.contains( "Rot180" ) ) { 830 else if ( d.contains( "Rot180" ) ) {
827 deforient = 180; 831 deforient = 180;
828 } 832 }
829 else if ( d.contains( "Rot270" ) ) { 833 else if ( d.contains( "Rot270" ) ) {
830 deforient = 270; 834 deforient = 270;
831 } 835 }
832 else { 836 else {
833 deforient = 0; 837 deforient = 0;
834 } 838 }
835 } 839 }
836 return deforient; 840 return deforient;
837} 841}
838 842
839/*! 843/*!
840 \internal 844 \internal
841*/ 845*/
842void QPEApplication::setDefaultRotation( int r ) 846void QPEApplication::setDefaultRotation( int r )
843{ 847{
844 if ( qApp->type() == GuiServer ) { 848 if ( qApp->type() == GuiServer ) {
845 deforient = r; 849 deforient = r;
846 setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 ); 850 setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 );
847 Config config("qpe"); 851 Config config("qpe");
848 config.setGroup( "Rotation" ); 852 config.setGroup( "Rotation" );
849 config.writeEntry( "Screen", getenv("QWS_DISPLAY") ); 853 config.writeEntry( "Screen", getenv("QWS_DISPLAY") );
850 } else { 854 } else {
851#ifndef QT_NO_COP 855#ifndef QT_NO_COP
852 { QCopEnvelope e( "QPE/System", "setDefaultRotation(int)" ); e << r; } 856 { QCopEnvelope e( "QPE/System", "setDefaultRotation(int)" ); e << r; }
853#endif 857#endif
854 } 858 }
855} 859}
856 860
857/*! 861/*!
858 \internal 862 \internal
859*/ 863*/
860void QPEApplication::applyStyle() 864void QPEApplication::applyStyle()
861{ 865{
862 Config config( "qpe" ); 866 Config config( "qpe" );
863 867
864 config.setGroup( "Appearance" ); 868 config.setGroup( "Appearance" );
865 869
866 // Widget style 870 // Widget style
867 QString style = config.readEntry( "Style", "Light" ); 871 QString style = config.readEntry( "Style", "Light" );
868 internalSetStyle( style ); 872 internalSetStyle( style );
869 873
870 // Colors 874 // Colors
871 QColor bgcolor( config.readEntry( "Background", "#E5E1D5" ) ); 875 QColor bgcolor( config.readEntry( "Background", "#E5E1D5" ) );
872 QColor btncolor( config.readEntry( "Button", "#D6CDBB" ) ); 876 QColor btncolor( config.readEntry( "Button", "#D6CDBB" ) );
873 QPalette pal( btncolor, bgcolor ); 877 QPalette pal( btncolor, bgcolor );
874 QString color = config.readEntry( "Highlight", "#800000" ); 878 QString color = config.readEntry( "Highlight", "#800000" );
875 pal.setColor( QColorGroup::Highlight, QColor( color ) ); 879 pal.setColor( QColorGroup::Highlight, QColor( color ) );