author | clem <clem> | 2004-10-08 22:50:28 (UTC) |
---|---|---|
committer | clem <clem> | 2004-10-08 22:50:28 (UTC) |
commit | 2f29d0ec4bb2355f193d744c890add203bd6f2b2 (patch) (unidiff) | |
tree | a703b00b673b9be036415393b53d9c95a5bb87cd /core/launcher | |
parent | dec031cc21181d70e0c806bcf6c228044f7df90b (diff) | |
download | opie-2f29d0ec4bb2355f193d744c890add203bd6f2b2.zip opie-2f29d0ec4bb2355f193d744c890add203bd6f2b2.tar.gz opie-2f29d0ec4bb2355f193d744c890add203bd6f2b2.tar.bz2 |
Big commit thanks to a little feature request :-) We now have an O-menu applet
to lock the PDA immediately, and the internal way to ask for an authentication
(on resume, on start up, on demand or for a simple test) is much cleaner:
it's through MultiauthPassword(int lockMode) (instead of the old bool at_poweron)
-rw-r--r-- | core/launcher/serverapp.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/launcher/serverapp.cpp b/core/launcher/serverapp.cpp index dc1f2c7..e541d10 100644 --- a/core/launcher/serverapp.cpp +++ b/core/launcher/serverapp.cpp | |||
@@ -489,49 +489,50 @@ void ServerApplication::launcherMessage( const QCString & msg, const QByteArray | |||
489 | int keycode, press, autoRepeat; | 489 | int keycode, press, autoRepeat; |
490 | stream >> keycode >> press >> autoRepeat; | 490 | stream >> keycode >> press >> autoRepeat; |
491 | 491 | ||
492 | kf->checkButtonAction ( true, keycode, press, autoRepeat ); | 492 | kf->checkButtonAction ( true, keycode, press, autoRepeat ); |
493 | } | 493 | } |
494 | else if ( msg == "keyRegister(int,QCString,QCString)" ) { | 494 | else if ( msg == "keyRegister(int,QCString,QCString)" ) { |
495 | int k; | 495 | int k; |
496 | QCString c, m; | 496 | QCString c, m; |
497 | stream >> k >> c >> m; | 497 | stream >> k >> c >> m; |
498 | 498 | ||
499 | kf -> registerKey( QCopKeyRegister(k, c, m) ); | 499 | kf -> registerKey( QCopKeyRegister(k, c, m) ); |
500 | } | 500 | } |
501 | } | 501 | } |
502 | 502 | ||
503 | 503 | ||
504 | bool ServerApplication::screenLocked() | 504 | bool ServerApplication::screenLocked() |
505 | { | 505 | { |
506 | return loggedin == 0; | 506 | return loggedin == 0; |
507 | } | 507 | } |
508 | 508 | ||
509 | void ServerApplication::login(bool at_poweron) | 509 | void ServerApplication::login(bool at_poweron) |
510 | { | 510 | { |
511 | if ( !loggedin ) { | 511 | if ( !loggedin ) { |
512 | Global::terminateBuiltin("calibrate"); // No tr | 512 | Global::terminateBuiltin("calibrate"); // No tr |
513 | Opie::Security::MultiauthPassword::authenticate(at_poweron); | 513 | int lockMode = at_poweron ? Opie::Security::IfPowerOn : Opie::Security::IfResume; |
514 | Opie::Security::MultiauthPassword::authenticate(lockMode); | ||
514 | loggedin=1; | 515 | loggedin=1; |
515 | #ifndef QT_NO_COP | 516 | #ifndef QT_NO_COP |
516 | QCopEnvelope e( "QPE/Desktop", "unlocked()" ); | 517 | QCopEnvelope e( "QPE/Desktop", "unlocked()" ); |
517 | #endif | 518 | #endif |
518 | } | 519 | } |
519 | } | 520 | } |
520 | 521 | ||
521 | #if defined(QPE_HAVE_TOGGLELIGHT) | 522 | #if defined(QPE_HAVE_TOGGLELIGHT) |
522 | #include <qtopia/config.h> | 523 | #include <qtopia/config.h> |
523 | 524 | ||
524 | #include <sys/ioctl.h> | 525 | #include <sys/ioctl.h> |
525 | #include <sys/types.h> | 526 | #include <sys/types.h> |
526 | #include <fcntl.h> | 527 | #include <fcntl.h> |
527 | #include <unistd.h> | 528 | #include <unistd.h> |
528 | #include <errno.h> | 529 | #include <errno.h> |
529 | #include <linux/ioctl.h> | 530 | #include <linux/ioctl.h> |
530 | #include <time.h> | 531 | #include <time.h> |
531 | #endif | 532 | #endif |
532 | 533 | ||
533 | namespace { | 534 | namespace { |
534 | void execAutoStart(const QDateTime& suspendTime ) { | 535 | void execAutoStart(const QDateTime& suspendTime ) { |
535 | QString appName; | 536 | QString appName; |
536 | int delay; | 537 | int delay; |
537 | QDateTime now = QDateTime::currentDateTime(); | 538 | QDateTime now = QDateTime::currentDateTime(); |