-rw-r--r-- | core/opie-login/loginwindow.ui | 22 | ||||
-rw-r--r-- | core/opie-login/loginwindowimpl.cpp | 54 | ||||
-rw-r--r-- | core/opie-login/loginwindowimpl.h | 1 | ||||
-rw-r--r-- | core/opie-login/main.cpp | 197 |
4 files changed, 168 insertions, 106 deletions
diff --git a/core/opie-login/loginwindow.ui b/core/opie-login/loginwindow.ui index 86d5469..edd0819 100644 --- a/core/opie-login/loginwindow.ui +++ b/core/opie-login/loginwindow.ui | |||
@@ -12,5 +12,5 @@ | |||
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>472</width> | 14 | <width>460</width> |
15 | <height>341</height> | 15 | <height>341</height> |
16 | </rect> | 16 | </rect> |
@@ -44,4 +44,7 @@ | |||
44 | <name>layoutMargin</name> | 44 | <name>layoutMargin</name> |
45 | </property> | 45 | </property> |
46 | <property> | ||
47 | <name>layoutSpacing</name> | ||
48 | </property> | ||
46 | <vbox> | 49 | <vbox> |
47 | <property stdset="1"> | 50 | <property stdset="1"> |
@@ -51,5 +54,5 @@ | |||
51 | <property stdset="1"> | 54 | <property stdset="1"> |
52 | <name>spacing</name> | 55 | <name>spacing</name> |
53 | <number>6</number> | 56 | <number>4</number> |
54 | </property> | 57 | </property> |
55 | <widget> | 58 | <widget> |
@@ -67,4 +70,13 @@ | |||
67 | </property> | 70 | </property> |
68 | <property stdset="1"> | 71 | <property stdset="1"> |
72 | <name>font</name> | ||
73 | <font> | ||
74 | <family>helvetica</family> | ||
75 | <pointsize>18</pointsize> | ||
76 | <bold>1</bold> | ||
77 | <underline>1</underline> | ||
78 | </font> | ||
79 | </property> | ||
80 | <property stdset="1"> | ||
69 | <name>autoMask</name> | 81 | <name>autoMask</name> |
70 | <bool>true</bool> | 82 | <bool>true</bool> |
@@ -75,6 +87,10 @@ | |||
75 | </property> | 87 | </property> |
76 | <property stdset="1"> | 88 | <property stdset="1"> |
89 | <name>margin</name> | ||
90 | <number>1</number> | ||
91 | </property> | ||
92 | <property stdset="1"> | ||
77 | <name>text</name> | 93 | <name>text</name> |
78 | <string><center><h1>Welcome to OPIE</h1></center></string> | 94 | <string><center>Welcome to OPIE</center></string> |
79 | </property> | 95 | </property> |
80 | </widget> | 96 | </widget> |
diff --git a/core/opie-login/loginwindowimpl.cpp b/core/opie-login/loginwindowimpl.cpp index 3265b46..f24ebb3 100644 --- a/core/opie-login/loginwindowimpl.cpp +++ b/core/opie-login/loginwindowimpl.cpp | |||
@@ -21,4 +21,5 @@ | |||
21 | #include <unistd.h> | 21 | #include <unistd.h> |
22 | #include <stdlib.h> | 22 | #include <stdlib.h> |
23 | #include <signal.h> | ||
23 | 24 | ||
24 | #ifdef USEPAM | 25 | #ifdef USEPAM |
@@ -38,4 +39,5 @@ LoginWindowImpl::LoginWindowImpl ( ) : LoginWindow ( 0, "LOGIN-WINDOW", WStyle_C | |||
38 | QPopupMenu *pop = new QPopupMenu ( this ); | 39 | QPopupMenu *pop = new QPopupMenu ( this ); |
39 | pop-> insertItem ( tr( "Restart" ), this, SLOT( restart ( ))); | 40 | pop-> insertItem ( tr( "Restart" ), this, SLOT( restart ( ))); |
41 | pop-> insertItem ( tr( "Quit" ), this, SLOT( quit ( ))); | ||
40 | m_menu-> setPopup ( pop ); | 42 | m_menu-> setPopup ( pop ); |
41 | 43 | ||
@@ -58,5 +60,5 @@ LoginWindowImpl::LoginWindowImpl ( ) : LoginWindow ( 0, "LOGIN-WINDOW", WStyle_C | |||
58 | setBackgroundPixmap ( bgpix ); | 60 | setBackgroundPixmap ( bgpix ); |
59 | 61 | ||
60 | m_caption-> setText ( m_caption-> text ( ) + tr( "<center><h1><u>%1 %2</u></h1></center>" ). arg ( ODevice::inst ( )-> systemString ( )). arg ( ODevice::inst ( )-> systemVersionString ( ))); | 62 | m_caption-> setText ( m_caption-> text ( ) + tr( "<center>%1 %2</center>" ). arg ( ODevice::inst ( )-> systemString ( )). arg ( ODevice::inst ( )-> systemVersionString ( ))); |
61 | } | 63 | } |
62 | 64 | ||
@@ -68,7 +70,7 @@ void LoginWindowImpl::keyPressEvent ( QKeyEvent *e ) | |||
68 | { | 70 | { |
69 | switch ( e-> key ( )) { | 71 | switch ( e-> key ( )) { |
70 | case Key_F34: suspend ( ); | 72 | case HardKey_Suspend: suspend ( ); |
71 | break; | 73 | break; |
72 | case Key_F35: backlight ( ); | 74 | case HardKey_Backlight: backlight ( ); |
73 | break; | 75 | break; |
74 | default : e-> ignore ( ); | 76 | default : e-> ignore ( ); |
@@ -89,10 +91,10 @@ QStringList LoginWindowImpl::getAllUsers ( ) | |||
89 | QStringList sl; | 91 | QStringList sl; |
90 | 92 | ||
91 | while (( pwd = getpwent ( ))) { | 93 | while (( pwd = ::getpwent ( ))) { |
92 | if (( pwd-> pw_uid == 0 ) || ( pwd-> pw_uid >= 500 && pwd-> pw_uid < 65534 )) | 94 | if (( pwd-> pw_uid == 0 ) || ( pwd-> pw_uid >= 500 && pwd-> pw_uid < 65534 )) |
93 | sl << QString ( pwd-> pw_name ); | 95 | sl << QString ( pwd-> pw_name ); |
94 | } | 96 | } |
95 | 97 | ||
96 | endpwent ( ); | 98 | ::endpwent ( ); |
97 | 99 | ||
98 | return sl; | 100 | return sl; |
@@ -109,21 +111,23 @@ void LoginWindowImpl::restart ( ) | |||
109 | } | 111 | } |
110 | 112 | ||
111 | void LoginWindowImpl::suspend ( ) | 113 | void LoginWindowImpl::quit ( ) |
112 | { | 114 | { |
113 | system ( "apm -s" ); | 115 | qApp-> quit ( ); |
114 | usleep ( 1 * 1000 * 1000 ); | 116 | ::kill ( ::getppid ( ), SIGUSR1 ); |
117 | } | ||
118 | |||
119 | void LoginWindowImpl::suspend ( ) | ||
115 | { | 120 | { |
121 | ODevice::inst ( )-> suspend ( ); | ||
122 | |||
116 | QCopEnvelope e("QPE/System", "setBacklight(int)"); | 123 | QCopEnvelope e("QPE/System", "setBacklight(int)"); |
117 | e << -3; // Force on | 124 | e << -3; // Force on |
118 | } | 125 | } |
119 | } | ||
120 | 126 | ||
121 | void LoginWindowImpl::backlight ( ) | 127 | void LoginWindowImpl::backlight ( ) |
122 | { | 128 | { |
123 | { | ||
124 | QCopEnvelope e("QPE/System", "setBacklight(int)"); | 129 | QCopEnvelope e("QPE/System", "setBacklight(int)"); |
125 | e << -2; // toggle | 130 | e << -2; // toggle |
126 | } | 131 | } |
127 | } | ||
128 | 132 | ||
129 | #ifdef USEPAM | 133 | #ifdef USEPAM |
@@ -259,26 +263,16 @@ bool LoginWindowImpl::changeIdentity ( const char *user ) | |||
259 | 263 | ||
260 | fail |= ( pw == 0 ); | 264 | fail |= ( pw == 0 ); |
261 | printf ( "1 %d\n", fail ); | ||
262 | fail |= ( initgroups ( pw-> pw_name, pw-> pw_gid )); | 265 | fail |= ( initgroups ( pw-> pw_name, pw-> pw_gid )); |
263 | endgrent ( ); | 266 | endgrent ( ); |
264 | printf ( "2 %d\n", fail ); | ||
265 | fail |= ( setgid ( pw-> pw_gid )); | 267 | fail |= ( setgid ( pw-> pw_gid )); |
266 | printf ( "3 %d\n", fail ); | ||
267 | fail |= ( setuid ( pw-> pw_uid )); | 268 | fail |= ( setuid ( pw-> pw_uid )); |
268 | 269 | ||
269 | printf ( "4 %d\n", fail ); | ||
270 | fail |= ( chdir ( pw-> pw_dir ) && chdir ( "/" )); | 270 | fail |= ( chdir ( pw-> pw_dir ) && chdir ( "/" )); |
271 | 271 | ||
272 | printf ( "5 %d\n", fail ); | ||
273 | fail |= ( setenv ( "HOME", pw-> pw_dir, 1 )); | 272 | fail |= ( setenv ( "HOME", pw-> pw_dir, 1 )); |
274 | printf ( "6 %d\n", fail ); | ||
275 | fail |= ( setenv ( "SHELL", pw-> pw_shell, 1 )); | 273 | fail |= ( setenv ( "SHELL", pw-> pw_shell, 1 )); |
276 | printf ( "7 %d\n", fail ); | ||
277 | fail |= ( setenv ( "USER", pw-> pw_name, 1 )); | 274 | fail |= ( setenv ( "USER", pw-> pw_name, 1 )); |
278 | printf ( "8 %d\n", fail ); | ||
279 | fail |= ( setenv ( "LOGNAME", pw-> pw_name, 1 )); | 275 | fail |= ( setenv ( "LOGNAME", pw-> pw_name, 1 )); |
280 | printf ( "9 %d\n", fail ); | ||
281 | fail |= ( setenv ( "PATH", ( pw-> pw_uid ? DEFAULT_LOGIN_PATH : DEFAULT_ROOT_LOGIN_PATH ), 1 )); | 276 | fail |= ( setenv ( "PATH", ( pw-> pw_uid ? DEFAULT_LOGIN_PATH : DEFAULT_ROOT_LOGIN_PATH ), 1 )); |
282 | printf ( "10 %d\n", fail ); | ||
283 | 277 | ||
284 | return !fail; | 278 | return !fail; |
@@ -287,6 +281,6 @@ bool LoginWindowImpl::changeIdentity ( const char *user ) | |||
287 | void LoginWindowImpl::login ( ) | 281 | void LoginWindowImpl::login ( ) |
288 | { | 282 | { |
289 | const char *user = strdup ( m_user-> currentText ( ). local8Bit ( )); | 283 | const char *user = ::strdup ( m_user-> currentText ( ). local8Bit ( )); |
290 | const char *pass = strdup ( m_password-> text ( ). local8Bit ( )); | 284 | const char *pass = ::strdup ( m_password-> text ( ). local8Bit ( )); |
291 | bool ok; | 285 | bool ok; |
292 | 286 | ||
@@ -304,10 +298,16 @@ void LoginWindowImpl::login ( ) | |||
304 | if ( ok ) { | 298 | if ( ok ) { |
305 | if ( changeIdentity ( user )) { | 299 | if ( changeIdentity ( user )) { |
306 | QString opie = getenv ( "OPIEDIR" ); | 300 | char *opie = ::getenv ( "OPIEDIR" ); |
307 | opie += "/bin/qpe"; | 301 | char *arg = new char [::strlen ( opie ) + 8 + 1]; |
302 | |||
303 | ::strcpy ( arg, opie ); | ||
304 | ::strcat ( arg, "/bin/qpe" ); | ||
305 | |||
306 | // start qpe via a login shell | ||
307 | ::execl ( "/bin/sh", "-sh", "-c", arg, 0 ); | ||
308 | 308 | ||
309 | execl ( opie. latin1 ( ), "qpe", 0 ); | 309 | QMessageBox::critical ( this, tr( "Failure" ), tr( "Could not start OPIE\n(%1)." ). arg ( arg )); |
310 | delete [] arg; | ||
310 | 311 | ||
311 | QMessageBox::critical ( this, tr( "Failure" ), tr( "Could not start OPIE." )); | ||
312 | restart ( ); | 312 | restart ( ); |
313 | } | 313 | } |
diff --git a/core/opie-login/loginwindowimpl.h b/core/opie-login/loginwindowimpl.h index 16c42e6..2e2ba0d 100644 --- a/core/opie-login/loginwindowimpl.h +++ b/core/opie-login/loginwindowimpl.h | |||
@@ -15,4 +15,5 @@ public: | |||
15 | protected slots: | 15 | protected slots: |
16 | void restart ( ); | 16 | void restart ( ); |
17 | void quit ( ); | ||
17 | void showIM ( ); | 18 | void showIM ( ); |
18 | void suspend ( ); | 19 | void suspend ( ); |
diff --git a/core/opie-login/main.cpp b/core/opie-login/main.cpp index 44d6f8d..718009a 100644 --- a/core/opie-login/main.cpp +++ b/core/opie-login/main.cpp | |||
@@ -7,7 +7,10 @@ | |||
7 | #include <stdio.h> | 7 | #include <stdio.h> |
8 | #include <stdlib.h> | 8 | #include <stdlib.h> |
9 | #include <signal.h> | ||
9 | 10 | ||
10 | #include <qpe/qpeapplication.h> | 11 | #include <qpe/qpeapplication.h> |
11 | #include <qpe/qcopenvelope_qws.h> | 12 | #include <qpe/qcopenvelope_qws.h> |
13 | #include <qpe/qpestyle.h> | ||
14 | #include <qpe/power.h> | ||
12 | 15 | ||
13 | #include <opie/odevice.h> | 16 | #include <opie/odevice.h> |
@@ -20,29 +23,35 @@ | |||
20 | 23 | ||
21 | int login_main ( int argc, char **argv ); | 24 | int login_main ( int argc, char **argv ); |
25 | void sigusr1 ( int sig ); | ||
26 | void exit_closelog ( ); | ||
27 | |||
22 | 28 | ||
23 | 29 | ||
24 | int main ( int argc, char **argv ) | 30 | int main ( int argc, char **argv ) |
25 | { | 31 | { |
26 | if ( geteuid ( ) != 0 ) { | 32 | if ( ::geteuid ( ) != 0 ) { |
27 | fprintf ( stderr, "%s can only be executed by root. (or chmod +s)", argv [0] ); | 33 | ::fprintf ( stderr, "%s can only be executed by root. (or chmod +s)", argv [0] ); |
28 | return 1; | 34 | return 1; |
29 | } | 35 | } |
30 | 36 | ||
31 | //struct rlimit rl; | 37 | //struct rlimit rl; |
32 | //getrlimit ( RLIMIT_NOFILE, &rl ); | 38 | //::getrlimit ( RLIMIT_NOFILE, &rl ); |
33 | 39 | ||
34 | //for ( unsigned int i = 0; i < rl. rlim_cur; i++ ) | 40 | //for ( unsigned int i = 0; i < rl. rlim_cur; i++ ) |
35 | // close ( i ); | 41 | // ::close ( i ); |
42 | |||
43 | ::setpgid ( 0, 0 ); | ||
44 | ::setsid ( ); | ||
36 | 45 | ||
37 | setpgid ( 0, 0 ); | 46 | ::signal ( SIGUSR1, sigusr1 ); |
38 | setsid ( ); | ||
39 | 47 | ||
40 | openlog ( "opie-login", LOG_CONS, LOG_AUTHPRIV ); | 48 | ::openlog ( "opie-login", LOG_CONS, LOG_AUTHPRIV ); |
49 | ::atexit ( exit_closelog ); | ||
41 | 50 | ||
42 | while ( true ) { | 51 | while ( true ) { |
43 | pid_t child = fork ( ); | 52 | pid_t child = ::fork ( ); |
44 | 53 | ||
45 | if ( child < 0 ) { | 54 | if ( child < 0 ) { |
46 | syslog ( LOG_ERR, "Could not fork process" ); | 55 | ::syslog ( LOG_ERR, "Could not fork process" ); |
47 | break; | 56 | break; |
48 | 57 | ||
@@ -51,99 +60,121 @@ int main ( int argc, char **argv ) | |||
51 | int status = 0; | 60 | int status = 0; |
52 | 61 | ||
53 | while ( waitpid ( child, &status, 0 ) < 0 ) { } | 62 | while ( ::waitpid ( child, &status, 0 ) < 0 ) { } |
54 | } | 63 | } |
55 | else { | 64 | else { |
56 | exit ( login_main ( argc, argv )); | 65 | ::exit ( login_main ( argc, argv )); |
66 | } | ||
57 | } | 67 | } |
68 | return 0; | ||
69 | } | ||
70 | |||
71 | void sigusr1 ( int /*sig*/ ) | ||
72 | { | ||
73 | ::exit ( 0 ); | ||
58 | } | 74 | } |
59 | closelog ( ); | 75 | |
76 | void exit_closelog ( ) | ||
77 | { | ||
78 | ::closelog ( ); | ||
60 | } | 79 | } |
61 | 80 | ||
62 | 81 | ||
63 | class ModelKeyFilter : public QObject, public QWSServer::KeyboardFilter | 82 | class LoginScreenSaver : public QWSScreenSaver |
64 | { | 83 | { |
65 | public: | 84 | public: |
66 | ModelKeyFilter ( ) : QObject ( 0, "MODEL_KEY_FILTER" ) | 85 | LoginScreenSaver ( ) |
67 | { | 86 | { |
68 | bool doinst = false; | 87 | m_lcd_status = true; |
69 | 88 | ||
70 | m_model = ODevice::inst ( )-> model ( ); | 89 | m_backlight_bright = -1; |
71 | m_power_timer = 0; | 90 | m_backlight_forcedoff = false; |
72 | 91 | ||
73 | switch ( m_model ) { | 92 | // Make sure the LCD is in fact on, (if opie was killed while the LCD is off it would still be off) |
74 | case OMODEL_iPAQ_H31xx: | 93 | ODevice::inst ( ) -> setDisplayStatus ( true ); |
75 | case OMODEL_iPAQ_H36xx: | ||
76 | case OMODEL_iPAQ_H37xx: | ||
77 | case OMODEL_iPAQ_H38xx: doinst = true; | ||
78 | break; | ||
79 | default : break; | ||
80 | } | ||
81 | if ( doinst ) | ||
82 | QWSServer::setKeyboardFilter ( this ); | ||
83 | } | 94 | } |
84 | 95 | void restore() | |
85 | virtual bool filter ( int /*unicode*/, int keycode, int modifiers, bool isPress, bool autoRepeat ) | ||
86 | { | 96 | { |
87 | bool kill = false; | 97 | if ( !m_lcd_status ) // We must have turned it off |
88 | 98 | ODevice::inst ( ) -> setDisplayStatus ( true ); | |
89 | // Rotate cursor keys 180° | ||
90 | switch ( m_model ) { | ||
91 | case OMODEL_iPAQ_H31xx: | ||
92 | case OMODEL_iPAQ_H38xx: { | ||
93 | int newkeycode = keycode; | ||
94 | 99 | ||
95 | switch ( keycode ) { | 100 | setBacklight ( -1 ); |
96 | case Key_Left : newkeycode = Key_Right; break; | ||
97 | case Key_Right: newkeycode = Key_Left; break; | ||
98 | case Key_Up : newkeycode = Key_Down; break; | ||
99 | case Key_Down : newkeycode = Key_Up; break; | ||
100 | } | 101 | } |
101 | if ( newkeycode != keycode ) { | 102 | bool save( int level ) |
102 | QWSServer::sendKeyEvent ( -1, newkeycode, modifiers, isPress, autoRepeat ); | 103 | { |
103 | kill = true; | 104 | switch ( level ) { |
105 | case 0: | ||
106 | if ( backlight() > 1 ) | ||
107 | setBacklight( 1 ); // lowest non-off | ||
108 | return true; | ||
109 | break; | ||
110 | case 1: | ||
111 | setBacklight( 0 ); // off | ||
112 | return true; | ||
113 | break; | ||
114 | case 2: | ||
115 | // We're going to suspend the whole machine | ||
116 | if ( PowerStatusManager::readStatus().acStatus() != PowerStatus::Online ) { | ||
117 | QWSServer::sendKeyEvent( 0xffff, Qt::Key_F34, FALSE, TRUE, FALSE ); | ||
118 | return true; | ||
104 | } | 119 | } |
105 | break; | 120 | break; |
106 | } | 121 | } |
107 | default: break; | 122 | return false; |
108 | } | 123 | } |
109 | 124 | ||
110 | // map Power Button short/long press to F34/F35 | 125 | private: |
111 | switch ( m_model ) { | 126 | public: |
112 | case OMODEL_iPAQ_H31xx: | 127 | void setIntervals( int i1 = 30, int i2 = 20, int i3 = 60 ) |
113 | case OMODEL_iPAQ_H36xx: | 128 | { |
114 | case OMODEL_iPAQ_H37xx: | 129 | int v [4]; |
115 | case OMODEL_iPAQ_H38xx: { | 130 | |
116 | if ( keycode == Key_SysReq ) { | 131 | v [ 0 ] = QMAX( 1000 * i1, 100 ); |
117 | if ( isPress ) { | 132 | v [ 1 ] = QMAX( 1000 * i2, 100 ); |
118 | m_power_timer = startTimer ( 500 ); | 133 | v [ 2 ] = QMAX( 1000 * i3, 100 ); |
119 | } | 134 | v [ 3 ] = 0; |
120 | else if ( m_power_timer ) { | 135 | |
121 | killTimer ( m_power_timer ); | 136 | if ( !i1 && !i2 && !i3 ) |
122 | m_power_timer = 0; | 137 | QWSServer::setScreenSaverInterval ( 0 ); |
123 | QWSServer::sendKeyEvent ( -1, Key_F34, 0, true, false ); | 138 | else |
124 | QWSServer::sendKeyEvent ( -1, Key_F34, 0, false, false ); | 139 | QWSServer::setScreenSaverIntervals ( v ); |
125 | } | ||
126 | kill = true; | ||
127 | } | 140 | } |
128 | break; | 141 | |
142 | int backlight ( ) | ||
143 | { | ||
144 | if ( m_backlight_bright == -1 ) | ||
145 | m_backlight_bright = 255; | ||
146 | |||
147 | return m_backlight_bright; | ||
129 | } | 148 | } |
130 | default: break; | 149 | |
150 | void setBacklight ( int bright ) | ||
151 | { | ||
152 | if ( bright == -3 ) { | ||
153 | // Forced on | ||
154 | m_backlight_forcedoff = false; | ||
155 | bright = -1; | ||
131 | } | 156 | } |
132 | return kill; | 157 | if ( m_backlight_forcedoff && bright != -2 ) |
158 | return ; | ||
159 | if ( bright == -2 ) { | ||
160 | // Toggle between off and on | ||
161 | bright = m_backlight_bright ? 0 : -1; | ||
162 | m_backlight_forcedoff = !bright; | ||
133 | } | 163 | } |
134 | 164 | ||
135 | virtual void timerEvent ( QTimerEvent * ) | 165 | m_backlight_bright = bright; |
136 | { | 166 | |
137 | killTimer ( m_power_timer ); | 167 | bright = backlight ( ); |
138 | m_power_timer = 0; | 168 | ODevice::inst ( ) -> setDisplayBrightness ( bright ); |
139 | QWSServer::sendKeyEvent ( -1, Key_F35, 0, true, false ); | 169 | |
140 | QWSServer::sendKeyEvent ( -1, Key_F35, 0, false, false ); | 170 | m_backlight_bright = bright; |
141 | } | 171 | } |
142 | 172 | ||
143 | private: | 173 | private: |
144 | OModel m_model; | 174 | bool m_lcd_status; |
145 | int m_power_timer; | ||
146 | }; | ||
147 | 175 | ||
176 | int m_backlight_bright; | ||
177 | bool m_backlight_forcedoff; | ||
178 | }; | ||
148 | 179 | ||
149 | 180 | ||
@@ -154,5 +185,8 @@ int login_main ( int argc, char **argv ) | |||
154 | QPEApplication app ( argc, argv, QApplication::GuiServer ); | 185 | QPEApplication app ( argc, argv, QApplication::GuiServer ); |
155 | 186 | ||
156 | (void) new ModelKeyFilter ( ); | 187 | app. setFont ( QFont ( "Helvetica", 10 )); |
188 | app. setStyle ( new QPEStyle ( )); | ||
189 | |||
190 | ODevice::inst ( )-> setSoftSuspend ( true ); | ||
157 | 191 | ||
158 | { | 192 | { |
@@ -170,4 +204,11 @@ int login_main ( int argc, char **argv ) | |||
170 | #endif | 204 | #endif |
171 | 205 | ||
206 | |||
207 | LoginScreenSaver *saver = new LoginScreenSaver; | ||
208 | |||
209 | saver-> setIntervals ( ); | ||
210 | QWSServer::setScreenSaver ( saver ); | ||
211 | |||
212 | |||
172 | LoginWindowImpl *lw = new LoginWindowImpl ( ); | 213 | LoginWindowImpl *lw = new LoginWindowImpl ( ); |
173 | app. setMainWidget ( lw ); | 214 | app. setMainWidget ( lw ); |
@@ -175,5 +216,9 @@ int login_main ( int argc, char **argv ) | |||
175 | lw-> show ( ); | 216 | lw-> show ( ); |
176 | 217 | ||
177 | return app. exec ( ); | 218 | int rc = app. exec ( ); |
219 | |||
220 | ODevice::inst ( )-> setSoftSuspend ( false ); | ||
221 | |||
222 | return rc; | ||
178 | } | 223 | } |
179 | 224 | ||