-rw-r--r-- | core/launcher/main.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/core/launcher/main.cpp b/core/launcher/main.cpp index e96eeae..20a1ecd 100644 --- a/core/launcher/main.cpp +++ b/core/launcher/main.cpp | |||
@@ -21,39 +21,40 @@ | |||
21 | #include "desktop.h" | 21 | #include "desktop.h" |
22 | #include "taskbar.h" | 22 | #include "taskbar.h" |
23 | #include "stabmon.h" | 23 | #include "stabmon.h" |
24 | 24 | ||
25 | #include <qpe/qpeapplication.h> | 25 | #include <qpe/qpeapplication.h> |
26 | #include <qpe/network.h> | 26 | #include <qpe/network.h> |
27 | #include <qpe/config.h> | 27 | #include <qpe/config.h> |
28 | #if defined( QT_QWS_SL5XXX ) || defined( QT_QWS_IPAQ ) | 28 | #if defined( QT_QWS_SL5XXX ) || defined( QT_QWS_IPAQ ) |
29 | #include <qpe/custom.h> | 29 | #include <qpe/custom.h> |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | #include <opie/odevice.h> | 32 | #include <opie/odevice.h> |
33 | #include <opie/oprocess.h> | ||
34 | 33 | ||
35 | #include <qmessagebox.h> | 34 | #include <qmessagebox.h> |
36 | #include <qfile.h> | 35 | #include <qfile.h> |
37 | #include <qimage.h> | 36 | #include <qimage.h> |
38 | #include <qwindowsystem_qws.h> | 37 | #include <qwindowsystem_qws.h> |
39 | #include <qwsmouse_qws.h> | 38 | #include <qwsmouse_qws.h> |
40 | #include <qpe/qcopenvelope_qws.h> | 39 | #include <qpe/qcopenvelope_qws.h> |
41 | #include <qpe/alarmserver.h> | 40 | #include <qpe/alarmserver.h> |
42 | 41 | ||
43 | #include <stdlib.h> | 42 | #include <stdlib.h> |
44 | #include <stdio.h> | 43 | #include <stdio.h> |
45 | #include <signal.h> | 44 | #include <signal.h> |
46 | #include <unistd.h> | 45 | #include <unistd.h> |
47 | 46 | ||
47 | #include "../calibrate/calibrate.h" | ||
48 | |||
48 | using namespace Opie; | 49 | using namespace Opie; |
49 | 50 | ||
50 | void initEnvironment() | 51 | void initEnvironment() |
51 | { | 52 | { |
52 | int rot; | 53 | int rot; |
53 | Config config("locale"); | 54 | Config config("locale"); |
54 | 55 | ||
55 | config.setGroup( "Location" ); | 56 | config.setGroup( "Location" ); |
56 | QString tz = config.readEntry( "Timezone", getenv("TZ") ); | 57 | QString tz = config.readEntry( "Timezone", getenv("TZ") ); |
57 | 58 | ||
58 | // if not timezone set, pick New York | 59 | // if not timezone set, pick New York |
59 | if (tz.isNull()) | 60 | if (tz.isNull()) |
@@ -108,32 +109,28 @@ int initApplication( int argc, char ** argv ) | |||
108 | QObject::connect( &a, SIGNAL(power()), d, SLOT(togglePower()) ); | 109 | QObject::connect( &a, SIGNAL(power()), d, SLOT(togglePower()) ); |
109 | QObject::connect( &a, SIGNAL(backlight()), d, SLOT(toggleLight()) ); | 110 | QObject::connect( &a, SIGNAL(backlight()), d, SLOT(toggleLight()) ); |
110 | QObject::connect( &a, SIGNAL(symbol()), d, SLOT(toggleSymbolInput()) ); | 111 | QObject::connect( &a, SIGNAL(symbol()), d, SLOT(toggleSymbolInput()) ); |
111 | QObject::connect( &a, SIGNAL(numLockStateToggle()), d, SLOT(toggleNumLockState()) ); | 112 | QObject::connect( &a, SIGNAL(numLockStateToggle()), d, SLOT(toggleNumLockState()) ); |
112 | QObject::connect( &a, SIGNAL(capsLockStateToggle()), d, SLOT(toggleCapsLockState()) ); | 113 | QObject::connect( &a, SIGNAL(capsLockStateToggle()), d, SLOT(toggleCapsLockState()) ); |
113 | QObject::connect( &a, SIGNAL(prepareForRestart()), d, SLOT(terminateServers()) ); | 114 | QObject::connect( &a, SIGNAL(prepareForRestart()), d, SLOT(terminateServers()) ); |
114 | 115 | ||
115 | (void)new SysFileMonitor(d); | 116 | (void)new SysFileMonitor(d); |
116 | Network::createServer(d); | 117 | Network::createServer(d); |
117 | 118 | ||
118 | if ( QWSServer::mouseHandler() ->inherits("QCalibratedMouseHandler") ) { | 119 | if ( QWSServer::mouseHandler() ->inherits("QCalibratedMouseHandler") ) { |
119 | if ( !QFile::exists( "/etc/pointercal" ) ) { | 120 | if ( !QFile::exists( "/etc/pointercal" ) ) { |
120 | OProcess cal; | 121 | // Make sure calibration widget starts on top. |
121 | cal << "calibrate"; | 122 | Calibrate *cal = new Calibrate; |
122 | 123 | cal->exec(); | |
123 | if ( ! cal.start(OProcess::Block, OProcess::NoCommunication) ) { | 124 | delete cal; |
124 | QMessageBox::warning( 0, "Unable to calibrate", | ||
125 | "Failed to start the calibration tool.\n" | ||
126 | ); | ||
127 | } | ||
128 | } | 125 | } |
129 | } | 126 | } |
130 | 127 | ||
131 | d->show(); | 128 | d->show(); |
132 | 129 | ||
133 | if ( QDate::currentDate ( ). year ( ) < 2000 ) { | 130 | if ( QDate::currentDate ( ). year ( ) < 2000 ) { |
134 | 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 ) { | 131 | 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 ) { |
135 | QCopEnvelope e ( "QPE/Application/systemtime", "setDocument(QString)" ); | 132 | QCopEnvelope e ( "QPE/Application/systemtime", "setDocument(QString)" ); |
136 | e << QString ( ); | 133 | e << QString ( ); |
137 | } | 134 | } |
138 | } | 135 | } |
139 | 136 | ||