summaryrefslogtreecommitdiff
authorkergoth <kergoth>2003-01-26 03:30:49 (UTC)
committer kergoth <kergoth>2003-01-26 03:30:49 (UTC)
commit77af78cf44026f52cc119a16554749daefc59617 (patch) (unidiff)
tree8b2afa79b4efa5a1b0f0e4d5a488796067d904a1
parent7efc361470c6c91eb06ae7e800bb64aa645f6f73 (diff)
downloadopie-77af78cf44026f52cc119a16554749daefc59617.zip
opie-77af78cf44026f52cc119a16554749daefc59617.tar.gz
opie-77af78cf44026f52cc119a16554749daefc59617.tar.bz2
Undo unintentional commit
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/main.cpp104
-rw-r--r--packages1
2 files changed, 44 insertions, 61 deletions
diff --git a/core/launcher/main.cpp b/core/launcher/main.cpp
index 1e5eb46..49b41d6 100644
--- a/core/launcher/main.cpp
+++ b/core/launcher/main.cpp
@@ -4,190 +4,174 @@
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_SHARP ) || defined( QT_QWS_IPAQ ) 28#if defined( QT_QWS_SHARP ) || 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 <qpe/qcopenvelope_qws.h> 38#include <qpe/qcopenvelope_qws.h>
39#include <qpe/alarmserver.h> 39#include <qpe/alarmserver.h>
40 40
41#include <stdlib.h> 41#include <stdlib.h>
42#include <stdio.h> 42#include <stdio.h>
43#include <signal.h> 43#include <signal.h>
44#include <unistd.h> 44#include <unistd.h>
45 45
46#if defined(QT_QWS_IPAQ) || defined(QT_QWS_EBX) 46#if defined(QT_QWS_IPAQ) || defined(QT_QWS_EBX)
47#include "../calibrate/calibrate.h" 47#include "../calibrate/calibrate.h"
48#endif 48#endif
49 49
50using namespace Opie; 50using namespace Opie;
51 51
52void initEnvironment( ) 52void initEnvironment()
53{ 53{
54 Config config("locale"); 54 Config config("locale");
55 config.setGroup( "Location" ); 55 config.setGroup( "Location" );
56 QString tz = config.readEntry( "Timezone", getenv("TZ") ); 56 QString tz = config.readEntry( "Timezone", getenv("TZ") );
57 57
58 // if not timezone set, pick New York 58 // if not timezone set, pick New York
59 if (tz.isNull()) 59 if (tz.isNull())
60 tz = "America/New_York"; 60 tz = "America/New_York";
61 61
62 setenv( "TZ", tz, 1 ); 62 setenv( "TZ", tz, 1 );
63 config.writeEntry( "Timezone", tz); 63 config.writeEntry( "Timezone", tz);
64
65 config.setGroup( "Language" );
66 QString lang = config.readEntry( "Language", getenv("LANG") );
67 if ( !lang.isNull() )
68 setenv( "LANG", lang, 1 );
69 64
65 config.setGroup( "Language" );
66 QString lang = config.readEntry( "Language", getenv("LANG") );
67 if ( !lang.isNull() )
68 setenv( "LANG", lang, 1 );
70} 69}
71 70
72 71
73int initApplication( int argc, char ** argv ) 72int initApplication( int argc, char ** argv )
74{ 73{
75 struct ODevice *odev = ODevice::inst(); 74 initEnvironment();
76
77 initEnvironment( );
78 75
79#if !defined(QT_QWS_CASSIOPEIA) && !defined(QT_QWS_IPAQ) && !defined(QT_QWS_EBX) 76#if !defined(QT_QWS_CASSIOPEIA) && !defined(QT_QWS_IPAQ) && !defined(QT_QWS_EBX)
80 setenv( "QWS_SIZE", "240x320", 0 ); 77 setenv( "QWS_SIZE", "240x320", 0 );
81#endif 78#endif
82 79
83 //Don't flicker at startup: 80 //Don't flicker at startup:
84 QWSServer::setDesktopBackground( QImage() ); 81 QWSServer::setDesktopBackground( QImage() );
85 DesktopApplication a( argc, argv, QApplication::GuiServer ); 82 DesktopApplication a( argc, argv, QApplication::GuiServer );
86 83
87 int rot; 84 ODevice::inst ( )-> setSoftSuspend ( true );
88 switch ( odev-> rotation( ) ) {
89 case None:
90 rot = 0;
91 case Rot90:
92 rot = 90;
93 case Rot180:
94 rot = 180;
95 case Rot270:
96 rot = 270;
97 }
98 a.setDefaultRotation( rot );
99
100 odev-> setSoftSuspend ( true );
101 85
102 { // init backlight 86 { // init backlight
103 QCopEnvelope e("QPE/System", "setBacklight(int)" ); 87 QCopEnvelope e("QPE/System", "setBacklight(int)" );
104 e << -3; // Forced on 88 e << -3; // Forced on
105 } 89 }
106 90
107 AlarmServer::initialize(); 91 AlarmServer::initialize();
108 92
109 Desktop *d = new Desktop(); 93 Desktop *d = new Desktop();
110 94
111 QObject::connect( &a, SIGNAL(power()), d, SLOT(togglePower()) ); 95 QObject::connect( &a, SIGNAL(power()), d, SLOT(togglePower()) );
112 QObject::connect( &a, SIGNAL(backlight()), d, SLOT(toggleLight()) ); 96 QObject::connect( &a, SIGNAL(backlight()), d, SLOT(toggleLight()) );
113 QObject::connect( &a, SIGNAL(symbol()), d, SLOT(toggleSymbolInput()) ); 97 QObject::connect( &a, SIGNAL(symbol()), d, SLOT(toggleSymbolInput()) );
114 QObject::connect( &a, SIGNAL(numLockStateToggle()), d, SLOT(toggleNumLockState()) ); 98 QObject::connect( &a, SIGNAL(numLockStateToggle()), d, SLOT(toggleNumLockState()) );
115 QObject::connect( &a, SIGNAL(capsLockStateToggle()), d, SLOT(toggleCapsLockState()) ); 99 QObject::connect( &a, SIGNAL(capsLockStateToggle()), d, SLOT(toggleCapsLockState()) );
116 QObject::connect( &a, SIGNAL(prepareForRestart()), d, SLOT(terminateServers()) ); 100 QObject::connect( &a, SIGNAL(prepareForRestart()), d, SLOT(terminateServers()) );
117 101
118 (void)new SysFileMonitor(d); 102 (void)new SysFileMonitor(d);
119 Network::createServer(d); 103 Network::createServer(d);
120 104
121#if defined(QT_QWS_CASSIOPEIA) || defined(QT_QWS_IPAQ) || defined(QT_QWS_EBX) 105#if defined(QT_QWS_CASSIOPEIA) || defined(QT_QWS_IPAQ) || defined(QT_QWS_EBX)
122 if ( !QFile::exists( "/etc/pointercal" ) ) { 106 if ( !QFile::exists( "/etc/pointercal" ) ) {
123 // Make sure calibration widget starts on top. 107 // Make sure calibration widget starts on top.
124 Calibrate *cal = new Calibrate; 108 Calibrate *cal = new Calibrate;
125 cal->exec(); 109 cal->exec();
126 delete cal; 110 delete cal;
127 } 111 }
128#endif 112#endif
129 113
130 d->show(); 114 d->show();
131 115
132 if ( QDate::currentDate ( ). year ( ) < 2000 ) { 116 if ( QDate::currentDate ( ). year ( ) < 2000 ) {
133 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 ) {
134 QCopEnvelope e ( "QPE/Application/systemtime", "setDocument(QString)" ); 118 QCopEnvelope e ( "QPE/Application/systemtime", "setDocument(QString)" );
135 e << QString ( ); 119 e << QString ( );
136 } 120 }
137 } 121 }
138 122
139 int rv = a.exec(); 123 int rv = a.exec();
140 124
141 delete d; 125 delete d;
142 126
143 odev-> setSoftSuspend ( false ); 127 ODevice::inst ( )-> setSoftSuspend ( false );
144 128
145 return rv; 129 return rv;
146} 130}
147 131
148static const char *pidfile_path = "/var/run/opie.pid"; 132static const char *pidfile_path = "/var/run/opie.pid";
149 133
150void create_pidfile ( ) 134void create_pidfile ( )
151{ 135{
152 FILE *f; 136 FILE *f;
153 137
154 if (( f = ::fopen ( pidfile_path, "w" ))) { 138 if (( f = ::fopen ( pidfile_path, "w" ))) {
155 ::fprintf ( f, "%d", getpid ( )); 139 ::fprintf ( f, "%d", getpid ( ));
156 ::fclose ( f ); 140 ::fclose ( f );
157 } 141 }
158} 142}
159 143
160void remove_pidfile ( ) 144void remove_pidfile ( )
161{ 145{
162 ::unlink ( pidfile_path ); 146 ::unlink ( pidfile_path );
163} 147}
164 148
165void handle_sigterm ( int /* sig */ ) 149void handle_sigterm ( int /* sig */ )
166{ 150{
167 if ( qApp ) 151 if ( qApp )
168 qApp-> quit ( ); 152 qApp-> quit ( );
169} 153}
170 154
171int main( int argc, char ** argv ) 155int main( int argc, char ** argv )
172{ 156{
173 ::signal ( SIGCHLD, SIG_IGN ); 157 ::signal ( SIGCHLD, SIG_IGN );
174 158
175 ::signal ( SIGTERM, handle_sigterm ); 159 ::signal ( SIGTERM, handle_sigterm );
176 ::signal ( SIGINT, handle_sigterm ); 160 ::signal ( SIGINT, handle_sigterm );
177 161
178 ::setsid ( ); 162 ::setsid ( );
179 ::setpgid ( 0, 0 ); 163 ::setpgid ( 0, 0 );
180 164
181 ::atexit ( remove_pidfile ); 165 ::atexit ( remove_pidfile );
182 create_pidfile ( ); 166 create_pidfile ( );
183 167
184 int retVal = initApplication ( argc, argv ); 168 int retVal = initApplication ( argc, argv );
185 169
186 // Kill them. Kill them all. 170 // Kill them. Kill them all.
187 ::kill ( 0, SIGTERM ); 171 ::kill ( 0, SIGTERM );
188 ::sleep ( 1 ); 172 ::sleep ( 1 );
189 ::kill ( 0, SIGKILL ); 173 ::kill ( 0, SIGKILL );
190 174
191 return retVal; 175 return retVal;
192} 176}
193 177
diff --git a/packages b/packages
index fc26ef8..b05f90a 100644
--- a/packages
+++ b/packages
@@ -1,59 +1,58 @@
1 CONFIG_APPSKEY noncore/settings/appskeyappskey.pro 1 CONFIG_APPSKEY noncore/settings/appskeyappskey.pro
2 CONFIG_BINARY noncore/tools/calc2/binarybinary.pro 2 CONFIG_BINARY noncore/tools/calc2/binarybinary.pro
3 CONFIG_CALC2 noncore/tools/calc2calc2.pro 3 CONFIG_CALC2 noncore/tools/calc2calc2.pro
4 CONFIG_CALIBRATE core/apps/calibratecalibrate.pro 4 CONFIG_CALIBRATE core/apps/calibratecalibrate.pro
5 CONFIG_CHESS noncore/games/chesschess.pro 5 CONFIG_CHESS noncore/games/chesschess.pro
6 CONFIG_CONVERTER noncore/unsupported/opiemail/converterconverter.pro 6 CONFIG_CONVERTER noncore/unsupported/opiemail/converterconverter.pro
7 CONFIG_DIALUP noncore/unsupported/netsetup/dialupdialup.pro 7 CONFIG_DIALUP noncore/unsupported/netsetup/dialupdialup.pro
8 CONFIG_DICTIONARY noncore/apps/dictionarydictionary.pro 8 CONFIG_DICTIONARY noncore/apps/dictionarydictionary.pro
9 CONFIG_GSMTOOL noncore/comm/gsmtoolgsmtool.pro 9 CONFIG_GSMTOOL noncore/comm/gsmtoolgsmtool.pro
10 CONFIG_KEYVIEW development/keyviewkeyview.pro 10 CONFIG_KEYVIEW development/keyviewkeyview.pro
11 CONFIG_ROTTEST development/rottestrottest.pro
12 CONFIG_LAN noncore/unsupported/netsetup/lanlan.pro 11 CONFIG_LAN noncore/unsupported/netsetup/lanlan.pro
13 CONFIG_LIB noncore/unsupported/opiemail/liblib.pro 12 CONFIG_LIB noncore/unsupported/opiemail/liblib.pro
14 CONFIG_LIBFFMPEG core/multimedia/opieplayer/libffmpeglibffmpeg.pro 13 CONFIG_LIBFFMPEG core/multimedia/opieplayer/libffmpeglibffmpeg.pro
15 CONFIG_LIBFLASH core/multimedia/opieplayer/libflashlibflash.pro 14 CONFIG_LIBFLASH core/multimedia/opieplayer/libflashlibflash.pro
16 CONFIG_LIBOPIE_PIM libopie/pimpim.pro 15 CONFIG_LIBOPIE_PIM libopie/pimpim.pro
17 CONFIG_LIBSQL libsqllibsql.pro 16 CONFIG_LIBSQL libsqllibsql.pro
18 CONFIG_MOBILEMSG noncore/comm/mobilemsgmobilemsg.pro 17 CONFIG_MOBILEMSG noncore/comm/mobilemsgmobilemsg.pro
19 CONFIG_NETMONAPPLET noncore/unsupported/netmonappletnetmonapplet.pro 18 CONFIG_NETMONAPPLET noncore/unsupported/netmonappletnetmonapplet.pro
20 CONFIG_NETSETUP noncore/unsupported/netsetupnetsetup.pro 19 CONFIG_NETSETUP noncore/unsupported/netsetupnetsetup.pro
21 CONFIG_OFILESELECTOR libopie/ofileselectorofileselector.pro 20 CONFIG_OFILESELECTOR libopie/ofileselectorofileselector.pro
22 CONFIG_OPIE-WRITE noncore/apps/opie-writeopie-write.pro 21 CONFIG_OPIE-WRITE noncore/apps/opie-writeopie-write.pro
23 CONFIG_OPIEMAIL noncore/unsupported/opiemailopiemail.pro 22 CONFIG_OPIEMAIL noncore/unsupported/opiemailopiemail.pro
24 CONFIG_POP3 noncore/unsupported/opiemail/ifaces/pop3pop3.pro 23 CONFIG_POP3 noncore/unsupported/opiemail/ifaces/pop3pop3.pro
25 CONFIG_QUICKEXEC quickexecquickexec.pro 24 CONFIG_QUICKEXEC quickexecquickexec.pro
26 CONFIG_RESTARTAPPLET core/applets/restartappletrestartapplet.pro 25 CONFIG_RESTARTAPPLET core/applets/restartappletrestartapplet.pro
27 CONFIG_RESTARTAPPLET2 core/applets/restartapplet2restartapplet2.pro 26 CONFIG_RESTARTAPPLET2 core/applets/restartapplet2restartapplet2.pro
28 CONFIG_SDMON noncore/unsupported/sdmonsdmon.pro 27 CONFIG_SDMON noncore/unsupported/sdmonsdmon.pro
29 CONFIG_SIMPLE noncore/tools/calc2/simplesimple.pro 28 CONFIG_SIMPLE noncore/tools/calc2/simplesimple.pro
30 CONFIG_SMTP noncore/unsupported/opiemail/ifaces/smtpsmtp.pro 29 CONFIG_SMTP noncore/unsupported/opiemail/ifaces/smtpsmtp.pro
31 CONFIG_SPREADSHEET noncore/unsupported/spreadsheetspreadsheet.pro 30 CONFIG_SPREADSHEET noncore/unsupported/spreadsheetspreadsheet.pro
32 CONFIG_SYSTEMTIME noncore/unsupported/systemtimesystemtime.pro 31 CONFIG_SYSTEMTIME noncore/unsupported/systemtimesystemtime.pro
33 CONFIG_TEST libsql/testtest.pro 32 CONFIG_TEST libsql/testtest.pro
34 CONFIG_TEST noncore/apps/opie-console/testtest.pro 33 CONFIG_TEST noncore/apps/opie-console/testtest.pro
35 CONFIG_UBROWSER noncore/net/ubrowserubrowser.pro 34 CONFIG_UBROWSER noncore/net/ubrowserubrowser.pro
36 CONFIG_WELLENREITER noncore/net/wellenreiterwellenreiter.pro 35 CONFIG_WELLENREITER noncore/net/wellenreiterwellenreiter.pro
37 CONFIG_WLANSETUP noncore/unsupported/wlansetupwlansetup.pro 36 CONFIG_WLANSETUP noncore/unsupported/wlansetupwlansetup.pro
38 CONFIG_ADDRESSBOOK core/pim/addressbookaddressbook.pro 37 CONFIG_ADDRESSBOOK core/pim/addressbookaddressbook.pro
39 CONFIG_ADVANCEDFM noncore/apps/advancedfmadvancedfm.pro 38 CONFIG_ADVANCEDFM noncore/apps/advancedfmadvancedfm.pro
40 CONFIG_APPEARANCE2 noncore/settings/appearance2appearance2.pro 39 CONFIG_APPEARANCE2 noncore/settings/appearance2appearance2.pro
41 CONFIG_OPIETOOTH-APPLET noncore/net/opietooth/appletapplet.pro 40 CONFIG_OPIETOOTH-APPLET noncore/net/opietooth/appletapplet.pro
42 CONFIG_AQPKG noncore/apps/aqpkgaqpkg.pro 41 CONFIG_AQPKG noncore/apps/aqpkgaqpkg.pro
43 CONFIG_BACKUP noncore/settings/backupbackup.pro 42 CONFIG_BACKUP noncore/settings/backupbackup.pro
44 CONFIG_BATTERYAPPLET core/applets/batteryappletbatteryapplet.pro 43 CONFIG_BATTERYAPPLET core/applets/batteryappletbatteryapplet.pro
45 CONFIG_BEND noncore/mail/bendbend.pro 44 CONFIG_BEND noncore/mail/bendbend.pro
46 CONFIG_BLUE-PIN noncore/net/opietooth/blue-pinblue-pin.pro 45 CONFIG_BLUE-PIN noncore/net/opietooth/blue-pinblue-pin.pro
47 CONFIG_BOUNCE noncore/games/bouncebounce.pro 46 CONFIG_BOUNCE noncore/games/bouncebounce.pro
48 CONFIG_BUTTON-SETTINGS core/settings/buttonbutton.pro 47 CONFIG_BUTTON-SETTINGS core/settings/buttonbutton.pro
49 CONFIG_BUZZWORD noncore/games/buzzwordbuzzword.pro 48 CONFIG_BUZZWORD noncore/games/buzzwordbuzzword.pro
50 CONFIG_CALCULATOR noncore/tools/calculatorcalculator.pro 49 CONFIG_CALCULATOR noncore/tools/calculatorcalculator.pro
51 CONFIG_CARDMON core/applets/cardmoncardmon.pro 50 CONFIG_CARDMON core/applets/cardmoncardmon.pro
52 CONFIG_CHECKBOOK noncore/apps/checkbookcheckbook.pro 51 CONFIG_CHECKBOOK noncore/apps/checkbookcheckbook.pro
53 CONFIG_CITYTIME core/settings/citytimecitytime.pro 52 CONFIG_CITYTIME core/settings/citytimecitytime.pro
54 CONFIG_CLIPBOARDAPPLET core/applets/clipboardappletclipboardapplet.pro 53 CONFIG_CLIPBOARDAPPLET core/applets/clipboardappletclipboardapplet.pro
55 CONFIG_CLOCK noncore/tools/clockclock.pro 54 CONFIG_CLOCK noncore/tools/clockclock.pro
56 CONFIG_CLOCKAPPLET core/applets/clockappletclockapplet.pro 55 CONFIG_CLOCKAPPLET core/applets/clockappletclockapplet.pro
57 CONFIG_CONFEDIT noncore/apps/confeditconfedit.pro 56 CONFIG_CONFEDIT noncore/apps/confeditconfedit.pro
58 CONFIG_DATEBOOK core/pim/datebookdatebook.pro 57 CONFIG_DATEBOOK core/pim/datebookdatebook.pro
59 CONFIG_DECO_FLAT noncore/decorations/flatflat.pro 58 CONFIG_DECO_FLAT noncore/decorations/flatflat.pro