summaryrefslogtreecommitdiff
path: root/library/qpeapplication.cpp
Unidiff
Diffstat (limited to 'library/qpeapplication.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index 28fb13a..feba8b6 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -1103,62 +1103,66 @@ void QPEApplication::setCurrentMode( int x, int y, int depth )
1103 qwsServer->endDisplayReconfigure(); 1103 qwsServer->endDisplayReconfigure();
1104 1104
1105 // Get all the running apps to reset 1105 // Get all the running apps to reset
1106 QCopEnvelope env( "QPE/System", "reset()" ); 1106 QCopEnvelope env( "QPE/System", "reset()" );
1107 } 1107 }
1108} 1108}
1109 1109
1110void QPEApplication::reset() { 1110void QPEApplication::reset() {
1111 // Reconnect to the screen 1111 // Reconnect to the screen
1112 qt_screen->disconnect(); 1112 qt_screen->disconnect();
1113 qt_screen->connect( QString::null ); 1113 qt_screen->connect( QString::null );
1114 1114
1115 // Redraw everything 1115 // Redraw everything
1116 applyStyle(); 1116 applyStyle();
1117} 1117}
1118 1118
1119/*! 1119/*!
1120 \internal 1120 \internal
1121*/ 1121*/
1122void QPEApplication::applyStyle() 1122void QPEApplication::applyStyle()
1123{ 1123{
1124 Config config( "qpe" ); 1124 Config config( "qpe" );
1125 config.setGroup( "Appearance" ); 1125 config.setGroup( "Appearance" );
1126 1126
1127 #if QT_VERSION > 233 1127#if QT_VERSION > 233
1128#if !defined(OPIE_NO_OVERRIDE_QT)
1128 // don't block ourselves ... 1129 // don't block ourselves ...
1129 Opie::force_appearance = 0; 1130 Opie::force_appearance = 0;
1130 1131
1131 static QString appname = Opie::binaryName ( ); 1132 static QString appname = Opie::binaryName ( );
1132 1133
1133 QStringList ex = config. readListEntry ( "NoStyle", ';' ); 1134 QStringList ex = config. readListEntry ( "NoStyle", ';' );
1134 int nostyle = 0; 1135 int nostyle = 0;
1135 for ( QStringList::Iterator it = ex. begin ( ); it != ex. end ( ); ++it ) { 1136 for ( QStringList::Iterator it = ex. begin ( ); it != ex. end ( ); ++it ) {
1136 if ( QRegExp (( *it ). mid ( 1 ), false, true ). find ( appname, 0 ) >= 0 ) { 1137 if ( QRegExp (( *it ). mid ( 1 ), false, true ). find ( appname, 0 ) >= 0 ) {
1137 nostyle = ( *it ). left ( 1 ). toInt ( 0, 32 ); 1138 nostyle = ( *it ). left ( 1 ). toInt ( 0, 32 );
1138 break; 1139 break;
1139 } 1140 }
1140 } 1141 }
1142#else
1143 int nostyle = 0;
1144#endif
1141 1145
1142 // Widget style 1146 // Widget style
1143 QString style = config.readEntry( "Style", "FlatStyle" ); 1147 QString style = config.readEntry( "Style", "FlatStyle" );
1144 1148
1145 // don't set a custom style 1149 // don't set a custom style
1146 if ( nostyle & Opie::Force_Style ) 1150 if ( nostyle & Opie::Force_Style )
1147 style = "FlatStyle"; 1151 style = "FlatStyle";
1148 1152
1149 internalSetStyle ( style ); 1153 internalSetStyle ( style );
1150 1154
1151 // Colors - from /etc/colors/Liquid.scheme 1155 // Colors - from /etc/colors/Liquid.scheme
1152 QColor bgcolor( config.readEntry( "Background", "#E0E0E0" ) ); 1156 QColor bgcolor( config.readEntry( "Background", "#E0E0E0" ) );
1153 QColor btncolor( config.readEntry( "Button", "#96c8fa" ) ); 1157 QColor btncolor( config.readEntry( "Button", "#96c8fa" ) );
1154 QPalette pal( btncolor, bgcolor ); 1158 QPalette pal( btncolor, bgcolor );
1155 QString color = config.readEntry( "Highlight", "#73adef" ); 1159 QString color = config.readEntry( "Highlight", "#73adef" );
1156 pal.setColor( QColorGroup::Highlight, QColor( color ) ); 1160 pal.setColor( QColorGroup::Highlight, QColor( color ) );
1157 color = config.readEntry( "HighlightedText", "#FFFFFF" ); 1161 color = config.readEntry( "HighlightedText", "#FFFFFF" );
1158 pal.setColor( QColorGroup::HighlightedText, QColor( color ) ); 1162 pal.setColor( QColorGroup::HighlightedText, QColor( color ) );
1159 color = config.readEntry( "Text", "#000000" ); 1163 color = config.readEntry( "Text", "#000000" );
1160 pal.setColor( QColorGroup::Text, QColor( color ) ); 1164 pal.setColor( QColorGroup::Text, QColor( color ) );
1161 color = config.readEntry( "ButtonText", "#000000" ); 1165 color = config.readEntry( "ButtonText", "#000000" );
1162 pal.setColor( QPalette::Active, QColorGroup::ButtonText, QColor( color ) ); 1166 pal.setColor( QPalette::Active, QColorGroup::ButtonText, QColor( color ) );
1163 color = config.readEntry( "Base", "#FFFFFF" ); 1167 color = config.readEntry( "Base", "#FFFFFF" );
1164 pal.setColor( QColorGroup::Base, QColor( color ) ); 1168 pal.setColor( QColorGroup::Base, QColor( color ) );
@@ -1173,52 +1177,54 @@ void QPEApplication::applyStyle()
1173 1177
1174 // don't set a custom deco 1178 // don't set a custom deco
1175 if ( nostyle & Opie::Force_Decoration ) 1179 if ( nostyle & Opie::Force_Decoration )
1176 dec = ""; 1180 dec = "";
1177 1181
1178 //qDebug ( "Setting Deco: %s -- old %s (%d)", dec.latin1(), d-> decorationName.latin1(), nostyle); 1182 //qDebug ( "Setting Deco: %s -- old %s (%d)", dec.latin1(), d-> decorationName.latin1(), nostyle);
1179 1183
1180 if ( dec != d->decorationName ) { 1184 if ( dec != d->decorationName ) {
1181 qwsSetDecoration( new QPEDecoration( dec ) ); 1185 qwsSetDecoration( new QPEDecoration( dec ) );
1182 d->decorationName = dec; 1186 d->decorationName = dec;
1183 } 1187 }
1184 1188
1185 // Font 1189 // Font
1186 QString ff = config.readEntry( "FontFamily", font().family() ); 1190 QString ff = config.readEntry( "FontFamily", font().family() );
1187 int fs = config.readNumEntry( "FontSize", font().pointSize() ); 1191 int fs = config.readNumEntry( "FontSize", font().pointSize() );
1188 1192
1189 // don't set a custom font 1193 // don't set a custom font
1190 if ( nostyle & Opie::Force_Font ) { 1194 if ( nostyle & Opie::Force_Font ) {
1191 ff = "Vera"; 1195 ff = "Vera";
1192 fs = 10; 1196 fs = 10;
1193 } 1197 }
1194 1198
1195 setFont ( QFont ( ff, fs ), true ); 1199 setFont ( QFont ( ff, fs ), true );
1196 1200
1201#if !defined(OPIE_NO_OVERRIDE_QT)
1197 // revert to global blocking policy ... 1202 // revert to global blocking policy ...
1198 Opie::force_appearance = config. readBoolEntry ( "ForceStyle", false ) ? Opie::Force_All : Opie::Force_None; 1203 Opie::force_appearance = config. readBoolEntry ( "ForceStyle", false ) ? Opie::Force_All : Opie::Force_None;
1199 Opie::force_appearance &= ~nostyle; 1204 Opie::force_appearance &= ~nostyle;
1200 #endif 1205#endif
1206#endif
1201} 1207}
1202 1208
1203void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data ) 1209void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data )
1204{ 1210{
1205#ifdef Q_WS_QWS 1211#ifdef Q_WS_QWS
1206 QDataStream stream( data, IO_ReadOnly ); 1212 QDataStream stream( data, IO_ReadOnly );
1207 if ( msg == "applyStyle()" ) { 1213 if ( msg == "applyStyle()" ) {
1208 applyStyle(); 1214 applyStyle();
1209 } 1215 }
1210 else if ( msg == "toggleApplicationMenu()" ) { 1216 else if ( msg == "toggleApplicationMenu()" ) {
1211 QWidget *active = activeWindow ( ); 1217 QWidget *active = activeWindow ( );
1212 1218
1213 if ( active ) { 1219 if ( active ) {
1214 QPEMenuToolFocusManager *man = QPEMenuToolFocusManager::manager ( ); 1220 QPEMenuToolFocusManager *man = QPEMenuToolFocusManager::manager ( );
1215 bool oldactive = man-> isActive ( ); 1221 bool oldactive = man-> isActive ( );
1216 1222
1217 man-> setActive( !man-> isActive() ); 1223 man-> setActive( !man-> isActive() );
1218 1224
1219 if ( !oldactive && !man-> isActive ( )) { // no menubar to toggle -> try O-Menu 1225 if ( !oldactive && !man-> isActive ( )) { // no menubar to toggle -> try O-Menu
1220 QCopEnvelope e ( "QPE/TaskBar", "toggleStartMenu()" ); 1226 QCopEnvelope e ( "QPE/TaskBar", "toggleStartMenu()" );
1221 } 1227 }
1222 } 1228 }
1223 } 1229 }
1224 else if ( msg == "setDefaultRotation(int)" ) { 1230 else if ( msg == "setDefaultRotation(int)" ) {