-rw-r--r-- | core/launcher/firstuse.cpp | 16 | ||||
-rw-r--r-- | core/launcher/firstuse.h | 1 | ||||
-rw-r--r-- | core/launcher/main.cpp | 3 |
3 files changed, 12 insertions, 8 deletions
diff --git a/core/launcher/firstuse.cpp b/core/launcher/firstuse.cpp index 2dc6a72..3f769ae 100644 --- a/core/launcher/firstuse.cpp +++ b/core/launcher/firstuse.cpp @@ -29,11 +29,10 @@ #include "inputmethods.h" #include "applauncher.h" #include "serverapp.h" #include <qtopia/custom.h> -#if defined(QPE_NEED_CALIBRATION) + #include "calibrate.h" -#endif #include "documentlist.h" #include <qtopia/resource.h> #include <qtopia/qcopenvelope_qws.h> @@ -167,14 +166,18 @@ FirstUse::FirstUse(QWidget* parent, const char * name, WFlags wf) : connect(sysChannel, SIGNAL(received(const QCString &, const QByteArray &)), this, SLOT(message(const QCString &, const QByteArray &)) ); #endif calcMaxWindowRect(); -#if defined(QPE_NEED_CALIBRATION) + + m_calHandler = ( QWSServer::mouseHandler() && QWSServer::mouseHandler()->inherits("QCalibratedMouseHandler") ) ? true : false; + + if ( m_calHandler) { if ( !QFile::exists("/etc/pointercal") ) { needCalibrate = TRUE; grabMouse(); } -#endif + } + Config config("locale"); config.setGroup( "Language"); lang = config.readEntry( "Language", "en"); @@ -490,8 +493,9 @@ void FirstUse::updateButtons() if ( !settingsTable[i].app ) next->setText(tr("Finish")); else next->setText(tr("Next >>")); + next->setEnabled( !waitingForLaunch ); } void FirstUse::keyPressEvent( QKeyEvent *e ) @@ -503,15 +507,13 @@ void FirstUse::keyPressEvent( QKeyEvent *e ) void FirstUse::mouseReleaseEvent( QMouseEvent * ) { if ( currApp < 0 ) { -#if defined(QPE_NEED_CALIBRATION) - if ( needCalibrate ) { + if ( m_calHandler && needCalibrate ) { releaseMouse(); Calibrate *cal = new Calibrate; cal->exec(); delete cal; } -#endif nextDialog(); } } diff --git a/core/launcher/firstuse.h b/core/launcher/firstuse.h index 44a95a8..98858f8 100644 --- a/core/launcher/firstuse.h +++ b/core/launcher/firstuse.h @@ -78,7 +78,8 @@ private: int currApp; int waitForExit; bool waitingForLaunch; bool needRestart; + bool m_calHandler : 1; QFont defaultFont; }; diff --git a/core/launcher/main.cpp b/core/launcher/main.cpp index 075985d..ad40536 100644 --- a/core/launcher/main.cpp +++ b/core/launcher/main.cpp @@ -197,9 +197,10 @@ static void initKeyboard() static bool firstUse() { bool needFirstUse = FALSE; - if ( QWSServer::mouseHandler() ->inherits("QCalibratedMouseHandler") ) { + if ( QWSServer::mouseHandler() && + QWSServer::mouseHandler() ->inherits("QCalibratedMouseHandler") ) { if ( !QFile::exists( "/etc/pointercal" ) ) needFirstUse = TRUE; } |