summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2003-11-06 10:28:39 (UTC)
committer mickeyl <mickeyl>2003-11-06 10:28:39 (UTC)
commit0b55f9efe488141e13bcaf84f5a05dfc69b550ba (patch) (unidiff)
treeaf5a146f922e2e075d7a57ab32c1e22018f338a7
parent8c283be8e455571a03f11035b23f649e49de726c (diff)
downloadopie-0b55f9efe488141e13bcaf84f5a05dfc69b550ba.zip
opie-0b55f9efe488141e13bcaf84f5a05dfc69b550ba.tar.gz
opie-0b55f9efe488141e13bcaf84f5a05dfc69b550ba.tar.bz2
merge core/opie-login
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/opie-login/main.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/opie-login/main.cpp b/core/opie-login/main.cpp
index 5ecde1e..7d2ed63 100644
--- a/core/opie-login/main.cpp
+++ b/core/opie-login/main.cpp
@@ -146,104 +146,105 @@ int main ( int argc, char **argv )
146 } 146 }
147 } 147 }
148 148
149 if ( WIFSIGNALED( status )) { 149 if ( WIFSIGNALED( status )) {
150 switch ( WTERMSIG( status )) { 150 switch ( WTERMSIG( status )) {
151 case SIGTERM: 151 case SIGTERM:
152 case SIGINT : 152 case SIGINT :
153 case SIGKILL: 153 case SIGKILL:
154 break; 154 break;
155 155
156 default : 156 default :
157 killedbysig = WTERMSIG( status ); 157 killedbysig = WTERMSIG( status );
158 break; 158 break;
159 } 159 }
160 } 160 }
161 if ( killedbysig ) { // qpe was killed by an uncaught signal 161 if ( killedbysig ) { // qpe was killed by an uncaught signal
162 qApp = 0; 162 qApp = 0;
163 163
164 ::syslog ( LOG_ERR, "Opie was killed by a signal #%d", killedbysig ); 164 ::syslog ( LOG_ERR, "Opie was killed by a signal #%d", killedbysig );
165 165
166 QWSServer::setDesktopBackground ( QImage ( )); 166 QWSServer::setDesktopBackground ( QImage ( ));
167 QApplication *app = new QApplication ( argc, argv, QApplication::GuiServer ); 167 QApplication *app = new QApplication ( argc, argv, QApplication::GuiServer );
168 app-> setFont ( QFont ( "Helvetica", 10 )); 168 app-> setFont ( QFont ( "Helvetica", 10 ));
169 app-> setStyle ( new QPEStyle ( )); 169 app-> setStyle ( new QPEStyle ( ));
170 170
171 const char *sig = ::strsignal ( killedbysig ); 171 const char *sig = ::strsignal ( killedbysig );
172 QLabel *l = new QLabel ( 0, "sig", Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_Tool ); 172 QLabel *l = new QLabel ( 0, "sig", Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_Tool );
173 l-> setText ( LoginWindowImpl::tr( "Opie was terminated\nby an uncaught signal\n(%1)\n" ). arg ( sig )); 173 l-> setText ( LoginWindowImpl::tr( "Opie was terminated\nby an uncaught signal\n(%1)\n" ). arg ( sig ));
174 l-> setAlignment ( Qt::AlignCenter ); 174 l-> setAlignment ( Qt::AlignCenter );
175 l-> move ( 0, 0 ); 175 l-> move ( 0, 0 );
176 l-> resize ( app-> desktop ( )-> width ( ), app-> desktop ( )-> height ( )); 176 l-> resize ( app-> desktop ( )-> width ( ), app-> desktop ( )-> height ( ));
177 l-> show ( ); 177 l-> show ( );
178 QTimer::singleShot ( 3000, app, SLOT( quit ( ))); 178 QTimer::singleShot ( 3000, app, SLOT( quit ( )));
179 app-> exec ( ); 179 app-> exec ( );
180 delete app; 180 delete app;
181 qApp = 0; 181 qApp = 0;
182 } 182 }
183 } 183 }
184 else { 184 else {
185 if ( !autolog ) { 185 if ( !autolog ) {
186 QString confFile=QPEApplication::qpeDir() + "/etc/opie-login.conf"; 186 QString confFile=QPEApplication::qpeDir() + "/etc/opie-login.conf";
187 Config cfg ( confFile, Config::File ); 187 Config cfg ( confFile, Config::File );
188 cfg. setGroup ( "General" ); 188 cfg. setGroup ( "General" );
189 QString user = cfg. readEntry ( "AutoLogin" ); 189 QString user = cfg. readEntry ( "AutoLogin" );
190 190
191 if ( !user. isEmpty ( )) 191 if ( !user. isEmpty ( ))
192 autolog = ::strdup ( user. latin1 ( )); 192 autolog = ::strdup ( user. latin1 ( ));
193 } 193 }
194 194
195 if ( autolog && !userExited ) { 195 if ( autolog && !userExited ) {
196 196
197 QWSServer::setDesktopBackground( QImage() ); 197 QWSServer::setDesktopBackground( QImage() );
198 ODevice::inst ( )-> setDisplayStatus ( true ); 198 ODevice::inst ( )-> setDisplayStatus ( true );
199 ODevice::inst ( )-> setSoftSuspend ( false ); 199 ODevice::inst ( )-> setSoftSuspend ( false );
200 LoginApplication *app = new LoginApplication ( argc, argv, ppid ); 200 LoginApplication *app = new LoginApplication ( argc, argv, ppid );
201 LoginApplication::setLoginAs ( autolog ); 201 LoginApplication::setLoginAs ( autolog );
202
202 203
203 if ( LoginApplication::changeIdentity ( )) 204 if ( LoginApplication::changeIdentity ( ))
204 ::exit ( LoginApplication::login ( )); 205 ::exit ( LoginApplication::login ( ));
205 else 206 else
206 ::exit ( 0 ); 207 ::exit ( 0 );
207 } 208 }
208 else { 209 else {
209 ::exit ( login_main ( argc, argv, ppid )); 210 ::exit ( login_main ( argc, argv, ppid ));
210 } 211 }
211 } 212 }
212 } 213 }
213 return 0; 214 return 0;
214} 215}
215 216
216void sigterm ( int /*sig*/ ) 217void sigterm ( int /*sig*/ )
217{ 218{
218 ::exit ( 0 ); 219 ::exit ( 0 );
219} 220}
220 221
221 222
222void exit_closelog ( ) 223void exit_closelog ( )
223{ 224{
224 ::closelog ( ); 225 ::closelog ( );
225} 226}
226 227
227 228
228class LoginScreenSaver : public QWSScreenSaver 229class LoginScreenSaver : public QWSScreenSaver
229{ 230{
230public: 231public:
231 LoginScreenSaver ( ) 232 LoginScreenSaver ( )
232 { 233 {
233 m_lcd_status = true; 234 m_lcd_status = true;
234 235
235 m_backlight_bright = -1; 236 m_backlight_bright = -1;
236 m_backlight_forcedoff = false; 237 m_backlight_forcedoff = false;
237 238
238 // Make sure the LCD is in fact on, (if opie was killed while the LCD is off it would still be off) 239 // Make sure the LCD is in fact on, (if opie was killed while the LCD is off it would still be off)
239 ODevice::inst ( )-> setDisplayStatus ( true ); 240 ODevice::inst ( )-> setDisplayStatus ( true );
240 } 241 }
241 void restore() 242 void restore()
242 { 243 {
243 if ( !m_lcd_status ) // We must have turned it off 244 if ( !m_lcd_status ) // We must have turned it off
244 ODevice::inst ( ) -> setDisplayStatus ( true ); 245 ODevice::inst ( ) -> setDisplayStatus ( true );
245 246
246 setBacklight ( -3 ); 247 setBacklight ( -3 );
247 } 248 }
248 bool save( int level ) 249 bool save( int level )
249 { 250 {