summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index ac7b779..c562f6c 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -83,27 +83,27 @@
83 83
84#include <unistd.h> 84#include <unistd.h>
85#include <sys/file.h> 85#include <sys/file.h>
86#include <sys/ioctl.h> 86#include <sys/ioctl.h>
87#include <sys/soundcard.h> 87#include <sys/soundcard.h>
88 88
89#include "qt_override_p.h" 89#include "qt_override_p.h"
90 90
91 91
92class QPEApplicationData 92class QPEApplicationData
93{ 93{
94public: 94public:
95 QPEApplicationData ( ) 95 QPEApplicationData ( )
96 : presstimer( 0 ), presswidget( 0 ), rightpressed( false ), kbgrabbed( false ), 96 : presstimer( 0 ), presswidget( 0 ), rightpressed( false ), kbgrabbed( false ),
97 notbusysent( false ), preloaded( false ), forceshow( false ), nomaximize( false ), 97 notbusysent( false ), preloaded( false ), forceshow( false ), nomaximize( false ),
98 keep_running( true ), qpe_main_widget( 0 ) 98 keep_running( true ), qpe_main_widget( 0 )
99 99
100 { 100 {
101 qcopq.setAutoDelete( TRUE ); 101 qcopq.setAutoDelete( TRUE );
102 } 102 }
103 103
104 int presstimer; 104 int presstimer;
105 QWidget* presswidget; 105 QWidget* presswidget;
106 QPoint presspos; 106 QPoint presspos;
107 107
108 bool rightpressed : 1; 108 bool rightpressed : 1;
109 bool kbgrabbed : 1; 109 bool kbgrabbed : 1;
@@ -507,31 +507,31 @@ QPEApplication::QPEApplication( int & argc, char **argv, Type t )
507{ 507{
508 d = new QPEApplicationData; 508 d = new QPEApplicationData;
509 d->loadTextCodecs(); 509 d->loadTextCodecs();
510 d->loadImageCodecs(); 510 d->loadImageCodecs();
511 int dw = desktop() ->width(); 511 int dw = desktop() ->width();
512 512
513 if ( dw < 200 ) { 513 if ( dw < 200 ) {
514 setFont( QFont( "helvetica", 8 ) ); 514 setFont( QFont( "helvetica", 8 ) );
515 AppLnk::setSmallIconSize( 10 ); 515 AppLnk::setSmallIconSize( 10 );
516 AppLnk::setBigIconSize( 28 ); 516 AppLnk::setBigIconSize( 28 );
517 } 517 }
518 else if ( dw > 600 ) { 518 else if ( dw > 600 ) {
519 setFont( QFont( "helvetica", 12 ) ); 519 setFont( QFont( "helvetica", 18 ) );
520 AppLnk::setSmallIconSize( 24 ); 520 AppLnk::setSmallIconSize( 24 );
521 AppLnk::setBigIconSize( 48 ); 521 AppLnk::setBigIconSize( 48 );
522 } 522 }
523 else if ( dw > 200 ) { 523 else if ( dw > 200 ) {
524 setFont( QFont( "helvetica", 10 ) ); 524 setFont( QFont( "helvetica", 10 ) );
525 AppLnk::setSmallIconSize( 16 ); 525 AppLnk::setSmallIconSize( 14 );
526 AppLnk::setBigIconSize( 32 ); 526 AppLnk::setBigIconSize( 32 );
527 } 527 }
528 528
529 529
530 QMimeSourceFactory::setDefaultFactory( new ResourceMimeFactory ); 530 QMimeSourceFactory::setDefaultFactory( new ResourceMimeFactory );
531 531
532 connect( this, SIGNAL( lastWindowClosed() ), this, SLOT( hideOrQuit() ) ); 532 connect( this, SIGNAL( lastWindowClosed() ), this, SLOT( hideOrQuit() ) );
533#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 533#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
534 534
535 QString qcopfn( "/tmp/qcop-msg-" ); 535 QString qcopfn( "/tmp/qcop-msg-" );
536 qcopfn += QString( argv[ 0 ] ); // append command name 536 qcopfn += QString( argv[ 0 ] ); // append command name
537 537
@@ -805,48 +805,48 @@ bool QPEApplication::qwsEventFilter( QWSEvent * e )
805 active->close(); 805 active->close();
806 } 806 }
807 } 807 }
808 } 808 }
809 else if ( ke->simpleData.keycode >= Qt::Key_F1 && ke->simpleData.keycode <= Qt::Key_F29 ) { 809 else if ( ke->simpleData.keycode >= Qt::Key_F1 && ke->simpleData.keycode <= Qt::Key_F29 ) {
810 // this should be if ( ODevice::inst ( )-> buttonForKeycode ( ... )) 810 // this should be if ( ODevice::inst ( )-> buttonForKeycode ( ... ))
811 // but we cannot access libopie function within libqpe :( 811 // but we cannot access libopie function within libqpe :(
812 812
813 QWidget * active = activeWindow ( ); 813 QWidget * active = activeWindow ( );
814 if ( active && ((int) active-> winId ( ) == ke-> simpleData.window )) { 814 if ( active && ((int) active-> winId ( ) == ke-> simpleData.window )) {
815 if ( d-> kbgrabbed ) { // we grabbed the keyboard 815 if ( d-> kbgrabbed ) { // we grabbed the keyboard
816 QChar ch ( ke-> simpleData.unicode ); 816 QChar ch ( ke-> simpleData.unicode );
817 QKeyEvent qke ( ke-> simpleData. is_press ? QEvent::KeyPress : QEvent::KeyRelease, 817 QKeyEvent qke ( ke-> simpleData. is_press ? QEvent::KeyPress : QEvent::KeyRelease,
818 ke-> simpleData.keycode, 818 ke-> simpleData.keycode,
819 ch. latin1 ( ), 819 ch. latin1 ( ),
820 ke-> simpleData.modifiers, 820 ke-> simpleData.modifiers,
821 QString ( ch ), 821 QString ( ch ),
822 ke-> simpleData.is_auto_repeat, 1 ); 822 ke-> simpleData.is_auto_repeat, 1 );
823 823
824 QObject *which = QWidget::keyboardGrabber ( ); 824 QObject *which = QWidget::keyboardGrabber ( );
825 if ( !which ) 825 if ( !which )
826 which = QApplication::focusWidget ( ); 826 which = QApplication::focusWidget ( );
827 if ( !which ) 827 if ( !which )
828 which = QApplication::activeWindow ( ); 828 which = QApplication::activeWindow ( );
829 if ( !which ) 829 if ( !which )
830 which = qApp; 830 which = qApp;
831 831
832 QApplication::sendEvent ( which, &qke ); 832 QApplication::sendEvent ( which, &qke );
833 } 833 }
834 else { // we didn't grab the keyboard, so send the event to the launcher 834 else { // we didn't grab the keyboard, so send the event to the launcher
835 QCopEnvelope e ( "QPE/Launcher", "deviceButton(int,int,int)" ); 835 QCopEnvelope e ( "QPE/Launcher", "deviceButton(int,int,int)" );
836 e << int( ke-> simpleData.keycode ) << int( ke-> simpleData. is_press ) << int( ke-> simpleData.is_auto_repeat ); 836 e << int( ke-> simpleData.keycode ) << int( ke-> simpleData. is_press ) << int( ke-> simpleData.is_auto_repeat );
837 } 837 }
838 } 838 }
839 return true; 839 return true;
840 } 840 }
841 } 841 }
842 if ( e->type == QWSEvent::Focus ) { 842 if ( e->type == QWSEvent::Focus ) {
843 QWSFocusEvent * fe = ( QWSFocusEvent* ) e; 843 QWSFocusEvent * fe = ( QWSFocusEvent* ) e;
844 if ( !fe->simpleData.get_focus ) { 844 if ( !fe->simpleData.get_focus ) {
845 QWidget * active = activeWindow(); 845 QWidget * active = activeWindow();
846 while ( active && active->isPopup() ) { 846 while ( active && active->isPopup() ) {
847 active->close(); 847 active->close();
848 active = activeWindow(); 848 active = activeWindow();
849 } 849 }
850 } 850 }
851 else { 851 else {
852 // make sure our modal widget is ALWAYS on top 852 // make sure our modal widget is ALWAYS on top
@@ -1038,27 +1038,27 @@ void QPEApplication::applyStyle()
1038 Opie::force_appearance &= ~nostyle; 1038 Opie::force_appearance &= ~nostyle;
1039} 1039}
1040 1040
1041void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data ) 1041void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data )
1042{ 1042{
1043#ifdef Q_WS_QWS 1043#ifdef Q_WS_QWS
1044 QDataStream stream( data, IO_ReadOnly ); 1044 QDataStream stream( data, IO_ReadOnly );
1045 if ( msg == "applyStyle()" ) { 1045 if ( msg == "applyStyle()" ) {
1046 applyStyle(); 1046 applyStyle();
1047 } 1047 }
1048 else if ( msg == "toggleApplicationMenu()" ) { 1048 else if ( msg == "toggleApplicationMenu()" ) {
1049 QWidget *active = activeWindow ( ); 1049 QWidget *active = activeWindow ( );
1050 1050
1051 if ( active ) { 1051 if ( active ) {
1052 QPEMenuToolFocusManager *man = QPEMenuToolFocusManager::manager ( ); 1052 QPEMenuToolFocusManager *man = QPEMenuToolFocusManager::manager ( );
1053 bool oldactive = man-> isActive ( ); 1053 bool oldactive = man-> isActive ( );
1054 1054
1055 man-> setActive( !man-> isActive() ); 1055 man-> setActive( !man-> isActive() );
1056 1056
1057 if ( !oldactive && !man-> isActive ( )) { // no menubar to toggle -> try O-Menu 1057 if ( !oldactive && !man-> isActive ( )) { // no menubar to toggle -> try O-Menu
1058 QCopEnvelope e ( "QPE/TaskBar", "toggleStartMenu()" ); 1058 QCopEnvelope e ( "QPE/TaskBar", "toggleStartMenu()" );
1059 } 1059 }
1060 } 1060 }
1061 } 1061 }
1062 else if ( msg == "setDefaultRotation(int)" ) { 1062 else if ( msg == "setDefaultRotation(int)" ) {
1063 if ( type() == GuiServer ) { 1063 if ( type() == GuiServer ) {
1064 int r; 1064 int r;