-rw-r--r-- | library/opie-common.control | 4 | ||||
-rw-r--r-- | library/qpeapplication.cpp | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/library/opie-common.control b/library/opie-common.control index 52048a3..1cdd465 100644 --- a/library/opie-common.control +++ b/library/opie-common.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-common | 1 | Package: opie-common |
2 | Files: etc/colors bin/opie-reorgfiles apps/*/.directory etc/mime.types apps/Settings/quit.desktop pics/logo/* | 2 | Files: etc/colors bin/opie-reorgfiles apps/*/.directory etc/mime.types apps/Settings/quit.desktop pics/logo/* |
3 | Priority: required | 3 | Priority: required |
4 | Section: opie/system | 4 | Section: opie/system |
5 | Maintainer: Project Opie <opie@handhelds.org> | 5 | Maintainer: Project Opie <opie@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION.2 | 7 | Version: $QPE_VERSION-$SUB_VERSION.3 |
8 | Depends: libqpe1, qte-fonts, qpf-helvetica | 8 | Depends: libqpe1, qte-fonts, qpf-bitstream-vera |
9 | Replaces: opie-base | 9 | Replaces: opie-base |
10 | Description: Core opie files | 10 | Description: Core opie files |
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 7f8299a..f4bfda9 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -425,203 +425,203 @@ static void setTreble( int t = 0, int percent = -1 ) | |||
425 | 425 | ||
426 | \internal | 426 | \internal |
427 | */ | 427 | */ |
428 | 428 | ||
429 | /*! | 429 | /*! |
430 | \fn void QPEApplication::timeChanged(); | 430 | \fn void QPEApplication::timeChanged(); |
431 | This signal is emitted when the time changes outside the normal | 431 | This signal is emitted when the time changes outside the normal |
432 | passage of time, i.e. if the time is set backwards or forwards. | 432 | passage of time, i.e. if the time is set backwards or forwards. |
433 | */ | 433 | */ |
434 | 434 | ||
435 | /*! | 435 | /*! |
436 | \fn void QPEApplication::clockChanged( bool ampm ); | 436 | \fn void QPEApplication::clockChanged( bool ampm ); |
437 | 437 | ||
438 | This signal is emitted when the user changes the clock's style. If | 438 | This signal is emitted when the user changes the clock's style. If |
439 | \a ampm is TRUE, the user wants a 12-hour AM/PM clock, otherwise, | 439 | \a ampm is TRUE, the user wants a 12-hour AM/PM clock, otherwise, |
440 | they want a 24-hour clock. | 440 | they want a 24-hour clock. |
441 | */ | 441 | */ |
442 | 442 | ||
443 | /*! | 443 | /*! |
444 | \fn void QPEApplication::volumeChanged( bool muted ) | 444 | \fn void QPEApplication::volumeChanged( bool muted ) |
445 | 445 | ||
446 | This signal is emitted whenever the mute state is changed. If \a | 446 | This signal is emitted whenever the mute state is changed. If \a |
447 | muted is TRUE, then sound output has been muted. | 447 | muted is TRUE, then sound output has been muted. |
448 | */ | 448 | */ |
449 | 449 | ||
450 | /*! | 450 | /*! |
451 | \fn void QPEApplication::weekChanged( bool startOnMonday ) | 451 | \fn void QPEApplication::weekChanged( bool startOnMonday ) |
452 | 452 | ||
453 | This signal is emitted if the week start day is changed. If \a | 453 | This signal is emitted if the week start day is changed. If \a |
454 | startOnMonday is TRUE then the first day of the week is Monday; if | 454 | startOnMonday is TRUE then the first day of the week is Monday; if |
455 | \a startOnMonday is FALSE then the first day of the week is | 455 | \a startOnMonday is FALSE then the first day of the week is |
456 | Sunday. | 456 | Sunday. |
457 | */ | 457 | */ |
458 | 458 | ||
459 | /*! | 459 | /*! |
460 | \fn void QPEApplication::dateFormatChanged(DateFormat) | 460 | \fn void QPEApplication::dateFormatChanged(DateFormat) |
461 | 461 | ||
462 | This signal is emitted whenever the date format is changed. | 462 | This signal is emitted whenever the date format is changed. |
463 | */ | 463 | */ |
464 | 464 | ||
465 | /*! | 465 | /*! |
466 | \fn void QPEApplication::flush() | 466 | \fn void QPEApplication::flush() |
467 | 467 | ||
468 | ### | 468 | ### |
469 | */ | 469 | */ |
470 | 470 | ||
471 | /*! | 471 | /*! |
472 | \fn void QPEApplication::reload() | 472 | \fn void QPEApplication::reload() |
473 | 473 | ||
474 | */ | 474 | */ |
475 | 475 | ||
476 | /*! | 476 | /*! |
477 | \fn void QPEApplication::appMessage( const QCString& msg, const QByteArray& data ) | 477 | \fn void QPEApplication::appMessage( const QCString& msg, const QByteArray& data ) |
478 | 478 | ||
479 | This signal is emitted when a message is received on this | 479 | This signal is emitted when a message is received on this |
480 | application's QPE/Application/<i>appname</i> \link qcop.html | 480 | application's QPE/Application/<i>appname</i> \link qcop.html |
481 | QCop\endlink channel. | 481 | QCop\endlink channel. |
482 | 482 | ||
483 | The slot to which you connect this signal uses \a msg and \a data | 483 | The slot to which you connect this signal uses \a msg and \a data |
484 | in the following way: | 484 | in the following way: |
485 | 485 | ||
486 | \code | 486 | \code |
487 | void MyWidget::receive( const QCString& msg, const QByteArray& data ) | 487 | void MyWidget::receive( const QCString& msg, const QByteArray& data ) |
488 | { | 488 | { |
489 | QDataStream stream( data, IO_ReadOnly ); | 489 | QDataStream stream( data, IO_ReadOnly ); |
490 | if ( msg == "someMessage(int,int,int)" ) { | 490 | if ( msg == "someMessage(int,int,int)" ) { |
491 | int a,b,c; | 491 | int a,b,c; |
492 | stream >> a >> b >> c; | 492 | stream >> a >> b >> c; |
493 | ... | 493 | ... |
494 | } else if ( msg == "otherMessage(QString)" ) { | 494 | } else if ( msg == "otherMessage(QString)" ) { |
495 | ... | 495 | ... |
496 | } | 496 | } |
497 | } | 497 | } |
498 | \endcode | 498 | \endcode |
499 | 499 | ||
500 | \sa qcop.html | 500 | \sa qcop.html |
501 | Note that messages received here may be processed by qpe application | 501 | Note that messages received here may be processed by qpe application |
502 | and emitted as signals, such as flush() and reload(). | 502 | and emitted as signals, such as flush() and reload(). |
503 | */ | 503 | */ |
504 | 504 | ||
505 | /*! | 505 | /*! |
506 | Constructs a QPEApplication just as you would construct | 506 | Constructs a QPEApplication just as you would construct |
507 | a QApplication, passing \a argc, \a argv, and \a t. | 507 | a QApplication, passing \a argc, \a argv, and \a t. |
508 | 508 | ||
509 | For applications, \a t should be the default, GuiClient. Only | 509 | For applications, \a t should be the default, GuiClient. Only |
510 | the Qtopia server passes GuiServer. | 510 | the Qtopia server passes GuiServer. |
511 | */ | 511 | */ |
512 | QPEApplication::QPEApplication( int & argc, char **argv, Type t ) | 512 | QPEApplication::QPEApplication( int & argc, char **argv, Type t ) |
513 | : QApplication( argc, argv, t ) | 513 | : QApplication( argc, argv, t ) |
514 | { | 514 | { |
515 | d = new QPEApplicationData; | 515 | d = new QPEApplicationData; |
516 | d->loadTextCodecs(); | 516 | d->loadTextCodecs(); |
517 | d->loadImageCodecs(); | 517 | d->loadImageCodecs(); |
518 | int dw = desktop() ->width(); | 518 | int dw = desktop() ->width(); |
519 | 519 | ||
520 | if ( dw < 200 ) { | 520 | if ( dw < 200 ) { |
521 | setFont( QFont( "helvetica", 8 ) ); | 521 | setFont( QFont( "vera", 8 ) ); |
522 | AppLnk::setSmallIconSize( 10 ); | 522 | AppLnk::setSmallIconSize( 10 ); |
523 | AppLnk::setBigIconSize( 28 ); | 523 | AppLnk::setBigIconSize( 28 ); |
524 | } | 524 | } |
525 | else if ( dw > 600 ) { | 525 | else if ( dw > 600 ) { |
526 | setFont( QFont( "helvetica", 18 ) ); | 526 | setFont( QFont( "vera", 18 ) ); |
527 | AppLnk::setSmallIconSize( 24 ); | 527 | AppLnk::setSmallIconSize( 24 ); |
528 | AppLnk::setBigIconSize( 48 ); | 528 | AppLnk::setBigIconSize( 48 ); |
529 | } | 529 | } |
530 | else if ( dw > 200 ) { | 530 | else if ( dw > 200 ) { |
531 | setFont( QFont( "helvetica", 10 ) ); | 531 | setFont( QFont( "vera", 10 ) ); |
532 | AppLnk::setSmallIconSize( 14 ); | 532 | AppLnk::setSmallIconSize( 14 ); |
533 | AppLnk::setBigIconSize( 32 ); | 533 | AppLnk::setBigIconSize( 32 ); |
534 | } | 534 | } |
535 | 535 | ||
536 | 536 | ||
537 | QMimeSourceFactory::setDefaultFactory( new ResourceMimeFactory ); | 537 | QMimeSourceFactory::setDefaultFactory( new ResourceMimeFactory ); |
538 | 538 | ||
539 | connect( this, SIGNAL( lastWindowClosed() ), this, SLOT( hideOrQuit() ) ); | 539 | connect( this, SIGNAL( lastWindowClosed() ), this, SLOT( hideOrQuit() ) ); |
540 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 540 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
541 | 541 | ||
542 | QString qcopfn( "/tmp/qcop-msg-" ); | 542 | QString qcopfn( "/tmp/qcop-msg-" ); |
543 | qcopfn += QString( argv[ 0 ] ); // append command name | 543 | qcopfn += QString( argv[ 0 ] ); // append command name |
544 | 544 | ||
545 | QFile f( qcopfn ); | 545 | QFile f( qcopfn ); |
546 | if ( f.open( IO_ReadOnly ) ) { | 546 | if ( f.open( IO_ReadOnly ) ) { |
547 | flock( f.handle(), LOCK_EX ); | 547 | flock( f.handle(), LOCK_EX ); |
548 | } | 548 | } |
549 | 549 | ||
550 | sysChannel = new QCopChannel( "QPE/System", this ); | 550 | sysChannel = new QCopChannel( "QPE/System", this ); |
551 | connect( sysChannel, SIGNAL( received( const QCString &, const QByteArray & ) ), | 551 | connect( sysChannel, SIGNAL( received( const QCString &, const QByteArray & ) ), |
552 | this, SLOT( systemMessage( const QCString &, const QByteArray & ) ) ); | 552 | this, SLOT( systemMessage( const QCString &, const QByteArray & ) ) ); |
553 | 553 | ||
554 | QCString channel = QCString( argv[ 0 ] ); | 554 | QCString channel = QCString( argv[ 0 ] ); |
555 | channel.replace( QRegExp( ".*/" ), "" ); | 555 | channel.replace( QRegExp( ".*/" ), "" ); |
556 | d->appName = channel; | 556 | d->appName = channel; |
557 | channel = "QPE/Application/" + channel; | 557 | channel = "QPE/Application/" + channel; |
558 | pidChannel = new QCopChannel( channel, this ); | 558 | pidChannel = new QCopChannel( channel, this ); |
559 | connect( pidChannel, SIGNAL( received( const QCString &, const QByteArray & ) ), | 559 | connect( pidChannel, SIGNAL( received( const QCString &, const QByteArray & ) ), |
560 | this, SLOT( pidMessage( const QCString &, const QByteArray & ) ) ); | 560 | this, SLOT( pidMessage( const QCString &, const QByteArray & ) ) ); |
561 | 561 | ||
562 | if ( f.isOpen() ) { | 562 | if ( f.isOpen() ) { |
563 | d->keep_running = FALSE; | 563 | d->keep_running = FALSE; |
564 | QDataStream ds( &f ); | 564 | QDataStream ds( &f ); |
565 | QCString channel, message; | 565 | QCString channel, message; |
566 | QByteArray data; | 566 | QByteArray data; |
567 | while ( !ds.atEnd() ) { | 567 | while ( !ds.atEnd() ) { |
568 | ds >> channel >> message >> data; | 568 | ds >> channel >> message >> data; |
569 | d->enqueueQCop( channel, message, data ); | 569 | d->enqueueQCop( channel, message, data ); |
570 | } | 570 | } |
571 | 571 | ||
572 | flock( f.handle(), LOCK_UN ); | 572 | flock( f.handle(), LOCK_UN ); |
573 | f.close(); | 573 | f.close(); |
574 | f.remove(); | 574 | f.remove(); |
575 | } | 575 | } |
576 | 576 | ||
577 | for ( int a = 0; a < argc; a++ ) { | 577 | for ( int a = 0; a < argc; a++ ) { |
578 | if ( qstrcmp( argv[ a ], "-preload" ) == 0 ) { | 578 | if ( qstrcmp( argv[ a ], "-preload" ) == 0 ) { |
579 | argv[ a ] = argv[ a + 1 ]; | 579 | argv[ a ] = argv[ a + 1 ]; |
580 | a++; | 580 | a++; |
581 | d->preloaded = TRUE; | 581 | d->preloaded = TRUE; |
582 | argc -= 1; | 582 | argc -= 1; |
583 | } | 583 | } |
584 | else if ( qstrcmp( argv[ a ], "-preload-show" ) == 0 ) { | 584 | else if ( qstrcmp( argv[ a ], "-preload-show" ) == 0 ) { |
585 | argv[ a ] = argv[ a + 1 ]; | 585 | argv[ a ] = argv[ a + 1 ]; |
586 | a++; | 586 | a++; |
587 | d->preloaded = TRUE; | 587 | d->preloaded = TRUE; |
588 | d->forceshow = TRUE; | 588 | d->forceshow = TRUE; |
589 | argc -= 1; | 589 | argc -= 1; |
590 | } | 590 | } |
591 | } | 591 | } |
592 | 592 | ||
593 | /* overide stored arguments */ | 593 | /* overide stored arguments */ |
594 | setArgs( argc, argv ); | 594 | setArgs( argc, argv ); |
595 | 595 | ||
596 | #endif | 596 | #endif |
597 | 597 | ||
598 | // qwsSetDecoration( new QPEDecoration() ); | 598 | // qwsSetDecoration( new QPEDecoration() ); |
599 | 599 | ||
600 | #ifndef QT_NO_TRANSLATION | 600 | #ifndef QT_NO_TRANSLATION |
601 | 601 | ||
602 | QStringList langs = Global::languageList(); | 602 | QStringList langs = Global::languageList(); |
603 | for ( QStringList::ConstIterator it = langs.begin(); it != langs.end(); ++it ) { | 603 | for ( QStringList::ConstIterator it = langs.begin(); it != langs.end(); ++it ) { |
604 | QString lang = *it; | 604 | QString lang = *it; |
605 | 605 | ||
606 | QTranslator * trans; | 606 | QTranslator * trans; |
607 | QString tfn; | 607 | QString tfn; |
608 | 608 | ||
609 | trans = new QTranslator( this ); | 609 | trans = new QTranslator( this ); |
610 | tfn = qpeDir() + "/i18n/" + lang + "/libqpe.qm"; | 610 | tfn = qpeDir() + "/i18n/" + lang + "/libqpe.qm"; |
611 | if ( trans->load( tfn ) ) | 611 | if ( trans->load( tfn ) ) |
612 | installTranslator( trans ); | 612 | installTranslator( trans ); |
613 | else | 613 | else |
614 | delete trans; | 614 | delete trans; |
615 | 615 | ||
616 | trans = new QTranslator( this ); | 616 | trans = new QTranslator( this ); |
617 | tfn = qpeDir() + "/i18n/" + lang + "/" + d->appName + ".qm"; | 617 | tfn = qpeDir() + "/i18n/" + lang + "/" + d->appName + ".qm"; |
618 | if ( trans->load( tfn ) ) | 618 | if ( trans->load( tfn ) ) |
619 | installTranslator( trans ); | 619 | installTranslator( trans ); |
620 | else | 620 | else |
621 | delete trans; | 621 | delete trans; |
622 | 622 | ||
623 | //###language/font hack; should look it up somewhere | 623 | //###language/font hack; should look it up somewhere |
624 | #ifdef QWS | 624 | #ifdef QWS |
625 | 625 | ||
626 | if ( lang == "ja" || lang == "zh_CN" || lang == "zh_TW" || lang == "ko" ) { | 626 | if ( lang == "ja" || lang == "zh_CN" || lang == "zh_TW" || lang == "ko" ) { |
627 | QFont fn = FontManager::unicodeFont( FontManager::Proportional ); | 627 | QFont fn = FontManager::unicodeFont( FontManager::Proportional ); |
@@ -943,193 +943,193 @@ int QPEApplication::defaultRotation() | |||
943 | } | 943 | } |
944 | 944 | ||
945 | /*! | 945 | /*! |
946 | \internal | 946 | \internal |
947 | */ | 947 | */ |
948 | void QPEApplication::setDefaultRotation( int r ) | 948 | void QPEApplication::setDefaultRotation( int r ) |
949 | { | 949 | { |
950 | if ( qApp->type() == GuiServer ) { | 950 | if ( qApp->type() == GuiServer ) { |
951 | deforient = r; | 951 | deforient = r; |
952 | setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 ); | 952 | setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 ); |
953 | Config config("qpe"); | 953 | Config config("qpe"); |
954 | config.setGroup( "Rotation" ); | 954 | config.setGroup( "Rotation" ); |
955 | config.writeEntry( "Rot", r ); | 955 | config.writeEntry( "Rot", r ); |
956 | } | 956 | } |
957 | else { | 957 | else { |
958 | #ifndef QT_NO_COP | 958 | #ifndef QT_NO_COP |
959 | { QCopEnvelope e( "QPE/System", "setDefaultRotation(int)" ); | 959 | { QCopEnvelope e( "QPE/System", "setDefaultRotation(int)" ); |
960 | e << r; | 960 | e << r; |
961 | } | 961 | } |
962 | #endif | 962 | #endif |
963 | 963 | ||
964 | } | 964 | } |
965 | } | 965 | } |
966 | 966 | ||
967 | 967 | ||
968 | /*! | 968 | /*! |
969 | \internal | 969 | \internal |
970 | */ | 970 | */ |
971 | void QPEApplication::applyStyle() | 971 | void QPEApplication::applyStyle() |
972 | { | 972 | { |
973 | Config config( "qpe" ); | 973 | Config config( "qpe" ); |
974 | config.setGroup( "Appearance" ); | 974 | config.setGroup( "Appearance" ); |
975 | 975 | ||
976 | // don't block ourselves ... | 976 | // don't block ourselves ... |
977 | Opie::force_appearance = 0; | 977 | Opie::force_appearance = 0; |
978 | 978 | ||
979 | static QString appname = Opie::binaryName ( ); | 979 | static QString appname = Opie::binaryName ( ); |
980 | 980 | ||
981 | QStringList ex = config. readListEntry ( "NoStyle", ';' ); | 981 | QStringList ex = config. readListEntry ( "NoStyle", ';' ); |
982 | int nostyle = 0; | 982 | int nostyle = 0; |
983 | for ( QStringList::Iterator it = ex. begin ( ); it != ex. end ( ); ++it ) { | 983 | for ( QStringList::Iterator it = ex. begin ( ); it != ex. end ( ); ++it ) { |
984 | if ( QRegExp (( *it ). mid ( 1 ), false, true ). find ( appname, 0 ) >= 0 ) { | 984 | if ( QRegExp (( *it ). mid ( 1 ), false, true ). find ( appname, 0 ) >= 0 ) { |
985 | nostyle = ( *it ). left ( 1 ). toInt ( 0, 32 ); | 985 | nostyle = ( *it ). left ( 1 ). toInt ( 0, 32 ); |
986 | break; | 986 | break; |
987 | } | 987 | } |
988 | } | 988 | } |
989 | 989 | ||
990 | // Widget style | 990 | // Widget style |
991 | QString style = config.readEntry( "Style", "Light" ); | 991 | QString style = config.readEntry( "Style", "Light" ); |
992 | 992 | ||
993 | // don't set a custom style | 993 | // don't set a custom style |
994 | if ( nostyle & Opie::Force_Style ) | 994 | if ( nostyle & Opie::Force_Style ) |
995 | style = "Light"; | 995 | style = "Light"; |
996 | 996 | ||
997 | internalSetStyle ( style ); | 997 | internalSetStyle ( style ); |
998 | 998 | ||
999 | // Colors | 999 | // Colors |
1000 | QColor bgcolor( config.readEntry( "Background", "#E5E1D5" ) ); | 1000 | QColor bgcolor( config.readEntry( "Background", "#E5E1D5" ) ); |
1001 | QColor btncolor( config.readEntry( "Button", "#D6CDBB" ) ); | 1001 | QColor btncolor( config.readEntry( "Button", "#D6CDBB" ) ); |
1002 | QPalette pal( btncolor, bgcolor ); | 1002 | QPalette pal( btncolor, bgcolor ); |
1003 | QString color = config.readEntry( "Highlight", "#800000" ); | 1003 | QString color = config.readEntry( "Highlight", "#800000" ); |
1004 | pal.setColor( QColorGroup::Highlight, QColor( color ) ); | 1004 | pal.setColor( QColorGroup::Highlight, QColor( color ) ); |
1005 | color = config.readEntry( "HighlightedText", "#FFFFFF" ); | 1005 | color = config.readEntry( "HighlightedText", "#FFFFFF" ); |
1006 | pal.setColor( QColorGroup::HighlightedText, QColor( color ) ); | 1006 | pal.setColor( QColorGroup::HighlightedText, QColor( color ) ); |
1007 | color = config.readEntry( "Text", "#000000" ); | 1007 | color = config.readEntry( "Text", "#000000" ); |
1008 | pal.setColor( QColorGroup::Text, QColor( color ) ); | 1008 | pal.setColor( QColorGroup::Text, QColor( color ) ); |
1009 | color = config.readEntry( "ButtonText", "#000000" ); | 1009 | color = config.readEntry( "ButtonText", "#000000" ); |
1010 | pal.setColor( QPalette::Active, QColorGroup::ButtonText, QColor( color ) ); | 1010 | pal.setColor( QPalette::Active, QColorGroup::ButtonText, QColor( color ) ); |
1011 | color = config.readEntry( "Base", "#FFFFFF" ); | 1011 | color = config.readEntry( "Base", "#FFFFFF" ); |
1012 | pal.setColor( QColorGroup::Base, QColor( color ) ); | 1012 | pal.setColor( QColorGroup::Base, QColor( color ) ); |
1013 | 1013 | ||
1014 | pal.setColor( QPalette::Disabled, QColorGroup::Text, | 1014 | pal.setColor( QPalette::Disabled, QColorGroup::Text, |
1015 | pal.color( QPalette::Active, QColorGroup::Background ).dark() ); | 1015 | pal.color( QPalette::Active, QColorGroup::Background ).dark() ); |
1016 | 1016 | ||
1017 | setPalette( pal, TRUE ); | 1017 | setPalette( pal, TRUE ); |
1018 | 1018 | ||
1019 | // Window Decoration | 1019 | // Window Decoration |
1020 | QString dec = config.readEntry( "Decoration", "Qtopia" ); | 1020 | QString dec = config.readEntry( "Decoration", "Qtopia" ); |
1021 | 1021 | ||
1022 | // don't set a custom deco | 1022 | // don't set a custom deco |
1023 | if ( nostyle & Opie::Force_Decoration ) | 1023 | if ( nostyle & Opie::Force_Decoration ) |
1024 | dec = ""; | 1024 | dec = ""; |
1025 | 1025 | ||
1026 | //qDebug ( "Setting Deco: %s -- old %s (%d)", dec.latin1(), d-> decorationName.latin1(), nostyle); | 1026 | //qDebug ( "Setting Deco: %s -- old %s (%d)", dec.latin1(), d-> decorationName.latin1(), nostyle); |
1027 | 1027 | ||
1028 | if ( dec != d->decorationName ) { | 1028 | if ( dec != d->decorationName ) { |
1029 | qwsSetDecoration( new QPEDecoration( dec ) ); | 1029 | qwsSetDecoration( new QPEDecoration( dec ) ); |
1030 | d->decorationName = dec; | 1030 | d->decorationName = dec; |
1031 | } | 1031 | } |
1032 | 1032 | ||
1033 | // Font | 1033 | // Font |
1034 | QString ff = config.readEntry( "FontFamily", font().family() ); | 1034 | QString ff = config.readEntry( "FontFamily", font().family() ); |
1035 | int fs = config.readNumEntry( "FontSize", font().pointSize() ); | 1035 | int fs = config.readNumEntry( "FontSize", font().pointSize() ); |
1036 | 1036 | ||
1037 | // don't set a custom font | 1037 | // don't set a custom font |
1038 | if ( nostyle & Opie::Force_Font ) { | 1038 | if ( nostyle & Opie::Force_Font ) { |
1039 | ff = "Helvetica"; | 1039 | ff = "Vera"; |
1040 | fs = 10; | 1040 | fs = 10; |
1041 | } | 1041 | } |
1042 | 1042 | ||
1043 | setFont ( QFont ( ff, fs ), true ); | 1043 | setFont ( QFont ( ff, fs ), true ); |
1044 | 1044 | ||
1045 | // revert to global blocking policy ... | 1045 | // revert to global blocking policy ... |
1046 | Opie::force_appearance = config. readBoolEntry ( "ForceStyle", false ) ? Opie::Force_All : Opie::Force_None; | 1046 | Opie::force_appearance = config. readBoolEntry ( "ForceStyle", false ) ? Opie::Force_All : Opie::Force_None; |
1047 | Opie::force_appearance &= ~nostyle; | 1047 | Opie::force_appearance &= ~nostyle; |
1048 | } | 1048 | } |
1049 | 1049 | ||
1050 | void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data ) | 1050 | void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data ) |
1051 | { | 1051 | { |
1052 | #ifdef Q_WS_QWS | 1052 | #ifdef Q_WS_QWS |
1053 | QDataStream stream( data, IO_ReadOnly ); | 1053 | QDataStream stream( data, IO_ReadOnly ); |
1054 | if ( msg == "applyStyle()" ) { | 1054 | if ( msg == "applyStyle()" ) { |
1055 | applyStyle(); | 1055 | applyStyle(); |
1056 | } | 1056 | } |
1057 | else if ( msg == "toggleApplicationMenu()" ) { | 1057 | else if ( msg == "toggleApplicationMenu()" ) { |
1058 | QWidget *active = activeWindow ( ); | 1058 | QWidget *active = activeWindow ( ); |
1059 | 1059 | ||
1060 | if ( active ) { | 1060 | if ( active ) { |
1061 | QPEMenuToolFocusManager *man = QPEMenuToolFocusManager::manager ( ); | 1061 | QPEMenuToolFocusManager *man = QPEMenuToolFocusManager::manager ( ); |
1062 | bool oldactive = man-> isActive ( ); | 1062 | bool oldactive = man-> isActive ( ); |
1063 | 1063 | ||
1064 | man-> setActive( !man-> isActive() ); | 1064 | man-> setActive( !man-> isActive() ); |
1065 | 1065 | ||
1066 | if ( !oldactive && !man-> isActive ( )) { // no menubar to toggle -> try O-Menu | 1066 | if ( !oldactive && !man-> isActive ( )) { // no menubar to toggle -> try O-Menu |
1067 | QCopEnvelope e ( "QPE/TaskBar", "toggleStartMenu()" ); | 1067 | QCopEnvelope e ( "QPE/TaskBar", "toggleStartMenu()" ); |
1068 | } | 1068 | } |
1069 | } | 1069 | } |
1070 | } | 1070 | } |
1071 | else if ( msg == "setDefaultRotation(int)" ) { | 1071 | else if ( msg == "setDefaultRotation(int)" ) { |
1072 | if ( type() == GuiServer ) { | 1072 | if ( type() == GuiServer ) { |
1073 | int r; | 1073 | int r; |
1074 | stream >> r; | 1074 | stream >> r; |
1075 | setDefaultRotation( r ); | 1075 | setDefaultRotation( r ); |
1076 | } | 1076 | } |
1077 | } | 1077 | } |
1078 | else if ( msg == "setCurrentRotation(int)" ) { | 1078 | else if ( msg == "setCurrentRotation(int)" ) { |
1079 | int r; | 1079 | int r; |
1080 | stream >> r; | 1080 | stream >> r; |
1081 | setCurrentRotation( r ); | 1081 | setCurrentRotation( r ); |
1082 | } | 1082 | } |
1083 | else if ( msg == "shutdown()" ) { | 1083 | else if ( msg == "shutdown()" ) { |
1084 | if ( type() == GuiServer ) | 1084 | if ( type() == GuiServer ) |
1085 | shutdown(); | 1085 | shutdown(); |
1086 | } | 1086 | } |
1087 | else if ( msg == "quit()" ) { | 1087 | else if ( msg == "quit()" ) { |
1088 | if ( type() != GuiServer ) | 1088 | if ( type() != GuiServer ) |
1089 | tryQuit(); | 1089 | tryQuit(); |
1090 | } | 1090 | } |
1091 | else if ( msg == "forceQuit()" ) { | 1091 | else if ( msg == "forceQuit()" ) { |
1092 | if ( type() != GuiServer ) | 1092 | if ( type() != GuiServer ) |
1093 | quit(); | 1093 | quit(); |
1094 | } | 1094 | } |
1095 | else if ( msg == "restart()" ) { | 1095 | else if ( msg == "restart()" ) { |
1096 | if ( type() == GuiServer ) | 1096 | if ( type() == GuiServer ) |
1097 | restart(); | 1097 | restart(); |
1098 | } | 1098 | } |
1099 | else if ( msg == "language(QString)" ) { | 1099 | else if ( msg == "language(QString)" ) { |
1100 | if ( type() == GuiServer ) { | 1100 | if ( type() == GuiServer ) { |
1101 | QString l; | 1101 | QString l; |
1102 | stream >> l; | 1102 | stream >> l; |
1103 | QString cl = getenv( "LANG" ); | 1103 | QString cl = getenv( "LANG" ); |
1104 | if ( cl != l ) { | 1104 | if ( cl != l ) { |
1105 | if ( l.isNull() ) | 1105 | if ( l.isNull() ) |
1106 | unsetenv( "LANG" ); | 1106 | unsetenv( "LANG" ); |
1107 | else | 1107 | else |
1108 | setenv( "LANG", l.latin1(), 1 ); | 1108 | setenv( "LANG", l.latin1(), 1 ); |
1109 | restart(); | 1109 | restart(); |
1110 | } | 1110 | } |
1111 | } | 1111 | } |
1112 | } | 1112 | } |
1113 | else if ( msg == "timeChange(QString)" ) { | 1113 | else if ( msg == "timeChange(QString)" ) { |
1114 | QString t; | 1114 | QString t; |
1115 | stream >> t; | 1115 | stream >> t; |
1116 | if ( t.isNull() ) | 1116 | if ( t.isNull() ) |
1117 | unsetenv( "TZ" ); | 1117 | unsetenv( "TZ" ); |
1118 | else | 1118 | else |
1119 | setenv( "TZ", t.latin1(), 1 ); | 1119 | setenv( "TZ", t.latin1(), 1 ); |
1120 | // emit the signal so everyone else knows... | 1120 | // emit the signal so everyone else knows... |
1121 | emit timeChanged(); | 1121 | emit timeChanged(); |
1122 | } | 1122 | } |
1123 | else if ( msg == "execute(QString)" ) { | 1123 | else if ( msg == "execute(QString)" ) { |
1124 | if ( type() == GuiServer ) { | 1124 | if ( type() == GuiServer ) { |
1125 | QString t; | 1125 | QString t; |
1126 | stream >> t; | 1126 | stream >> t; |
1127 | Global::execute( t ); | 1127 | Global::execute( t ); |
1128 | } | 1128 | } |
1129 | } | 1129 | } |
1130 | else if ( msg == "execute(QString,QString)" ) { | 1130 | else if ( msg == "execute(QString,QString)" ) { |
1131 | if ( type() == GuiServer ) { | 1131 | if ( type() == GuiServer ) { |
1132 | QString t, d; | 1132 | QString t, d; |
1133 | stream >> t >> d; | 1133 | stream >> t >> d; |
1134 | Global::execute( t, d ); | 1134 | Global::execute( t, d ); |
1135 | } | 1135 | } |