summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/desktop.cpp28
-rw-r--r--library/password.cpp24
-rw-r--r--library/password.h1
3 files changed, 43 insertions, 10 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index 0e60839..d74b745 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -183,3 +183,3 @@ public:
- setBacklight ( -3 );
+ setBacklight ( -1 );
}
@@ -334,7 +334,9 @@ void DesktopApplication::switchLCD ( bool on )
if ( dapp-> m_screensaver ) {
- if ( on )
- dapp-> m_screensaver-> restore ( ); //setBacklight ( on ? -3 : -1 );
- else
- dapp-> m_screensaver-> save ( 1 );
-
+ if ( on ) {
+ dapp-> m_screensaver-> setDisplayState ( true );
+ dapp-> m_screensaver-> setBacklight ( -3 );
+ }
+ else {
+ dapp-> m_screensaver-> setDisplayState ( false );
+ }
}
@@ -872,6 +874,16 @@ void Desktop::togglePower()
+#ifdef QWS
+ if ( Password::needToAuthenticate ( true ) && qt_screen ) {
+ // Should use a big black window instead.
+ // But this would not show up fast enough
+ QGfx *g = qt_screen-> screenGfx ( );
+ g-> fillRect ( 0, 0, qt_screen-> width ( ), qt_screen-> height ( ));
+ delete g;
+ }
+#endif
+
ODevice::inst ( ) -> suspend ( );
- QWSServer::screenSaverActivate ( false );
DesktopApplication::switchLCD ( true ); // force LCD on without slow qcop call
+ QWSServer::screenSaverActivate ( false );
@@ -882,3 +894,3 @@ void Desktop::togglePower()
if ( wasloggedin )
- login( TRUE );
+ login ( true );
diff --git a/library/password.cpp b/library/password.cpp
index 4b22b65..6d126c4 100644
--- a/library/password.cpp
+++ b/library/password.cpp
@@ -29,3 +29,3 @@
#include <qfile.h>
-#include <qwindowsystem_qws.h>
+//#include <qwindowsystem_qws.h>
@@ -287,2 +287,21 @@ QString Password::getPassword( const QString& prompt )
/*!
+ Return if a prompt for the user's passcode is needed.
+
+ If \a at_poweron is TRUE, the dialog is only used if the user's
+ preference request it at poweron
+
+ Opie extension to speed up suspend/resume.
+*/
+
+bool Password::needToAuthenticate(bool at_poweron)
+{
+ Config cfg("Security");
+ cfg.setGroup("Passcode");
+ QString passcode = cfg.readEntry("passcode");
+
+ return ( !passcode.isEmpty()
+ && (!at_poweron || cfg.readNumEntry("passcode_poweron",0)) );
+}
+
+/*!
Prompt, fullscreen, for the user's passcode until they get it right.
@@ -326,3 +345,4 @@ void Password::authenticate(bool at_poweron)
// refresh screen #### should probably be in caller
- // Not needed (we took away the screen blacking)
+ // Not needed (we took away the screen blacking) TT
+ // Not needed (we have intelligent screen blacking) sandman
//if ( qwsServer )
diff --git a/library/password.h b/library/password.h
index a3a3e45..a2f2c3c 100644
--- a/library/password.h
+++ b/library/password.h
@@ -27,2 +27,3 @@ class Password
public:
+ static bool needToAuthenticate(bool atpoweron=FALSE); // Opie extension to speed up suspend/resume (sandman)
static void authenticate(bool atpoweron=FALSE);