summaryrefslogtreecommitdiff
path: root/core/opie-login
authorkergoth <kergoth>2003-08-09 17:42:14 (UTC)
committer kergoth <kergoth>2003-08-09 17:42:14 (UTC)
commit1ab4ca95e4d2cf24d32b38c9031cb6076351e730 (patch) (side-by-side diff)
tree644d196b01c7f280981bd17da23c7592a18e5643 /core/opie-login
parentec14206f63dd93e9fb84c76cbc76fc1968637590 (diff)
downloadopie-1ab4ca95e4d2cf24d32b38c9031cb6076351e730.zip
opie-1ab4ca95e4d2cf24d32b38c9031cb6076351e730.tar.gz
opie-1ab4ca95e4d2cf24d32b38c9031cb6076351e730.tar.bz2
Merge from BRANCH_1_0
Diffstat (limited to 'core/opie-login') (more/less context) (ignore whitespace changes)
-rw-r--r--core/opie-login/main.cpp30
-rw-r--r--core/opie-login/opie-login.conffiles1
2 files changed, 24 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
@@ -54,6 +54,7 @@
#include <qlabel.h>
#include <qtimer.h>
#include <qfile.h>
+#include <qtextstream.h>
#include "loginapplication.h"
#include "loginwindowimpl.h"
@@ -74,6 +75,7 @@ static struct option long_options [] = {
int main ( int argc, char **argv )
{
+ int userExited = 0;
pid_t ppid = ::getpid ( );
if ( ::geteuid ( ) != 0 ) {
@@ -137,11 +139,17 @@ 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 SIGINT :
case SIGTERM:
+ case SIGINT :
case SIGKILL:
break;
@@ -162,7 +170,7 @@ int main ( int argc, char **argv )
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-> 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 ( ));
@@ -175,7 +183,8 @@ int main ( int argc, char **argv )
}
else {
if ( !autolog ) {
- Config cfg ( "opie-login" );
+ QString confFile=QPEApplication::qpeDir() + "/etc/opie-login.conf";
+ Config cfg ( confFile, Config::File );
cfg. setGroup ( "General" );
QString user = cfg. readEntry ( "AutoLogin" );
@@ -183,16 +192,23 @@ int main ( int argc, char **argv )
autolog = ::strdup ( user. latin1 ( ));
}
- if ( autolog ) {
- LoginApplication::setLoginAs ( autolog );
+ 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
+ else {
::exit ( login_main ( argc, argv, ppid ));
+ }
}
}
return 0;
@@ -355,7 +371,7 @@ int login_main ( int argc, char **argv, pid_t ppid )
// if login succeeds, it never comes back
- QMessageBox::critical ( 0, LoginWindowImpl::tr( "Failure" ), LoginWindowImpl::tr( "Could not start OPIE." ));
+ QMessageBox::critical ( 0, LoginWindowImpl::tr( "Failure" ), LoginWindowImpl::tr( "Could not start Opie." ));
rc = 1;
}
else {
diff --git a/core/opie-login/opie-login.conffiles b/core/opie-login/opie-login.conffiles
new file mode 100644
index 0000000..90645ee
--- a/dev/null
+++ b/core/opie-login/opie-login.conffiles
@@ -0,0 +1 @@
+/opt/QtPalmtop/etc/opie-login.conf