-rw-r--r-- | library/qpeapplication.cpp | 26 |
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 @@ -79,35 +79,35 @@ #include "applnk.h" #include "qpemenubar.h" #include "textcodecinterface.h" #include "imagecodecinterface.h" #include <unistd.h> #include <sys/file.h> #include <sys/ioctl.h> #include <sys/soundcard.h> #include "qt_override_p.h" class QPEApplicationData { public: - QPEApplicationData ( ) - : presstimer( 0 ), presswidget( 0 ), rightpressed( false ), kbgrabbed( false ), - notbusysent( false ), preloaded( false ), forceshow( false ), nomaximize( false ), + QPEApplicationData ( ) + : presstimer( 0 ), presswidget( 0 ), rightpressed( false ), kbgrabbed( false ), + notbusysent( false ), preloaded( false ), forceshow( false ), nomaximize( false ), keep_running( true ), qpe_main_widget( 0 ) { qcopq.setAutoDelete( TRUE ); } int presstimer; QWidget* presswidget; QPoint presspos; bool rightpressed : 1; bool kbgrabbed : 1; bool notbusysent : 1; bool preloaded : 1; bool forceshow : 1; bool nomaximize : 1; @@ -503,39 +503,39 @@ static void setTreble( int t = 0, int percent = -1 ) the Qtopia server passes GuiServer. */ QPEApplication::QPEApplication( int & argc, char **argv, Type t ) : QApplication( argc, argv, t ) { d = new QPEApplicationData; d->loadTextCodecs(); d->loadImageCodecs(); int dw = desktop() ->width(); if ( dw < 200 ) { setFont( QFont( "helvetica", 8 ) ); AppLnk::setSmallIconSize( 10 ); AppLnk::setBigIconSize( 28 ); } else if ( dw > 600 ) { - setFont( QFont( "helvetica", 12 ) ); + setFont( QFont( "helvetica", 18 ) ); AppLnk::setSmallIconSize( 24 ); AppLnk::setBigIconSize( 48 ); } else if ( dw > 200 ) { setFont( QFont( "helvetica", 10 ) ); - AppLnk::setSmallIconSize( 16 ); + AppLnk::setSmallIconSize( 14 ); AppLnk::setBigIconSize( 32 ); } QMimeSourceFactory::setDefaultFactory( new ResourceMimeFactory ); connect( this, SIGNAL( lastWindowClosed() ), this, SLOT( hideOrQuit() ) ); #if defined(Q_WS_QWS) && !defined(QT_NO_COP) QString qcopfn( "/tmp/qcop-msg-" ); qcopfn += QString( argv[ 0 ] ); // append command name QFile f( qcopfn ); if ( f.open( IO_ReadOnly ) ) { flock( f.handle(), LOCK_EX ); } @@ -801,56 +801,56 @@ bool QPEApplication::qwsEventFilter( QWSEvent * e ) d->rejectIt(); return TRUE; } else if ( strcmp( argv() [ 0 ], "embeddedkonsole" ) != 0 ) { active->close(); } } } else if ( ke->simpleData.keycode >= Qt::Key_F1 && ke->simpleData.keycode <= Qt::Key_F29 ) { // this should be if ( ODevice::inst ( )-> buttonForKeycode ( ... )) // but we cannot access libopie function within libqpe :( QWidget * active = activeWindow ( ); if ( active && ((int) active-> winId ( ) == ke-> simpleData.window )) { if ( d-> kbgrabbed ) { // we grabbed the keyboard QChar ch ( ke-> simpleData.unicode ); - QKeyEvent qke ( ke-> simpleData. is_press ? QEvent::KeyPress : QEvent::KeyRelease, + QKeyEvent qke ( ke-> simpleData. is_press ? QEvent::KeyPress : QEvent::KeyRelease, ke-> simpleData.keycode, ch. latin1 ( ), ke-> simpleData.modifiers, QString ( ch ), ke-> simpleData.is_auto_repeat, 1 ); QObject *which = QWidget::keyboardGrabber ( ); - if ( !which ) + if ( !which ) which = QApplication::focusWidget ( ); - if ( !which ) + if ( !which ) which = QApplication::activeWindow ( ); - if ( !which ) + if ( !which ) which = qApp; - + QApplication::sendEvent ( which, &qke ); } else { // we didn't grab the keyboard, so send the event to the launcher QCopEnvelope e ( "QPE/Launcher", "deviceButton(int,int,int)" ); e << int( ke-> simpleData.keycode ) << int( ke-> simpleData. is_press ) << int( ke-> simpleData.is_auto_repeat ); } } return true; - } + } } if ( e->type == QWSEvent::Focus ) { QWSFocusEvent * fe = ( QWSFocusEvent* ) e; if ( !fe->simpleData.get_focus ) { QWidget * active = activeWindow(); while ( active && active->isPopup() ) { active->close(); active = activeWindow(); } } else { // make sure our modal widget is ALWAYS on top QWidget *topm = activeModalWidget(); if ( topm ) { topm->raise(); } @@ -1034,35 +1034,35 @@ void QPEApplication::applyStyle() setFont ( QFont ( ff, fs ), true ); // revert to global blocking policy ... Opie::force_appearance = config. readBoolEntry ( "ForceStyle", false ) ? Opie::Force_All : Opie::Force_None; Opie::force_appearance &= ~nostyle; } void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data ) { #ifdef Q_WS_QWS QDataStream stream( data, IO_ReadOnly ); if ( msg == "applyStyle()" ) { applyStyle(); } else if ( msg == "toggleApplicationMenu()" ) { QWidget *active = activeWindow ( ); - + if ( active ) { - QPEMenuToolFocusManager *man = QPEMenuToolFocusManager::manager ( ); + QPEMenuToolFocusManager *man = QPEMenuToolFocusManager::manager ( ); bool oldactive = man-> isActive ( ); man-> setActive( !man-> isActive() ); if ( !oldactive && !man-> isActive ( )) { // no menubar to toggle -> try O-Menu QCopEnvelope e ( "QPE/TaskBar", "toggleStartMenu()" ); } } } else if ( msg == "setDefaultRotation(int)" ) { if ( type() == GuiServer ) { int r; stream >> r; setDefaultRotation( r ); } } |