-rw-r--r-- | core/launcher/main.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/core/launcher/main.cpp b/core/launcher/main.cpp index 64fb968..d11b6c5 100644 --- a/core/launcher/main.cpp +++ b/core/launcher/main.cpp | |||
@@ -1,96 +1,95 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
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 | 33 | ||
34 | #include <qmessagebox.h> | 34 | #include <qmessagebox.h> |
35 | #include <qfile.h> | 35 | #include <qfile.h> |
36 | #include <qimage.h> | 36 | #include <qimage.h> |
37 | #include <qwindowsystem_qws.h> | 37 | #include <qwindowsystem_qws.h> |
38 | #include <qwsmouse_qws.h> | ||
38 | #include <qpe/qcopenvelope_qws.h> | 39 | #include <qpe/qcopenvelope_qws.h> |
39 | #include <qpe/alarmserver.h> | 40 | #include <qpe/alarmserver.h> |
40 | 41 | ||
41 | #include <stdlib.h> | 42 | #include <stdlib.h> |
42 | #include <stdio.h> | 43 | #include <stdio.h> |
43 | #include <signal.h> | 44 | #include <signal.h> |
44 | #include <unistd.h> | 45 | #include <unistd.h> |
45 | 46 | ||
46 | #if defined(QT_QWS_IPAQ) || defined(QT_QWS_SL5XXX) | ||
47 | #include "../calibrate/calibrate.h" | 47 | #include "../calibrate/calibrate.h" |
48 | #endif | ||
49 | 48 | ||
50 | using namespace Opie; | 49 | using namespace Opie; |
51 | 50 | ||
52 | void initEnvironment() | 51 | void initEnvironment() |
53 | { | 52 | { |
54 | Config config("locale"); | 53 | Config config("locale"); |
55 | config.setGroup( "Location" ); | 54 | config.setGroup( "Location" ); |
56 | QString tz = config.readEntry( "Timezone", getenv("TZ") ); | 55 | QString tz = config.readEntry( "Timezone", getenv("TZ") ); |
57 | 56 | ||
58 | // if not timezone set, pick New York | 57 | // if not timezone set, pick New York |
59 | if (tz.isNull()) | 58 | if (tz.isNull()) |
60 | tz = "America/New_York"; | 59 | tz = "America/New_York"; |
61 | 60 | ||
62 | setenv( "TZ", tz, 1 ); | 61 | setenv( "TZ", tz, 1 ); |
63 | config.writeEntry( "Timezone", tz); | 62 | config.writeEntry( "Timezone", tz); |
64 | 63 | ||
65 | config.setGroup( "Language" ); | 64 | config.setGroup( "Language" ); |
66 | QString lang = config.readEntry( "Language", getenv("LANG") ); | 65 | QString lang = config.readEntry( "Language", getenv("LANG") ); |
67 | if ( !lang.isNull() ) | 66 | if ( !lang.isNull() ) |
68 | setenv( "LANG", lang, 1 ); | 67 | setenv( "LANG", lang, 1 ); |
69 | } | 68 | } |
70 | 69 | ||
71 | 70 | ||
72 | int initApplication( int argc, char ** argv ) | 71 | int initApplication( int argc, char ** argv ) |
73 | { | 72 | { |
74 | initEnvironment(); | 73 | initEnvironment(); |
75 | 74 | ||
76 | #if !defined(QT_QWS_CASSIOPEIA) && !defined(QT_QWS_IPAQ) && !defined(QT_QWS_SL5XXX) | 75 | #if !defined(QT_QWS_CASSIOPEIA) && !defined(QT_QWS_IPAQ) && !defined(QT_QWS_SL5XXX) |
77 | setenv( "QWS_SIZE", "240x320", 0 ); | 76 | setenv( "QWS_SIZE", "240x320", 0 ); |
78 | #endif | 77 | #endif |
79 | 78 | ||
80 | //Don't flicker at startup: | 79 | //Don't flicker at startup: |
81 | QWSServer::setDesktopBackground( QImage() ); | 80 | QWSServer::setDesktopBackground( QImage() ); |
82 | DesktopApplication a( argc, argv, QApplication::GuiServer ); | 81 | DesktopApplication a( argc, argv, QApplication::GuiServer ); |
83 | 82 | ||
84 | ODevice::inst ( )-> setSoftSuspend ( true ); | 83 | ODevice::inst ( )-> setSoftSuspend ( true ); |
85 | 84 | ||
86 | { // init backlight | 85 | { // init backlight |
87 | QCopEnvelope e("QPE/System", "setBacklight(int)" ); | 86 | QCopEnvelope e("QPE/System", "setBacklight(int)" ); |
88 | e << -3; // Forced on | 87 | e << -3; // Forced on |
89 | } | 88 | } |
90 | 89 | ||
91 | AlarmServer::initialize(); | 90 | AlarmServer::initialize(); |
92 | 91 | ||
93 | Desktop *d = new Desktop(); | 92 | Desktop *d = new Desktop(); |
94 | 93 | ||
95 | QObject::connect( &a, SIGNAL(power()), d, SLOT(togglePower()) ); | 94 | QObject::connect( &a, SIGNAL(power()), d, SLOT(togglePower()) ); |
96 | QObject::connect( &a, SIGNAL(backlight()), d, SLOT(toggleLight()) ); | 95 | QObject::connect( &a, SIGNAL(backlight()), d, SLOT(toggleLight()) ); |