author | sandman <sandman> | 2002-10-17 00:39:31 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-10-17 00:39:31 (UTC) |
commit | 259d10f40405fd77ba0a8947782f716be94da3a5 (patch) (unidiff) | |
tree | 636cb3a899d27a8fe41f377fabc5bd170a74c6dc /library | |
parent | 5d28c61d84da1814d356540b557bbfe026da98aa (diff) | |
download | opie-259d10f40405fd77ba0a8947782f716be94da3a5.zip opie-259d10f40405fd77ba0a8947782f716be94da3a5.tar.gz opie-259d10f40405fd77ba0a8947782f716be94da3a5.tar.bz2 |
- fix for bug #292 (Improper behaviour of frontlight disabling)
- fix for bug #199 (Desktop visible on resume before password dialog
appears)
-rw-r--r-- | library/password.cpp | 24 | ||||
-rw-r--r-- | library/password.h | 1 |
2 files changed, 23 insertions, 2 deletions
diff --git a/library/password.cpp b/library/password.cpp index 4b22b65..6d126c4 100644 --- a/library/password.cpp +++ b/library/password.cpp | |||
@@ -26,9 +26,9 @@ | |||
26 | #include <qtextview.h> | 26 | #include <qtextview.h> |
27 | #include <qstring.h> | 27 | #include <qstring.h> |
28 | #include <qapplication.h> | 28 | #include <qapplication.h> |
29 | #include <qfile.h> | 29 | #include <qfile.h> |
30 | #include <qwindowsystem_qws.h> | 30 | //#include <qwindowsystem_qws.h> |
31 | 31 | ||
32 | #include <qdialog.h> | 32 | #include <qdialog.h> |
33 | 33 | ||
34 | #include <unistd.h> //for sleep | 34 | #include <unistd.h> //for sleep |
@@ -284,8 +284,27 @@ QString Password::getPassword( const QString& prompt ) | |||
284 | } | 284 | } |
285 | 285 | ||
286 | 286 | ||
287 | /*! | 287 | /*! |
288 | Return if a prompt for the user's passcode is needed. | ||
289 | |||
290 | If \a at_poweron is TRUE, the dialog is only used if the user's | ||
291 | preference request it at poweron | ||
292 | |||
293 | Opie extension to speed up suspend/resume. | ||
294 | */ | ||
295 | |||
296 | bool Password::needToAuthenticate(bool at_poweron) | ||
297 | { | ||
298 | Config cfg("Security"); | ||
299 | cfg.setGroup("Passcode"); | ||
300 | QString passcode = cfg.readEntry("passcode"); | ||
301 | |||
302 | return ( !passcode.isEmpty() | ||
303 | && (!at_poweron || cfg.readNumEntry("passcode_poweron",0)) ); | ||
304 | } | ||
305 | |||
306 | /*! | ||
288 | Prompt, fullscreen, for the user's passcode until they get it right. | 307 | Prompt, fullscreen, for the user's passcode until they get it right. |
289 | 308 | ||
290 | If \a at_poweron is TRUE, the dialog is only used if the user's | 309 | If \a at_poweron is TRUE, the dialog is only used if the user's |
291 | preference request it at poweron; either way, the screen is always repainted | 310 | preference request it at poweron; either way, the screen is always repainted |
@@ -323,9 +342,10 @@ void Password::authenticate(bool at_poweron) | |||
323 | pd.exec(); | 342 | pd.exec(); |
324 | } | 343 | } |
325 | } else if ( at_poweron ) { | 344 | } else if ( at_poweron ) { |
326 | // refresh screen #### should probably be in caller | 345 | // refresh screen #### should probably be in caller |
327 | // Not needed (we took away the screen blacking) | 346 | // Not needed (we took away the screen blacking) TT |
347 | // Not needed (we have intelligent screen blacking) sandman | ||
328 | //if ( qwsServer ) | 348 | //if ( qwsServer ) |
329 | //qwsServer->refresh(); | 349 | //qwsServer->refresh(); |
330 | } | 350 | } |
331 | } | 351 | } |
diff --git a/library/password.h b/library/password.h index a3a3e45..a2f2c3c 100644 --- a/library/password.h +++ b/library/password.h | |||
@@ -24,8 +24,9 @@ | |||
24 | 24 | ||
25 | class Password | 25 | class Password |
26 | { | 26 | { |
27 | public: | 27 | public: |
28 | static bool needToAuthenticate(bool atpoweron=FALSE); // Opie extension to speed up suspend/resume (sandman) | ||
28 | static void authenticate(bool atpoweron=FALSE); | 29 | static void authenticate(bool atpoweron=FALSE); |
29 | static QString getPassword( const QString& prompt ); | 30 | static QString getPassword( const QString& prompt ); |
30 | }; | 31 | }; |
31 | 32 | ||