author | kergoth <kergoth> | 2003-08-09 17:42:14 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-08-09 17:42:14 (UTC) |
commit | 1ab4ca95e4d2cf24d32b38c9031cb6076351e730 (patch) (unidiff) | |
tree | 644d196b01c7f280981bd17da23c7592a18e5643 /core/opie-login/main.cpp | |
parent | ec14206f63dd93e9fb84c76cbc76fc1968637590 (diff) | |
download | opie-1ab4ca95e4d2cf24d32b38c9031cb6076351e730.zip opie-1ab4ca95e4d2cf24d32b38c9031cb6076351e730.tar.gz opie-1ab4ca95e4d2cf24d32b38c9031cb6076351e730.tar.bz2 |
Merge from BRANCH_1_0
-rw-r--r-- | core/opie-login/main.cpp | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/core/opie-login/main.cpp b/core/opie-login/main.cpp index d95a59b..7dcb5f6 100644 --- a/core/opie-login/main.cpp +++ b/core/opie-login/main.cpp | |||
@@ -55,4 +55,5 @@ | |||
55 | #include <qtimer.h> | 55 | #include <qtimer.h> |
56 | #include <qfile.h> | 56 | #include <qfile.h> |
57 | #include <qtextstream.h> | ||
57 | 58 | ||
58 | #include "loginapplication.h" | 59 | #include "loginapplication.h" |
@@ -75,4 +76,5 @@ static struct option long_options [] = { | |||
75 | int main ( int argc, char **argv ) | 76 | int main ( int argc, char **argv ) |
76 | { | 77 | { |
78 | int userExited = 0; | ||
77 | pid_t ppid = ::getpid ( ); | 79 | pid_t ppid = ::getpid ( ); |
78 | 80 | ||
@@ -138,9 +140,15 @@ int main ( int argc, char **argv ) | |||
138 | } | 140 | } |
139 | int killedbysig = 0; | 141 | int killedbysig = 0; |
142 | userExited=0; | ||
143 | if (WIFEXITED(status)!=0 ) { | ||
144 | if (WEXITSTATUS(status)==137) { | ||
145 | userExited=1; | ||
146 | } | ||
147 | } | ||
140 | 148 | ||
141 | if ( WIFSIGNALED( status )) { | 149 | if ( WIFSIGNALED( status )) { |
142 | switch ( WTERMSIG( status )) { | 150 | switch ( WTERMSIG( status )) { |
143 | case SIGINT : | ||
144 | case SIGTERM: | 151 | case SIGTERM: |
152 | case SIGINT : | ||
145 | case SIGKILL: | 153 | case SIGKILL: |
146 | break; | 154 | break; |
@@ -163,5 +171,5 @@ int main ( int argc, char **argv ) | |||
163 | const char *sig = ::strsignal ( killedbysig ); | 171 | const char *sig = ::strsignal ( killedbysig ); |
164 | 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 ); |
165 | 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 )); |
166 | l-> setAlignment ( Qt::AlignCenter ); | 174 | l-> setAlignment ( Qt::AlignCenter ); |
167 | l-> move ( 0, 0 ); | 175 | l-> move ( 0, 0 ); |
@@ -176,5 +184,6 @@ int main ( int argc, char **argv ) | |||
176 | else { | 184 | else { |
177 | if ( !autolog ) { | 185 | if ( !autolog ) { |
178 | Config cfg ( "opie-login" ); | 186 | QString confFile=QPEApplication::qpeDir() + "/etc/opie-login.conf"; |
187 | Config cfg ( confFile, Config::File ); | ||
179 | cfg. setGroup ( "General" ); | 188 | cfg. setGroup ( "General" ); |
180 | QString user = cfg. readEntry ( "AutoLogin" ); | 189 | QString user = cfg. readEntry ( "AutoLogin" ); |
@@ -184,6 +193,12 @@ int main ( int argc, char **argv ) | |||
184 | } | 193 | } |
185 | 194 | ||
186 | if ( autolog ) { | 195 | if ( autolog && !userExited ) { |
187 | LoginApplication::setLoginAs ( autolog ); | 196 | |
197 | QWSServer::setDesktopBackground( QImage() ); | ||
198 | ODevice::inst ( )-> setDisplayStatus ( true ); | ||
199 | ODevice::inst ( )-> setSoftSuspend ( false ); | ||
200 | LoginApplication *app = new LoginApplication ( argc, argv, ppid ); | ||
201 | LoginApplication::setLoginAs ( autolog ); | ||
202 | |||
188 | 203 | ||
189 | if ( LoginApplication::changeIdentity ( )) | 204 | if ( LoginApplication::changeIdentity ( )) |
@@ -192,6 +207,7 @@ int main ( int argc, char **argv ) | |||
192 | ::exit ( 0 ); | 207 | ::exit ( 0 ); |
193 | } | 208 | } |
194 | else | 209 | else { |
195 | ::exit ( login_main ( argc, argv, ppid )); | 210 | ::exit ( login_main ( argc, argv, ppid )); |
211 | } | ||
196 | } | 212 | } |
197 | } | 213 | } |
@@ -356,5 +372,5 @@ int login_main ( int argc, char **argv, pid_t ppid ) | |||
356 | // if login succeeds, it never comes back | 372 | // if login succeeds, it never comes back |
357 | 373 | ||
358 | QMessageBox::critical ( 0, LoginWindowImpl::tr( "Failure" ), LoginWindowImpl::tr( "Could not start OPIE." )); | 374 | QMessageBox::critical ( 0, LoginWindowImpl::tr( "Failure" ), LoginWindowImpl::tr( "Could not start Opie." )); |
359 | rc = 1; | 375 | rc = 1; |
360 | } | 376 | } |