-rw-r--r-- | library/qpeapplication.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index c782837..7cbda92 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -900,193 +900,193 @@ void QPEApplication::setDefaultRotation( int r ) | |||
900 | } | 900 | } |
901 | 901 | ||
902 | // exported to libpreload.so | 902 | // exported to libpreload.so |
903 | int opie_block_style = 0; | 903 | int opie_block_style = 0; |
904 | 904 | ||
905 | /*! | 905 | /*! |
906 | \internal | 906 | \internal |
907 | */ | 907 | */ |
908 | void QPEApplication::applyStyle() | 908 | void QPEApplication::applyStyle() |
909 | { | 909 | { |
910 | Config config( "qpe" ); | 910 | Config config( "qpe" ); |
911 | config.setGroup( "Appearance" ); | 911 | config.setGroup( "Appearance" ); |
912 | 912 | ||
913 | // don't block ourselves ... | 913 | // don't block ourselves ... |
914 | opie_block_style = 0; | 914 | opie_block_style = 0; |
915 | 915 | ||
916 | 916 | ||
917 | static QString appname; | 917 | static QString appname; |
918 | 918 | ||
919 | if ( appname. isNull ( )) { | 919 | if ( appname. isNull ( )) { |
920 | char src [32]; | 920 | char src [32]; |
921 | char dst [PATH_MAX + 1]; | 921 | char dst [PATH_MAX + 1]; |
922 | ::sprintf ( src, "/proc/%d/exe", ::getpid ( )); | 922 | ::sprintf ( src, "/proc/%d/exe", ::getpid ( )); |
923 | int l = ::readlink ( src, dst, PATH_MAX ); | 923 | int l = ::readlink ( src, dst, PATH_MAX ); |
924 | if ( l > 0 ) { | 924 | if ( l > 0 ) { |
925 | dst [l] = 0; | 925 | dst [l] = 0; |
926 | const char *b = ::strrchr ( dst, '/' ); | 926 | const char *b = ::strrchr ( dst, '/' ); |
927 | appname = ( b ? b + 1 : dst ); | 927 | appname = ( b ? b + 1 : dst ); |
928 | } | 928 | } |
929 | else | 929 | else |
930 | appname = ""; | 930 | appname = ""; |
931 | } | 931 | } |
932 | 932 | ||
933 | 933 | ||
934 | QStringList ex = config. readListEntry ( "NoStyle", ';' ); | 934 | QStringList ex = config. readListEntry ( "NoStyle", ';' ); |
935 | int nostyle = 0; | 935 | int nostyle = 0; |
936 | for ( QStringList::Iterator it = ex. begin ( ); it != ex. end ( ); ++it ) { | 936 | for ( QStringList::Iterator it = ex. begin ( ); it != ex. end ( ); ++it ) { |
937 | if ( QRegExp (( *it ). mid ( 1 ), false, true ). find ( appname, 0 ) >= 0 ) { | 937 | if ( QRegExp (( *it ). mid ( 1 ), false, true ). find ( appname, 0 ) >= 0 ) { |
938 | nostyle = ( *it ). left ( 1 ). toInt ( 0, 32 ); | 938 | nostyle = ( *it ). left ( 1 ). toInt ( 0, 32 ); |
939 | break; | 939 | break; |
940 | } | 940 | } |
941 | } | 941 | } |
942 | 942 | ||
943 | // Widget style | 943 | // Widget style |
944 | QString style = config.readEntry( "Style", "Light" ); | 944 | QString style = config.readEntry( "Style", "Light" ); |
945 | 945 | ||
946 | // don't set a custom style | 946 | // don't set a custom style |
947 | if ( nostyle & 0x01 ) | 947 | if ( nostyle & 0x01 ) |
948 | style = "Light"; | 948 | style = "Light"; |
949 | 949 | ||
950 | internalSetStyle ( style ); | 950 | internalSetStyle ( style ); |
951 | 951 | ||
952 | // Colors | 952 | // Colors |
953 | QColor bgcolor( config.readEntry( "Background", "#E5E1D5" ) ); | 953 | QColor bgcolor( config.readEntry( "Background", "#E5E1D5" ) ); |
954 | QColor btncolor( config.readEntry( "Button", "#D6CDBB" ) ); | 954 | QColor btncolor( config.readEntry( "Button", "#D6CDBB" ) ); |
955 | QPalette pal( btncolor, bgcolor ); | 955 | QPalette pal( btncolor, bgcolor ); |
956 | QString color = config.readEntry( "Highlight", "#800000" ); | 956 | QString color = config.readEntry( "Highlight", "#800000" ); |
957 | pal.setColor( QColorGroup::Highlight, QColor( color ) ); | 957 | pal.setColor( QColorGroup::Highlight, QColor( color ) ); |
958 | color = config.readEntry( "HighlightedText", "#FFFFFF" ); | 958 | color = config.readEntry( "HighlightedText", "#FFFFFF" ); |
959 | pal.setColor( QColorGroup::HighlightedText, QColor( color ) ); | 959 | pal.setColor( QColorGroup::HighlightedText, QColor( color ) ); |
960 | color = config.readEntry( "Text", "#000000" ); | 960 | color = config.readEntry( "Text", "#000000" ); |
961 | pal.setColor( QColorGroup::Text, QColor( color ) ); | 961 | pal.setColor( QColorGroup::Text, QColor( color ) ); |
962 | color = config.readEntry( "ButtonText", "#000000" ); | 962 | color = config.readEntry( "ButtonText", "#000000" ); |
963 | pal.setColor( QPalette::Active, QColorGroup::ButtonText, QColor( color ) ); | 963 | pal.setColor( QPalette::Active, QColorGroup::ButtonText, QColor( color ) ); |
964 | color = config.readEntry( "Base", "#FFFFFF" ); | 964 | color = config.readEntry( "Base", "#FFFFFF" ); |
965 | pal.setColor( QColorGroup::Base, QColor( color ) ); | 965 | pal.setColor( QColorGroup::Base, QColor( color ) ); |
966 | 966 | ||
967 | pal.setColor( QPalette::Disabled, QColorGroup::Text, | 967 | pal.setColor( QPalette::Disabled, QColorGroup::Text, |
968 | pal.color( QPalette::Active, QColorGroup::Background ).dark() ); | 968 | pal.color( QPalette::Active, QColorGroup::Background ).dark() ); |
969 | 969 | ||
970 | setPalette( pal, TRUE ); | 970 | setPalette( pal, TRUE ); |
971 | 971 | ||
972 | // Window Decoration | 972 | // Window Decoration |
973 | QString dec = config.readEntry( "Decoration", "Qtopia" ); | 973 | QString dec = config.readEntry( "Decoration", "Qtopia" ); |
974 | 974 | ||
975 | // don't set a custom deco | 975 | // don't set a custom deco |
976 | if ( nostyle & 0x04 ) | 976 | if ( nostyle & 0x04 ) |
977 | dec = ""; | 977 | dec = ""; |
978 | 978 | ||
979 | //qDebug ( "Setting Deco: %s -- old %s (%d)", dec.latin1(), d-> decorationName.latin1(), nostyle); | 979 | //qDebug ( "Setting Deco: %s -- old %s (%d)", dec.latin1(), d-> decorationName.latin1(), nostyle); |
980 | 980 | ||
981 | if ( dec != d->decorationName ) { | 981 | if ( dec != d->decorationName ) { |
982 | qwsSetDecoration( new QPEDecoration( dec ) ); | 982 | qwsSetDecoration( new QPEDecoration( dec ) ); |
983 | d->decorationName = dec; | 983 | d->decorationName = dec; |
984 | } | 984 | } |
985 | 985 | ||
986 | // Font | 986 | // Font |
987 | QString ff = config.readEntry( "FontFamily", font().family() ); | 987 | QString ff = config.readEntry( "FontFamily", font().family() ); |
988 | int fs = config.readNumEntry( "FontSize", font().pointSize() ); | 988 | int fs = config.readNumEntry( "FontSize", font().pointSize() ); |
989 | 989 | ||
990 | // don't set a custom font | 990 | // don't set a custom font |
991 | if ( nostyle & 0x02 ) { | 991 | if ( nostyle & 0x02 ) { |
992 | ff = "Helvetica"; | 992 | ff = "Helvetica"; |
993 | fs = 10; | 993 | fs = 10; |
994 | } | 994 | } |
995 | 995 | ||
996 | setFont( QFont(ff, fs) ); | 996 | setFont ( QFont ( ff, fs ), true ); |
997 | 997 | ||
998 | // revert to global blocking policy ... | 998 | // revert to global blocking policy ... |
999 | opie_block_style = config. readBoolEntry ( "ForceStyle", false ) ? 0xff : 0x00; | 999 | opie_block_style = config. readBoolEntry ( "ForceStyle", false ) ? 0xff : 0x00; |
1000 | opie_block_style -= nostyle; | 1000 | opie_block_style -= nostyle; |
1001 | } | 1001 | } |
1002 | 1002 | ||
1003 | void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data ) | 1003 | void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data ) |
1004 | { | 1004 | { |
1005 | #ifdef Q_WS_QWS | 1005 | #ifdef Q_WS_QWS |
1006 | QDataStream stream( data, IO_ReadOnly ); | 1006 | QDataStream stream( data, IO_ReadOnly ); |
1007 | if ( msg == "applyStyle()" ) { | 1007 | if ( msg == "applyStyle()" ) { |
1008 | applyStyle(); | 1008 | applyStyle(); |
1009 | } | 1009 | } |
1010 | else if ( msg == "setDefaultRotation(int)" ) { | 1010 | else if ( msg == "setDefaultRotation(int)" ) { |
1011 | if ( type() == GuiServer ) { | 1011 | if ( type() == GuiServer ) { |
1012 | int r; | 1012 | int r; |
1013 | stream >> r; | 1013 | stream >> r; |
1014 | setDefaultRotation( r ); | 1014 | setDefaultRotation( r ); |
1015 | } | 1015 | } |
1016 | } | 1016 | } |
1017 | else if ( msg == "shutdown()" ) { | 1017 | else if ( msg == "shutdown()" ) { |
1018 | if ( type() == GuiServer ) | 1018 | if ( type() == GuiServer ) |
1019 | shutdown(); | 1019 | shutdown(); |
1020 | } | 1020 | } |
1021 | else if ( msg == "quit()" ) { | 1021 | else if ( msg == "quit()" ) { |
1022 | if ( type() != GuiServer ) | 1022 | if ( type() != GuiServer ) |
1023 | tryQuit(); | 1023 | tryQuit(); |
1024 | } | 1024 | } |
1025 | else if ( msg == "forceQuit()" ) { | 1025 | else if ( msg == "forceQuit()" ) { |
1026 | if ( type() != GuiServer ) | 1026 | if ( type() != GuiServer ) |
1027 | quit(); | 1027 | quit(); |
1028 | } | 1028 | } |
1029 | else if ( msg == "restart()" ) { | 1029 | else if ( msg == "restart()" ) { |
1030 | if ( type() == GuiServer ) | 1030 | if ( type() == GuiServer ) |
1031 | restart(); | 1031 | restart(); |
1032 | } | 1032 | } |
1033 | else if ( msg == "grabKeyboard(QString)" ) { | 1033 | else if ( msg == "grabKeyboard(QString)" ) { |
1034 | QString who; | 1034 | QString who; |
1035 | stream >> who; | 1035 | stream >> who; |
1036 | if ( who.isEmpty() ) | 1036 | if ( who.isEmpty() ) |
1037 | d->kbgrabber = 0; | 1037 | d->kbgrabber = 0; |
1038 | else if ( who != d->appName ) | 1038 | else if ( who != d->appName ) |
1039 | d->kbgrabber = 1; | 1039 | d->kbgrabber = 1; |
1040 | else | 1040 | else |
1041 | d->kbgrabber = 2; | 1041 | d->kbgrabber = 2; |
1042 | } | 1042 | } |
1043 | else if ( msg == "language(QString)" ) { | 1043 | else if ( msg == "language(QString)" ) { |
1044 | if ( type() == GuiServer ) { | 1044 | if ( type() == GuiServer ) { |
1045 | QString l; | 1045 | QString l; |
1046 | stream >> l; | 1046 | stream >> l; |
1047 | QString cl = getenv( "LANG" ); | 1047 | QString cl = getenv( "LANG" ); |
1048 | if ( cl != l ) { | 1048 | if ( cl != l ) { |
1049 | if ( l.isNull() ) | 1049 | if ( l.isNull() ) |
1050 | unsetenv( "LANG" ); | 1050 | unsetenv( "LANG" ); |
1051 | else | 1051 | else |
1052 | setenv( "LANG", l.latin1(), 1 ); | 1052 | setenv( "LANG", l.latin1(), 1 ); |
1053 | restart(); | 1053 | restart(); |
1054 | } | 1054 | } |
1055 | } | 1055 | } |
1056 | } | 1056 | } |
1057 | else if ( msg == "timeChange(QString)" ) { | 1057 | else if ( msg == "timeChange(QString)" ) { |
1058 | QString t; | 1058 | QString t; |
1059 | stream >> t; | 1059 | stream >> t; |
1060 | if ( t.isNull() ) | 1060 | if ( t.isNull() ) |
1061 | unsetenv( "TZ" ); | 1061 | unsetenv( "TZ" ); |
1062 | else | 1062 | else |
1063 | setenv( "TZ", t.latin1(), 1 ); | 1063 | setenv( "TZ", t.latin1(), 1 ); |
1064 | // emit the signal so everyone else knows... | 1064 | // emit the signal so everyone else knows... |
1065 | emit timeChanged(); | 1065 | emit timeChanged(); |
1066 | } | 1066 | } |
1067 | else if ( msg == "execute(QString)" ) { | 1067 | else if ( msg == "execute(QString)" ) { |
1068 | if ( type() == GuiServer ) { | 1068 | if ( type() == GuiServer ) { |
1069 | QString t; | 1069 | QString t; |
1070 | stream >> t; | 1070 | stream >> t; |
1071 | Global::execute( t ); | 1071 | Global::execute( t ); |
1072 | } | 1072 | } |
1073 | } | 1073 | } |
1074 | else if ( msg == "execute(QString,QString)" ) { | 1074 | else if ( msg == "execute(QString,QString)" ) { |
1075 | if ( type() == GuiServer ) { | 1075 | if ( type() == GuiServer ) { |
1076 | QString t, d; | 1076 | QString t, d; |
1077 | stream >> t >> d; | 1077 | stream >> t >> d; |
1078 | Global::execute( t, d ); | 1078 | Global::execute( t, d ); |
1079 | } | 1079 | } |
1080 | } | 1080 | } |
1081 | else if ( msg == "addAlarm(QDateTime,QCString,QCString,int)" ) { | 1081 | else if ( msg == "addAlarm(QDateTime,QCString,QCString,int)" ) { |
1082 | if ( type() == GuiServer ) { | 1082 | if ( type() == GuiServer ) { |
1083 | QDateTime when; | 1083 | QDateTime when; |
1084 | QCString channel, message; | 1084 | QCString channel, message; |
1085 | int data; | 1085 | int data; |
1086 | stream >> when >> channel >> message >> data; | 1086 | stream >> when >> channel >> message >> data; |
1087 | AlarmServer::addAlarm( when, channel, message, data ); | 1087 | AlarmServer::addAlarm( when, channel, message, data ); |
1088 | } | 1088 | } |
1089 | } | 1089 | } |
1090 | else if ( msg == "deleteAlarm(QDateTime,QCString,QCString,int)" ) { | 1090 | else if ( msg == "deleteAlarm(QDateTime,QCString,QCString,int)" ) { |
1091 | if ( type() == GuiServer ) { | 1091 | if ( type() == GuiServer ) { |
1092 | QDateTime when; | 1092 | QDateTime when; |