author | kergoth <kergoth> | 2003-03-24 01:24:56 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-03-24 01:24:56 (UTC) |
commit | 1b4836ba28ca57947d37699fc67cddd74fb29fbe (patch) (unidiff) | |
tree | ce940472f7ca14c5c7f0c88eebcf95ca953cfef9 | |
parent | c8205a610f350b8bde7c5aa0522944f0418f1fc9 (diff) | |
download | opie-1b4836ba28ca57947d37699fc67cddd74fb29fbe.zip opie-1b4836ba28ca57947d37699fc67cddd74fb29fbe.tar.gz opie-1b4836ba28ca57947d37699fc67cddd74fb29fbe.tar.bz2 |
Remove ifdefs based on device as the means by which we decide to run calibrate, and instead check if the mouse handler inherits from QCalibratedMouseHandler.
-rw-r--r-- | core/launcher/main.cpp | 14 | ||||
-rw-r--r-- | core/opie-login/main.cpp | 14 |
2 files changed, 14 insertions, 14 deletions
diff --git a/core/launcher/main.cpp b/core/launcher/main.cpp index 8eaea17..64fb968 100644 --- a/core/launcher/main.cpp +++ b/core/launcher/main.cpp | |||
@@ -81,56 +81,56 @@ int initApplication( int argc, char ** argv ) | |||
81 | QWSServer::setDesktopBackground( QImage() ); | 81 | QWSServer::setDesktopBackground( QImage() ); |
82 | DesktopApplication a( argc, argv, QApplication::GuiServer ); | 82 | DesktopApplication a( argc, argv, QApplication::GuiServer ); |
83 | 83 | ||
84 | ODevice::inst ( )-> setSoftSuspend ( true ); | 84 | ODevice::inst ( )-> setSoftSuspend ( true ); |
85 | 85 | ||
86 | { // init backlight | 86 | { // init backlight |
87 | QCopEnvelope e("QPE/System", "setBacklight(int)" ); | 87 | QCopEnvelope e("QPE/System", "setBacklight(int)" ); |
88 | e << -3; // Forced on | 88 | e << -3; // Forced on |
89 | } | 89 | } |
90 | 90 | ||
91 | AlarmServer::initialize(); | 91 | AlarmServer::initialize(); |
92 | 92 | ||
93 | Desktop *d = new Desktop(); | 93 | Desktop *d = new Desktop(); |
94 | 94 | ||
95 | QObject::connect( &a, SIGNAL(power()), d, SLOT(togglePower()) ); | 95 | QObject::connect( &a, SIGNAL(power()), d, SLOT(togglePower()) ); |
96 | QObject::connect( &a, SIGNAL(backlight()), d, SLOT(toggleLight()) ); | 96 | QObject::connect( &a, SIGNAL(backlight()), d, SLOT(toggleLight()) ); |
97 | QObject::connect( &a, SIGNAL(symbol()), d, SLOT(toggleSymbolInput()) ); | 97 | QObject::connect( &a, SIGNAL(symbol()), d, SLOT(toggleSymbolInput()) ); |
98 | QObject::connect( &a, SIGNAL(numLockStateToggle()), d, SLOT(toggleNumLockState()) ); | 98 | QObject::connect( &a, SIGNAL(numLockStateToggle()), d, SLOT(toggleNumLockState()) ); |
99 | QObject::connect( &a, SIGNAL(capsLockStateToggle()), d, SLOT(toggleCapsLockState()) ); | 99 | QObject::connect( &a, SIGNAL(capsLockStateToggle()), d, SLOT(toggleCapsLockState()) ); |
100 | QObject::connect( &a, SIGNAL(prepareForRestart()), d, SLOT(terminateServers()) ); | 100 | QObject::connect( &a, SIGNAL(prepareForRestart()), d, SLOT(terminateServers()) ); |
101 | 101 | ||
102 | (void)new SysFileMonitor(d); | 102 | (void)new SysFileMonitor(d); |
103 | Network::createServer(d); | 103 | Network::createServer(d); |
104 | 104 | ||
105 | #if defined(QT_QWS_CASSIOPEIA) || defined(QT_QWS_IPAQ) || defined(QT_QWS_SL5XXX) | 105 | if ( QWSServer::mouseHandler() ->inherits("QCalibratedMouseHandler") ) { |
106 | if ( !QFile::exists( "/etc/pointercal" ) ) { | 106 | if ( !QFile::exists( "/etc/pointercal" ) ) { |
107 | // Make sure calibration widget starts on top. | 107 | // Make sure calibration widget starts on top. |
108 | Calibrate *cal = new Calibrate; | 108 | Calibrate *cal = new Calibrate; |
109 | cal->exec(); | 109 | cal->exec(); |
110 | delete cal; | 110 | delete cal; |
111 | } | ||
111 | } | 112 | } |
112 | #endif | ||
113 | 113 | ||
114 | d->show(); | 114 | d->show(); |
115 | 115 | ||
116 | if ( QDate::currentDate ( ). year ( ) < 2000 ) { | 116 | if ( QDate::currentDate ( ). year ( ) < 2000 ) { |
117 | if ( QMessageBox::information ( 0, DesktopApplication::tr( "Information" ), DesktopApplication::tr( "<p>The system date doesn't seem to be valid.\n(%1)</p><p>Do you want to correct the clock ?</p>" ). arg( TimeString::dateString ( QDate::currentDate ( ))), QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) { | 117 | if ( QMessageBox::information ( 0, DesktopApplication::tr( "Information" ), DesktopApplication::tr( "<p>The system date doesn't seem to be valid.\n(%1)</p><p>Do you want to correct the clock ?</p>" ). arg( TimeString::dateString ( QDate::currentDate ( ))), QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) { |
118 | QCopEnvelope e ( "QPE/Application/systemtime", "setDocument(QString)" ); | 118 | QCopEnvelope e ( "QPE/Application/systemtime", "setDocument(QString)" ); |
119 | e << QString ( ); | 119 | e << QString ( ); |
120 | } | 120 | } |
121 | } | 121 | } |
122 | 122 | ||
123 | int rv = a.exec(); | 123 | int rv = a.exec(); |
124 | 124 | ||
125 | delete d; | 125 | delete d; |
126 | 126 | ||
127 | ODevice::inst ( )-> setSoftSuspend ( false ); | 127 | ODevice::inst ( )-> setSoftSuspend ( false ); |
128 | 128 | ||
129 | return rv; | 129 | return rv; |
130 | } | 130 | } |
131 | 131 | ||
132 | static const char *pidfile_path = "/var/run/opie.pid"; | 132 | static const char *pidfile_path = "/var/run/opie.pid"; |
133 | 133 | ||
134 | void create_pidfile ( ) | 134 | void create_pidfile ( ) |
135 | { | 135 | { |
136 | FILE *f; | 136 | FILE *f; |
diff --git a/core/opie-login/main.cpp b/core/opie-login/main.cpp index 1800be0..9c40fc4 100644 --- a/core/opie-login/main.cpp +++ b/core/opie-login/main.cpp | |||
@@ -302,56 +302,56 @@ public: | |||
302 | 302 | ||
303 | private: | 303 | private: |
304 | bool m_lcd_status; | 304 | bool m_lcd_status; |
305 | 305 | ||
306 | int m_backlight_bright; | 306 | int m_backlight_bright; |
307 | bool m_backlight_forcedoff; | 307 | bool m_backlight_forcedoff; |
308 | }; | 308 | }; |
309 | 309 | ||
310 | 310 | ||
311 | namespace Opie { extern int force_appearance; } // HACK to get around the force-style setting | 311 | namespace Opie { extern int force_appearance; } // HACK to get around the force-style setting |
312 | 312 | ||
313 | 313 | ||
314 | int login_main ( int argc, char **argv, pid_t ppid ) | 314 | int login_main ( int argc, char **argv, pid_t ppid ) |
315 | { | 315 | { |
316 | QWSServer::setDesktopBackground( QImage() ); | 316 | QWSServer::setDesktopBackground( QImage() ); |
317 | LoginApplication *app = new LoginApplication ( argc, argv, ppid ); | 317 | LoginApplication *app = new LoginApplication ( argc, argv, ppid ); |
318 | 318 | ||
319 | Opie::force_appearance = 0; | 319 | Opie::force_appearance = 0; |
320 | 320 | ||
321 | app-> setFont ( QFont ( "Helvetica", 10 )); | 321 | app-> setFont ( QFont ( "Helvetica", 10 )); |
322 | app-> setStyle ( new QPEStyle ( )); | 322 | app-> setStyle ( new QPEStyle ( )); |
323 | 323 | ||
324 | ODevice::inst ( )-> setSoftSuspend ( true ); | 324 | ODevice::inst ( )-> setSoftSuspend ( true ); |
325 | 325 | ||
326 | #if defined(QT_QWS_CASSIOPEIA) || defined(QT_QWS_IPAQ) || defined(QT_QWS_SL5XXX) | 326 | if ( QWSServer::mouseHandler() ->inherits("QCalibratedMouseHandler") ) { |
327 | if ( !QFile::exists ( "/etc/pointercal" )) { | 327 | if ( !QFile::exists ( "/etc/pointercal" )) { |
328 | // Make sure calibration widget starts on top. | 328 | // Make sure calibration widget starts on top. |
329 | Calibrate *cal = new Calibrate; | 329 | Calibrate *cal = new Calibrate; |
330 | cal-> exec ( ); | 330 | cal-> exec ( ); |
331 | delete cal; | 331 | delete cal; |
332 | } | ||
332 | } | 333 | } |
333 | #endif | ||
334 | 334 | ||
335 | LoginScreenSaver *saver = new LoginScreenSaver; | 335 | LoginScreenSaver *saver = new LoginScreenSaver; |
336 | 336 | ||
337 | saver-> setIntervals ( ); | 337 | saver-> setIntervals ( ); |
338 | QWSServer::setScreenSaver ( saver ); | 338 | QWSServer::setScreenSaver ( saver ); |
339 | saver-> restore ( ); | 339 | saver-> restore ( ); |
340 | 340 | ||
341 | 341 | ||
342 | LoginWindowImpl *lw = new LoginWindowImpl ( ); | 342 | LoginWindowImpl *lw = new LoginWindowImpl ( ); |
343 | app-> setMainWidget ( lw ); | 343 | app-> setMainWidget ( lw ); |
344 | lw-> setGeometry ( 0, 0, app-> desktop ( )-> width ( ), app-> desktop ( )-> height ( )); | 344 | lw-> setGeometry ( 0, 0, app-> desktop ( )-> width ( ), app-> desktop ( )-> height ( )); |
345 | lw-> show ( ); | 345 | lw-> show ( ); |
346 | 346 | ||
347 | int rc = app-> exec ( ); | 347 | int rc = app-> exec ( ); |
348 | 348 | ||
349 | ODevice::inst ( )-> setSoftSuspend ( false ); | 349 | ODevice::inst ( )-> setSoftSuspend ( false ); |
350 | 350 | ||
351 | if ( app-> loginAs ( )) { | 351 | if ( app-> loginAs ( )) { |
352 | if ( app-> changeIdentity ( )) { | 352 | if ( app-> changeIdentity ( )) { |
353 | app-> login ( ); | 353 | app-> login ( ); |
354 | 354 | ||
355 | // if login succeeds, it never comes back | 355 | // if login succeeds, it never comes back |
356 | 356 | ||
357 | QMessageBox::critical ( 0, LoginWindowImpl::tr( "Failure" ), LoginWindowImpl::tr( "Could not start OPIE." )); | 357 | QMessageBox::critical ( 0, LoginWindowImpl::tr( "Failure" ), LoginWindowImpl::tr( "Could not start OPIE." )); |