summaryrefslogtreecommitdiff
authorsandman <sandman>2002-10-06 22:19:48 (UTC)
committer sandman <sandman>2002-10-06 22:19:48 (UTC)
commit685c08f1c48813f9d222446f0516b8e20635607e (patch) (unidiff)
tree52792fd22ebaa26ee82ac500c0250d6ffea941f8
parenta60fbe6f441b906489984b0dbc239259adacdcbc (diff)
downloadopie-685c08f1c48813f9d222446f0516b8e20635607e.zip
opie-685c08f1c48813f9d222446f0516b8e20635607e.tar.gz
opie-685c08f1c48813f9d222446f0516b8e20635607e.tar.bz2
- password line-edit now gets focus on user change
- the "OPIE - please wait" logo is displayed while the launcher is loading
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/opie-login/loginwindow.ui6
-rw-r--r--core/opie-login/loginwindowimpl.cpp19
2 files changed, 25 insertions, 0 deletions
diff --git a/core/opie-login/loginwindow.ui b/core/opie-login/loginwindow.ui
index edd0819..5a35c8d 100644
--- a/core/opie-login/loginwindow.ui
+++ b/core/opie-login/loginwindow.ui
@@ -396,17 +396,23 @@
396 <connection> 396 <connection>
397 <sender>m_password</sender> 397 <sender>m_password</sender>
398 <signal>returnPressed()</signal> 398 <signal>returnPressed()</signal>
399 <receiver>m_login</receiver> 399 <receiver>m_login</receiver>
400 <slot>animateClick()</slot> 400 <slot>animateClick()</slot>
401 </connection> 401 </connection>
402 <connection> 402 <connection>
403 <sender>m_login</sender> 403 <sender>m_login</sender>
404 <signal>clicked()</signal> 404 <signal>clicked()</signal>
405 <receiver>LoginWindow</receiver> 405 <receiver>LoginWindow</receiver>
406 <slot>login()</slot> 406 <slot>login()</slot>
407 </connection> 407 </connection>
408 <connection>
409 <sender>m_user</sender>
410 <signal>activated(int)</signal>
411 <receiver>m_password</receiver>
412 <slot>setFocus()</slot>
413 </connection>
408 <slot access="public">login()</slot> 414 <slot access="public">login()</slot>
409 <slot access="public">suspend()</slot> 415 <slot access="public">suspend()</slot>
410 <slot access="public">toggleEchoMode(bool)</slot> 416 <slot access="public">toggleEchoMode(bool)</slot>
411</connections> 417</connections>
412</UI> 418</UI>
diff --git a/core/opie-login/loginwindowimpl.cpp b/core/opie-login/loginwindowimpl.cpp
index 63baaa6..c59338f 100644
--- a/core/opie-login/loginwindowimpl.cpp
+++ b/core/opie-login/loginwindowimpl.cpp
@@ -1,24 +1,26 @@
1#include <qapplication.h> 1#include <qapplication.h>
2#include <qpushbutton.h> 2#include <qpushbutton.h>
3#include <qlayout.h> 3#include <qlayout.h>
4#include <qframe.h> 4#include <qframe.h>
5#include <qlineedit.h> 5#include <qlineedit.h>
6#include <qtimer.h> 6#include <qtimer.h>
7#include <qcombobox.h> 7#include <qcombobox.h>
8#include <qpixmap.h> 8#include <qpixmap.h>
9#include <qlabel.h> 9#include <qlabel.h>
10#include <qpopupmenu.h> 10#include <qpopupmenu.h>
11#include <qmessagebox.h> 11#include <qmessagebox.h>
12#include <qimage.h>
12 13
14#include <qpe/resource.h>
13#include <qpe/qcopenvelope_qws.h> 15#include <qpe/qcopenvelope_qws.h>
14 16
15#include <opie/odevice.h> 17#include <opie/odevice.h>
16 18
17#include <stdio.h> 19#include <stdio.h>
18 20
19#include <pwd.h> 21#include <pwd.h>
20#include <grp.h> 22#include <grp.h>
21#include <unistd.h> 23#include <unistd.h>
22#include <stdlib.h> 24#include <stdlib.h>
23#include <signal.h> 25#include <signal.h>
24 26
@@ -79,24 +81,25 @@ void LoginWindowImpl::keyPressEvent ( QKeyEvent *e )
79 default: e-> ignore ( ); 81 default: e-> ignore ( );
80 break; 82 break;
81 } 83 }
82 LoginWindow::keyPressEvent ( e ); 84 LoginWindow::keyPressEvent ( e );
83} 85}
84 86
85 87
86void LoginWindowImpl::toggleEchoMode ( bool t ) 88void LoginWindowImpl::toggleEchoMode ( bool t )
87{ 89{
88 m_password-> setEchoMode ( t ? QLineEdit::Normal : QLineEdit::Password ); 90 m_password-> setEchoMode ( t ? QLineEdit::Normal : QLineEdit::Password );
89} 91}
90 92
93
91QStringList LoginWindowImpl::getAllUsers ( ) 94QStringList LoginWindowImpl::getAllUsers ( )
92{ 95{
93 struct passwd *pwd; 96 struct passwd *pwd;
94 QStringList sl; 97 QStringList sl;
95 98
96 while (( pwd = ::getpwent ( ))) { 99 while (( pwd = ::getpwent ( ))) {
97 if (( pwd-> pw_uid == 0 ) || ( pwd-> pw_uid >= 500 && pwd-> pw_uid < 65534 )) 100 if (( pwd-> pw_uid == 0 ) || ( pwd-> pw_uid >= 500 && pwd-> pw_uid < 65534 ))
98 sl << QString ( pwd-> pw_name ); 101 sl << QString ( pwd-> pw_name );
99 } 102 }
100 103
101 ::endpwent ( ); 104 ::endpwent ( );
102 105
@@ -291,33 +294,49 @@ void LoginWindowImpl::login ( )
291 return; 294 return;
292 if ( !pass ) 295 if ( !pass )
293 pass = ""; 296 pass = "";
294 297
295#if defined( USEPAM ) 298#if defined( USEPAM )
296 ok = pwcheck_PAM ( user, pass ); 299 ok = pwcheck_PAM ( user, pass );
297#else 300#else
298 ok = pwcheck_Unix ( user, pass ); 301 ok = pwcheck_Unix ( user, pass );
299#endif 302#endif
300 303
301 if ( ok ) { 304 if ( ok ) {
302 if ( changeIdentity ( user )) { 305 if ( changeIdentity ( user )) {
306 // Draw a big wait icon, the image can be altered in later revisions
307 QWidget *d = QApplication::desktop ( );
308 m_input-> hideInputMethod ( );
309
310 QImage img = Resource::loadImage( "launcher/new_wait" );
311 QPixmap pix;
312 pix. convertFromImage ( img );
313 QLabel *w = new QLabel ( 0, "wait hack!", WStyle_Customize | WStyle_NoBorder | WStyle_Tool );
314 w-> setPixmap ( pix );
315 w-> setAlignment ( AlignCenter );
316 w-> showMaximized ( );
317 qApp-> processEvents ( );
318
303 char *opie = ::getenv ( "OPIEDIR" ); 319 char *opie = ::getenv ( "OPIEDIR" );
304 char *arg = new char [::strlen ( opie ) + 8 + 1]; 320 char *arg = new char [::strlen ( opie ) + 8 + 1];
305 321
306 ::strcpy ( arg, opie ); 322 ::strcpy ( arg, opie );
307 ::strcat ( arg, "/bin/qpe" ); 323 ::strcat ( arg, "/bin/qpe" );
308 324
309 // start qpe via a login shell 325 // start qpe via a login shell
310 ::execl ( "/bin/sh", "-sh", "-c", arg, 0 ); 326 ::execl ( "/bin/sh", "-sh", "-c", arg, 0 );
311 327
328 w-> hide ( );
329 delete w;
330
312 QMessageBox::critical ( this, tr( "Failure" ), tr( "Could not start OPIE\n(%1)." ). arg ( arg )); 331 QMessageBox::critical ( this, tr( "Failure" ), tr( "Could not start OPIE\n(%1)." ). arg ( arg ));
313 delete [] arg; 332 delete [] arg;
314 333
315 restart ( ); 334 restart ( );
316 } 335 }
317 else { 336 else {
318 QMessageBox::critical ( this, tr( "Failure" ), tr( "Could not switch to new user identity" )); 337 QMessageBox::critical ( this, tr( "Failure" ), tr( "Could not switch to new user identity" ));
319 restart ( ); 338 restart ( );
320 } 339 }
321 } 340 }
322 else { 341 else {
323 QMessageBox::warning ( this, tr( "Wrong password" ), tr( "The given password is incorrect." )); 342 QMessageBox::warning ( this, tr( "Wrong password" ), tr( "The given password is incorrect." ));