summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/firstuse.cpp24
-rw-r--r--core/launcher/firstuse.h1
-rw-r--r--core/launcher/main.cpp3
3 files changed, 16 insertions, 12 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
@@ -31,7 +31,6 @@
#include "serverapp.h"
#include <qtopia/custom.h>
-#if defined(QPE_NEED_CALIBRATION)
+
#include "calibrate.h"
-#endif
#include "documentlist.h"
@@ -169,10 +168,14 @@ FirstUse::FirstUse(QWidget* parent, const char * name, WFlags wf) :
#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");
@@ -231,5 +234,5 @@ void FirstUse::nextDialog()
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 );
@@ -492,4 +495,5 @@ void FirstUse::updateButtons()
else
next->setText(tr("Next >>"));
+
next->setEnabled( !waitingForLaunch );
}
@@ -505,6 +509,5 @@ void FirstUse::mouseReleaseEvent( QMouseEvent * )
{
if ( currApp < 0 ) {
-#if defined(QPE_NEED_CALIBRATION)
- if ( needCalibrate ) {
+ if ( m_calHandler && needCalibrate ) {
releaseMouse();
Calibrate *cal = new Calibrate;
@@ -512,5 +515,4 @@ void FirstUse::mouseReleaseEvent( QMouseEvent * )
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
@@ -80,4 +80,5 @@ private:
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
@@ -199,5 +199,6 @@ 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;