summaryrefslogtreecommitdiff
path: root/core
authorzecke <zecke>2003-10-04 07:27:33 (UTC)
committer zecke <zecke>2003-10-04 07:27:33 (UTC)
commit364d30ca7c212a531b79bb7cbceb8af7a0130f2c (patch) (unidiff)
tree7c0d70c49a884d02418a7708ce819a8d0b02130f /core
parent271ba635536db4a9f4ae1e575194d0f388b1c991 (diff)
downloadopie-364d30ca7c212a531b79bb7cbceb8af7a0130f2c.zip
opie-364d30ca7c212a531b79bb7cbceb8af7a0130f2c.tar.gz
opie-364d30ca7c212a531b79bb7cbceb8af7a0130f2c.tar.bz2
Check if there is a Mouse Driver
And get rid off the QPE_NEED_CALIBRATION define for defining the need of calibration We will find out at runtime SomeOne Apply this to core/server in the BRANCH as well
Diffstat (limited to 'core') (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/firstuse.cpp16
-rw-r--r--core/launcher/firstuse.h1
-rw-r--r--core/launcher/main.cpp3
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
@@ -30,9 +30,8 @@
30#include "applauncher.h" 30#include "applauncher.h"
31#include "serverapp.h" 31#include "serverapp.h"
32#include <qtopia/custom.h> 32#include <qtopia/custom.h>
33#if defined(QPE_NEED_CALIBRATION) 33
34#include "calibrate.h" 34#include "calibrate.h"
35#endif
36#include "documentlist.h" 35#include "documentlist.h"
37 36
38#include <qtopia/resource.h> 37#include <qtopia/resource.h>
@@ -168,12 +167,16 @@ FirstUse::FirstUse(QWidget* parent, const char * name, WFlags wf) :
168 this, SLOT(message(const QCString &, const QByteArray &)) ); 167 this, SLOT(message(const QCString &, const QByteArray &)) );
169#endif 168#endif
170 calcMaxWindowRect(); 169 calcMaxWindowRect();
171#if defined(QPE_NEED_CALIBRATION) 170
171 m_calHandler = ( QWSServer::mouseHandler() && QWSServer::mouseHandler()->inherits("QCalibratedMouseHandler") ) ? true : false;
172
173 if ( m_calHandler) {
172 if ( !QFile::exists("/etc/pointercal") ) { 174 if ( !QFile::exists("/etc/pointercal") ) {
173 needCalibrate = TRUE; 175 needCalibrate = TRUE;
174 grabMouse(); 176 grabMouse();
175 } 177 }
176#endif 178 }
179
177 Config config("locale"); 180 Config config("locale");
178 config.setGroup( "Language"); 181 config.setGroup( "Language");
179 lang = config.readEntry( "Language", "en"); 182 lang = config.readEntry( "Language", "en");
@@ -491,6 +494,7 @@ void FirstUse::updateButtons()
491 next->setText(tr("Finish")); 494 next->setText(tr("Finish"));
492 else 495 else
493 next->setText(tr("Next >>")); 496 next->setText(tr("Next >>"));
497
494 next->setEnabled( !waitingForLaunch ); 498 next->setEnabled( !waitingForLaunch );
495} 499}
496 500
@@ -504,14 +508,12 @@ void FirstUse::keyPressEvent( QKeyEvent *e )
504void FirstUse::mouseReleaseEvent( QMouseEvent * ) 508void FirstUse::mouseReleaseEvent( QMouseEvent * )
505{ 509{
506 if ( currApp < 0 ) { 510 if ( currApp < 0 ) {
507#if defined(QPE_NEED_CALIBRATION) 511 if ( m_calHandler && needCalibrate ) {
508 if ( needCalibrate ) {
509 releaseMouse(); 512 releaseMouse();
510 Calibrate *cal = new Calibrate; 513 Calibrate *cal = new Calibrate;
511 cal->exec(); 514 cal->exec();
512 delete cal; 515 delete cal;
513 } 516 }
514#endif
515 nextDialog(); 517 nextDialog();
516 } 518 }
517} 519}
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
@@ -79,6 +79,7 @@ private:
79 int waitForExit; 79 int waitForExit;
80 bool waitingForLaunch; 80 bool waitingForLaunch;
81 bool needRestart; 81 bool needRestart;
82 bool m_calHandler : 1;
82 83
83 QFont defaultFont; 84 QFont defaultFont;
84}; 85};
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
@@ -198,7 +198,8 @@ static void initKeyboard()
198static bool firstUse() 198static bool firstUse()
199{ 199{
200 bool needFirstUse = FALSE; 200 bool needFirstUse = FALSE;
201 if ( QWSServer::mouseHandler() ->inherits("QCalibratedMouseHandler") ) { 201 if ( QWSServer::mouseHandler() &&
202 QWSServer::mouseHandler() ->inherits("QCalibratedMouseHandler") ) {
202 if ( !QFile::exists( "/etc/pointercal" ) ) 203 if ( !QFile::exists( "/etc/pointercal" ) )
203 needFirstUse = TRUE; 204 needFirstUse = TRUE;
204 } 205 }