-rw-r--r-- | library/qpeapplication.cpp | 56 |
1 files changed, 35 insertions, 21 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 619b4cb..4e08a1f 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -269,13 +269,16 @@ public: | |||
269 | 269 | ||
270 | class ResourceMimeFactory : public QMimeSourceFactory | 270 | class ResourceMimeFactory : public QMimeSourceFactory |
271 | { | 271 | { |
272 | public: | 272 | public: |
273 | ResourceMimeFactory() | 273 | ResourceMimeFactory() : resImage( 0 ) |
274 | { | 274 | { |
275 | setFilePath( Global::helpPath() ); | 275 | setFilePath( Global::helpPath() ); |
276 | setExtensionType( "html", "text/html;charset=UTF-8" ); | 276 | setExtensionType( "html", "text/html;charset=UTF-8" ); |
277 | } | 277 | } |
278 | ~ResourceMimeFactory() { | ||
279 | delete resImage; | ||
280 | } | ||
278 | 281 | ||
279 | const QMimeSource* data( const QString& abs_name ) const | 282 | const QMimeSource* data( const QString& abs_name ) const |
280 | { | 283 | { |
281 | const QMimeSource * r = QMimeSourceFactory::data( abs_name ); | 284 | const QMimeSource * r = QMimeSourceFactory::data( abs_name ); |
@@ -287,15 +290,20 @@ public: | |||
287 | int dot = name.findRev( '.' ); | 290 | int dot = name.findRev( '.' ); |
288 | if ( dot >= 0 ) | 291 | if ( dot >= 0 ) |
289 | name = name.left( dot ); | 292 | name = name.left( dot ); |
290 | QImage img = Resource::loadImage( name ); | 293 | QImage img = Resource::loadImage( name ); |
291 | if ( !img.isNull() ) | 294 | if ( !img.isNull() ) { |
292 | r = new QImageDrag( img ); | 295 | delete resImage; |
296 | resImage = new QImageDrag( img ); | ||
297 | r = resImage; | ||
298 | } | ||
293 | } | 299 | } |
294 | while ( !r && sl > 0 ); | 300 | while ( !r && sl > 0 ); |
295 | } | 301 | } |
296 | return r; | 302 | return r; |
297 | } | 303 | } |
304 | private: | ||
305 | mutable QImageDrag *resImage; | ||
298 | }; | 306 | }; |
299 | 307 | ||
300 | static int muted = 0; | 308 | static int muted = 0; |
301 | static int micMuted = 0; | 309 | static int micMuted = 0; |
@@ -982,21 +990,21 @@ void QPEApplication::applyStyle() | |||
982 | } | 990 | } |
983 | } | 991 | } |
984 | 992 | ||
985 | // Widget style | 993 | // Widget style |
986 | QString style = config.readEntry( "Style", "Light" ); | 994 | QString style = config.readEntry( "Style", "FlatStyle" ); |
987 | 995 | ||
988 | // don't set a custom style | 996 | // don't set a custom style |
989 | if ( nostyle & Opie::Force_Style ) | 997 | if ( nostyle & Opie::Force_Style ) |
990 | style = "Light"; | 998 | style = "FlatStyle"; |
991 | 999 | ||
992 | internalSetStyle ( style ); | 1000 | internalSetStyle ( style ); |
993 | 1001 | ||
994 | // Colors | 1002 | // Colors - from /etc/colors/Liquid.scheme |
995 | QColor bgcolor( config.readEntry( "Background", "#E5E1D5" ) ); | 1003 | QColor bgcolor( config.readEntry( "Background", "#E0E0E0" ) ); |
996 | QColor btncolor( config.readEntry( "Button", "#D6CDBB" ) ); | 1004 | QColor btncolor( config.readEntry( "Button", "#96c8fa" ) ); |
997 | QPalette pal( btncolor, bgcolor ); | 1005 | QPalette pal( btncolor, bgcolor ); |
998 | QString color = config.readEntry( "Highlight", "#800000" ); | 1006 | QString color = config.readEntry( "Highlight", "#73adef" ); |
999 | pal.setColor( QColorGroup::Highlight, QColor( color ) ); | 1007 | pal.setColor( QColorGroup::Highlight, QColor( color ) ); |
1000 | color = config.readEntry( "HighlightedText", "#FFFFFF" ); | 1008 | color = config.readEntry( "HighlightedText", "#FFFFFF" ); |
1001 | pal.setColor( QColorGroup::HighlightedText, QColor( color ) ); | 1009 | pal.setColor( QColorGroup::HighlightedText, QColor( color ) ); |
1002 | color = config.readEntry( "Text", "#000000" ); | 1010 | color = config.readEntry( "Text", "#000000" ); |
@@ -1011,9 +1019,9 @@ void QPEApplication::applyStyle() | |||
1011 | 1019 | ||
1012 | setPalette( pal, TRUE ); | 1020 | setPalette( pal, TRUE ); |
1013 | 1021 | ||
1014 | // Window Decoration | 1022 | // Window Decoration |
1015 | QString dec = config.readEntry( "Decoration", "Qtopia" ); | 1023 | QString dec = config.readEntry( "Decoration", "Flat" ); |
1016 | 1024 | ||
1017 | // don't set a custom deco | 1025 | // don't set a custom deco |
1018 | if ( nostyle & Opie::Force_Decoration ) | 1026 | if ( nostyle & Opie::Force_Decoration ) |
1019 | dec = ""; | 1027 | dec = ""; |
@@ -1297,20 +1305,26 @@ void QPEApplication::pidMessage( const QCString& msg, const QByteArray& data) | |||
1297 | if ( !mw ) | 1305 | if ( !mw ) |
1298 | mw = d->qpe_main_widget; | 1306 | mw = d->qpe_main_widget; |
1299 | if ( mw ) | 1307 | if ( mw ) |
1300 | Global::setDocument( mw, doc ); | 1308 | Global::setDocument( mw, doc ); |
1309 | } else { | ||
1310 | bool p = d->keep_running; | ||
1311 | d->keep_running = FALSE; | ||
1312 | emit appMessage( msg, data); | ||
1313 | if ( d->keep_running ) { | ||
1314 | d->notbusysent = FALSE; | ||
1315 | raiseAppropriateWindow(); | ||
1316 | if ( !p ) { | ||
1317 | // Tell the system we're still chugging along... | ||
1318 | #ifndef QT_NO_COP | ||
1319 | QCopEnvelope e("QPE/System", "appRaised(QString)"); | ||
1320 | e << d->appName; | ||
1321 | #endif | ||
1322 | } | ||
1323 | } | ||
1324 | if ( p ) | ||
1325 | d->keep_running = p; | ||
1301 | } | 1326 | } |
1302 | else if ( msg == "nextView()" ) { | ||
1303 | qDebug("got nextView()"); | ||
1304 | /* | ||
1305 | if ( raiseAppropriateWindow() ) | ||
1306 | */ | ||
1307 | emit appMessage( msg, data); | ||
1308 | } | ||
1309 | else { | ||
1310 | emit appMessage( msg, data); | ||
1311 | } | ||
1312 | |||
1313 | #endif | 1327 | #endif |
1314 | } | 1328 | } |
1315 | 1329 | ||
1316 | 1330 | ||