-rw-r--r-- | core/launcher/firstuse.cpp | 24 |
1 files changed, 13 insertions, 11 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 @@ -27,15 +27,14 @@ #endif #include "firstuse.h" #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> #include <qtopia/qpeapplication.h> #include <qtopia/config.h> @@ -165,18 +164,22 @@ FirstUse::FirstUse(QWidget* parent, const char * name, WFlags wf) : qDebug("Setting up QCop to QPE/System"); QCopChannel* sysChannel = new QCopChannel( "QPE/System", this ); connect(sysChannel, SIGNAL(received(const QCString &, const QByteArray &)), this, SLOT(message(const QCString &, const QByteArray &)) ); #endif calcMaxWindowRect(); -#if defined(QPE_NEED_CALIBRATION) - if ( !QFile::exists("/etc/pointercal") ) { - needCalibrate = TRUE; - grabMouse(); + + 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"); defaultFont = font(); @@ -227,13 +230,13 @@ void FirstUse::nextDialog() do { currApp++; qDebug( "currApp = %d", currApp ); if ( settingsTable[currApp].app == 0 ) { if ( prevApp >= 0 && appLauncher->isRunning(settingsTable[prevApp].app) ) { // The last application is still running. - // Tell it to stop, and when its done we'll come back + // Tell it to stop, and when its done we'll come back // to nextDialog and exit. qDebug( "Waiting for %s to exit", settingsTable[prevApp].app ); QCopEnvelope e(QCString("QPE/Application/") + settingsTable[prevApp].app, settingsTable[prevApp].stop ); currApp = prevApp; } else { @@ -488,12 +491,13 @@ void FirstUse::updateButtons() while ( settingsTable[i].app && !settingsTable[i].enabled ) i++; if ( !settingsTable[i].app ) next->setText(tr("Finish")); else next->setText(tr("Next >>")); + next->setEnabled( !waitingForLaunch ); } void FirstUse::keyPressEvent( QKeyEvent *e ) { // Allow cancelling at first dialog, in case display is broken. @@ -501,17 +505,15 @@ void FirstUse::keyPressEvent( QKeyEvent *e ) QDialog::keyPressEvent(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(); } } |