-rw-r--r-- | library/qpeapplication.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index f4db1ab..19adb00 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -940,48 +940,49 @@ void QPEApplication::setDefaultRotation( int r ) | |||
940 | setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 ); | 940 | setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 ); |
941 | Config config("qpe"); | 941 | Config config("qpe"); |
942 | config.setGroup( "Rotation" ); | 942 | config.setGroup( "Rotation" ); |
943 | config.writeEntry( "Rot", r ); | 943 | config.writeEntry( "Rot", r ); |
944 | } | 944 | } |
945 | else { | 945 | else { |
946 | #ifndef QT_NO_COP | 946 | #ifndef QT_NO_COP |
947 | { QCopEnvelope e( "QPE/System", "setDefaultRotation(int)" ); | 947 | { QCopEnvelope e( "QPE/System", "setDefaultRotation(int)" ); |
948 | e << r; | 948 | e << r; |
949 | } | 949 | } |
950 | #endif | 950 | #endif |
951 | 951 | ||
952 | } | 952 | } |
953 | } | 953 | } |
954 | 954 | ||
955 | 955 | ||
956 | /*! | 956 | /*! |
957 | \internal | 957 | \internal |
958 | */ | 958 | */ |
959 | void QPEApplication::applyStyle() | 959 | void QPEApplication::applyStyle() |
960 | { | 960 | { |
961 | Config config( "qpe" ); | 961 | Config config( "qpe" ); |
962 | config.setGroup( "Appearance" ); | 962 | config.setGroup( "Appearance" ); |
963 | 963 | ||
964 | #if QT_VERSION > 233 | ||
964 | // don't block ourselves ... | 965 | // don't block ourselves ... |
965 | Opie::force_appearance = 0; | 966 | Opie::force_appearance = 0; |
966 | 967 | ||
967 | static QString appname = Opie::binaryName ( ); | 968 | static QString appname = Opie::binaryName ( ); |
968 | 969 | ||
969 | QStringList ex = config. readListEntry ( "NoStyle", ';' ); | 970 | QStringList ex = config. readListEntry ( "NoStyle", ';' ); |
970 | int nostyle = 0; | 971 | int nostyle = 0; |
971 | for ( QStringList::Iterator it = ex. begin ( ); it != ex. end ( ); ++it ) { | 972 | for ( QStringList::Iterator it = ex. begin ( ); it != ex. end ( ); ++it ) { |
972 | if ( QRegExp (( *it ). mid ( 1 ), false, true ). find ( appname, 0 ) >= 0 ) { | 973 | if ( QRegExp (( *it ). mid ( 1 ), false, true ). find ( appname, 0 ) >= 0 ) { |
973 | nostyle = ( *it ). left ( 1 ). toInt ( 0, 32 ); | 974 | nostyle = ( *it ). left ( 1 ). toInt ( 0, 32 ); |
974 | break; | 975 | break; |
975 | } | 976 | } |
976 | } | 977 | } |
977 | 978 | ||
978 | // Widget style | 979 | // Widget style |
979 | QString style = config.readEntry( "Style", "Light" ); | 980 | QString style = config.readEntry( "Style", "Light" ); |
980 | 981 | ||
981 | // don't set a custom style | 982 | // don't set a custom style |
982 | if ( nostyle & Opie::Force_Style ) | 983 | if ( nostyle & Opie::Force_Style ) |
983 | style = "Light"; | 984 | style = "Light"; |
984 | 985 | ||
985 | internalSetStyle ( style ); | 986 | internalSetStyle ( style ); |
986 | 987 | ||
987 | // Colors | 988 | // Colors |
@@ -1012,48 +1013,49 @@ void QPEApplication::applyStyle() | |||
1012 | dec = ""; | 1013 | dec = ""; |
1013 | 1014 | ||
1014 | //qDebug ( "Setting Deco: %s -- old %s (%d)", dec.latin1(), d-> decorationName.latin1(), nostyle); | 1015 | //qDebug ( "Setting Deco: %s -- old %s (%d)", dec.latin1(), d-> decorationName.latin1(), nostyle); |
1015 | 1016 | ||
1016 | if ( dec != d->decorationName ) { | 1017 | if ( dec != d->decorationName ) { |
1017 | qwsSetDecoration( new QPEDecoration( dec ) ); | 1018 | qwsSetDecoration( new QPEDecoration( dec ) ); |
1018 | d->decorationName = dec; | 1019 | d->decorationName = dec; |
1019 | } | 1020 | } |
1020 | 1021 | ||
1021 | // Font | 1022 | // Font |
1022 | QString ff = config.readEntry( "FontFamily", font().family() ); | 1023 | QString ff = config.readEntry( "FontFamily", font().family() ); |
1023 | int fs = config.readNumEntry( "FontSize", font().pointSize() ); | 1024 | int fs = config.readNumEntry( "FontSize", font().pointSize() ); |
1024 | 1025 | ||
1025 | // don't set a custom font | 1026 | // don't set a custom font |
1026 | if ( nostyle & Opie::Force_Font ) { | 1027 | if ( nostyle & Opie::Force_Font ) { |
1027 | ff = "Vera"; | 1028 | ff = "Vera"; |
1028 | fs = 10; | 1029 | fs = 10; |
1029 | } | 1030 | } |
1030 | 1031 | ||
1031 | setFont ( QFont ( ff, fs ), true ); | 1032 | setFont ( QFont ( ff, fs ), true ); |
1032 | 1033 | ||
1033 | // revert to global blocking policy ... | 1034 | // revert to global blocking policy ... |
1034 | Opie::force_appearance = config. readBoolEntry ( "ForceStyle", false ) ? Opie::Force_All : Opie::Force_None; | 1035 | Opie::force_appearance = config. readBoolEntry ( "ForceStyle", false ) ? Opie::Force_All : Opie::Force_None; |
1035 | Opie::force_appearance &= ~nostyle; | 1036 | Opie::force_appearance &= ~nostyle; |
1037 | #endif | ||
1036 | } | 1038 | } |
1037 | 1039 | ||
1038 | void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data ) | 1040 | void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data ) |
1039 | { | 1041 | { |
1040 | #ifdef Q_WS_QWS | 1042 | #ifdef Q_WS_QWS |
1041 | QDataStream stream( data, IO_ReadOnly ); | 1043 | QDataStream stream( data, IO_ReadOnly ); |
1042 | if ( msg == "applyStyle()" ) { | 1044 | if ( msg == "applyStyle()" ) { |
1043 | applyStyle(); | 1045 | applyStyle(); |
1044 | } | 1046 | } |
1045 | else if ( msg == "toggleApplicationMenu()" ) { | 1047 | else if ( msg == "toggleApplicationMenu()" ) { |
1046 | QWidget *active = activeWindow ( ); | 1048 | QWidget *active = activeWindow ( ); |
1047 | 1049 | ||
1048 | if ( active ) { | 1050 | if ( active ) { |
1049 | QPEMenuToolFocusManager *man = QPEMenuToolFocusManager::manager ( ); | 1051 | QPEMenuToolFocusManager *man = QPEMenuToolFocusManager::manager ( ); |
1050 | bool oldactive = man-> isActive ( ); | 1052 | bool oldactive = man-> isActive ( ); |
1051 | 1053 | ||
1052 | man-> setActive( !man-> isActive() ); | 1054 | man-> setActive( !man-> isActive() ); |
1053 | 1055 | ||
1054 | if ( !oldactive && !man-> isActive ( )) { // no menubar to toggle -> try O-Menu | 1056 | if ( !oldactive && !man-> isActive ( )) { // no menubar to toggle -> try O-Menu |
1055 | QCopEnvelope e ( "QPE/TaskBar", "toggleStartMenu()" ); | 1057 | QCopEnvelope e ( "QPE/TaskBar", "toggleStartMenu()" ); |
1056 | } | 1058 | } |
1057 | } | 1059 | } |
1058 | } | 1060 | } |
1059 | else if ( msg == "setDefaultRotation(int)" ) { | 1061 | else if ( msg == "setDefaultRotation(int)" ) { |