-rw-r--r-- | library/qpeapplication.cpp | 11 | ||||
-rw-r--r-- | library/qpeapplication.h | 2 |
2 files changed, 13 insertions, 0 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 852671a..b26933b 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp @@ -94,24 +94,25 @@ class QPEApplicationData public: QPEApplicationData() : presstimer( 0 ), presswidget( 0 ), kbgrabber( 0 ), rightpressed( FALSE ), kbregrab( FALSE ), notbusysent( FALSE ), preloaded( FALSE ), forceshow( FALSE ), nomaximize( FALSE ), keep_running( TRUE ), qpe_main_widget( 0 ) { qcopq.setAutoDelete( TRUE ); } int presstimer; QWidget* presswidget; int kbgrabber; + QString kbgrabber_appname; QPoint presspos; bool rightpressed : 1; bool kbregrab : 1; bool notbusysent : 1; bool preloaded : 1; bool forceshow : 1; bool nomaximize : 1; bool keep_running : 1; QString appName; struct QCopRec @@ -1055,24 +1056,26 @@ void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data if ( type() == GuiServer ) restart(); } else if ( msg == "grabKeyboard(QString)" ) { QString who; stream >> who; if ( who.isEmpty() ) d->kbgrabber = 0; else if ( who != d->appName ) d->kbgrabber = 1; else d->kbgrabber = 2; + + d-> kbgrabber_appname = who; } else if ( msg == "language(QString)" ) { if ( type() == GuiServer ) { QString l; stream >> l; QString cl = getenv( "LANG" ); if ( cl != l ) { if ( l.isNull() ) unsetenv( "LANG" ); else setenv( "LANG", l.latin1(), 1 ); restart(); @@ -1615,24 +1618,32 @@ void QPEApplication::removeSenderFromStylusDict() if ( d->presswidget == sender() ) d->presswidget = 0; } /*! \internal */ bool QPEApplication::keyboardGrabbed() const { return d->kbgrabber; } +/*! + \internal +*/ +QString QPEApplication::keyboardGrabbedBy() const +{ + return d->kbgrabber_appname; +} + /*! Reverses the effect of grabKeyboard(). This is called automatically on program exit. */ void QPEApplication::ungrabKeyboard() { QPEApplicationData * d = ( ( QPEApplication* ) qApp ) ->d; if ( d->kbgrabber == 2 ) { #ifndef QT_NO_COP QCopEnvelope e( "QPE/System", "grabKeyboard(QString)" ); e << QString::null; diff --git a/library/qpeapplication.h b/library/qpeapplication.h index 86affa6..f712077 100644 --- a/library/qpeapplication.h +++ b/library/qpeapplication.h @@ -25,24 +25,25 @@ #include <qdialog.h> #if defined(_WS_QWS_) && !defined(Q_WS_QWS) #define Q_WS_QWS #endif #include "qpedecoration_qws.h" #include "timestring.h" class QCopChannel; class QPEApplicationData; class QWSEvent; class QWSKeyEvent; + class QPEApplication : public QApplication { Q_OBJECT public: QPEApplication( int& argc, char **argv, Type=GuiClient ); ~QPEApplication(); static QString qpeDir(); static QString documentDir(); void applyStyle(); static int defaultRotation(); static void setDefaultRotation(int r); @@ -73,24 +74,25 @@ public: static void setInputMethodHint( QWidget *, InputMethodHint ); static InputMethodHint inputMethodHint( QWidget * ); void showMainWidget( QWidget*, bool nomax=FALSE ); void showMainDocumentWidget( QWidget*, bool nomax=FALSE ); static void showDialog( QDialog*, bool nomax=FALSE ); static int execDialog( QDialog*, bool nomax=FALSE ); static void setKeepRunning(); bool keepRunning() const; bool keyboardGrabbed() const; + QString keyboardGrabbedBy ( ) const; int exec(); signals: void clientMoused(); void timeChanged(); void clockChanged( bool pm ); void micChanged( bool muted ); void volumeChanged( bool muted ); void appMessage( const QCString& msg, const QByteArray& data); void weekChanged( bool startOnMonday ); void dateFormatChanged( DateFormat ); |