author | mickeyl <mickeyl> | 2003-11-06 10:28:39 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-11-06 10:28:39 (UTC) |
commit | 0b55f9efe488141e13bcaf84f5a05dfc69b550ba (patch) (side-by-side diff) | |
tree | af5a146f922e2e075d7a57ab32c1e22018f338a7 | |
parent | 8c283be8e455571a03f11035b23f649e49de726c (diff) | |
download | opie-0b55f9efe488141e13bcaf84f5a05dfc69b550ba.zip opie-0b55f9efe488141e13bcaf84f5a05dfc69b550ba.tar.gz opie-0b55f9efe488141e13bcaf84f5a05dfc69b550ba.tar.bz2 |
merge core/opie-login
-rw-r--r-- | core/opie-login/main.cpp | 1 |
1 files changed, 1 insertions, 0 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 @@ -139,128 +139,129 @@ int main ( int argc, char **argv ) } } int killedbysig = 0; userExited=0; if (WIFEXITED(status)!=0 ) { if (WEXITSTATUS(status)==137) { userExited=1; } } if ( WIFSIGNALED( status )) { switch ( WTERMSIG( status )) { case SIGTERM: case SIGINT : case SIGKILL: break; default : killedbysig = WTERMSIG( status ); break; } } if ( killedbysig ) { // qpe was killed by an uncaught signal qApp = 0; ::syslog ( LOG_ERR, "Opie was killed by a signal #%d", killedbysig ); QWSServer::setDesktopBackground ( QImage ( )); QApplication *app = new QApplication ( argc, argv, QApplication::GuiServer ); app-> setFont ( QFont ( "Helvetica", 10 )); app-> setStyle ( new QPEStyle ( )); const char *sig = ::strsignal ( killedbysig ); QLabel *l = new QLabel ( 0, "sig", Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_Tool ); l-> setText ( LoginWindowImpl::tr( "Opie was terminated\nby an uncaught signal\n(%1)\n" ). arg ( sig )); l-> setAlignment ( Qt::AlignCenter ); l-> move ( 0, 0 ); l-> resize ( app-> desktop ( )-> width ( ), app-> desktop ( )-> height ( )); l-> show ( ); QTimer::singleShot ( 3000, app, SLOT( quit ( ))); app-> exec ( ); delete app; qApp = 0; } } else { if ( !autolog ) { QString confFile=QPEApplication::qpeDir() + "/etc/opie-login.conf"; Config cfg ( confFile, Config::File ); cfg. setGroup ( "General" ); QString user = cfg. readEntry ( "AutoLogin" ); if ( !user. isEmpty ( )) autolog = ::strdup ( user. latin1 ( )); } if ( autolog && !userExited ) { QWSServer::setDesktopBackground( QImage() ); ODevice::inst ( )-> setDisplayStatus ( true ); ODevice::inst ( )-> setSoftSuspend ( false ); LoginApplication *app = new LoginApplication ( argc, argv, ppid ); LoginApplication::setLoginAs ( autolog ); + if ( LoginApplication::changeIdentity ( )) ::exit ( LoginApplication::login ( )); else ::exit ( 0 ); } else { ::exit ( login_main ( argc, argv, ppid )); } } } return 0; } void sigterm ( int /*sig*/ ) { ::exit ( 0 ); } void exit_closelog ( ) { ::closelog ( ); } class LoginScreenSaver : public QWSScreenSaver { public: LoginScreenSaver ( ) { m_lcd_status = true; m_backlight_bright = -1; m_backlight_forcedoff = false; // Make sure the LCD is in fact on, (if opie was killed while the LCD is off it would still be off) ODevice::inst ( )-> setDisplayStatus ( true ); } void restore() { if ( !m_lcd_status ) // We must have turned it off ODevice::inst ( ) -> setDisplayStatus ( true ); setBacklight ( -3 ); } bool save( int level ) { switch ( level ) { case 0: if ( backlight() > 1 ) setBacklight( 1 ); // lowest non-off return true; break; case 1: setBacklight( 0 ); // off return true; break; case 2: // We're going to suspend the whole machine if ( PowerStatusManager::readStatus().acStatus() != PowerStatus::Online ) { QWSServer::sendKeyEvent( 0xffff, Qt::Key_F34, FALSE, TRUE, FALSE ); return true; } break; |