summaryrefslogtreecommitdiffstats
path: root/kdesktop/lockeng.cc
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-09-15 19:17:28 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-09-15 19:17:28 +0000
commitff7322912780843dfb3bce1d720452aeed89592e (patch)
tree2b72956a83fb45a46c7d5cb985a758b3724ac35e /kdesktop/lockeng.cc
parentb82e4034156bf3c1d268aecc65a50e6569ecf2ee (diff)
downloadtdebase-ff7322912780843dfb3bce1d720452aeed89592e.tar.gz
tdebase-ff7322912780843dfb3bce1d720452aeed89592e.zip
Add secure desktop area dialog to kdebase
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1253853 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdesktop/lockeng.cc')
-rw-r--r--kdesktop/lockeng.cc44
1 files changed, 43 insertions, 1 deletions
diff --git a/kdesktop/lockeng.cc b/kdesktop/lockeng.cc
index af1207755..49be555f3 100644
--- a/kdesktop/lockeng.cc
+++ b/kdesktop/lockeng.cc
@@ -16,6 +16,7 @@
#include <kdebug.h>
#include <klocale.h>
#include <tqfile.h>
+#include <tqtimer.h>
#include <dcopclient.h>
#include <assert.h>
@@ -26,6 +27,7 @@
#include "xautolock_c.h"
extern xautolock_corner_t xautolock_corners[ 4 ];
+bool trinity_lockeng_sak_available = TRUE;
//===========================================================================
//
@@ -36,7 +38,8 @@ extern xautolock_corner_t xautolock_corners[ 4 ];
SaverEngine::SaverEngine()
: KScreensaverIface(),
TQWidget(),
- mBlankOnly(false)
+ mBlankOnly(false),
+ mSAKProcess(NULL)
{
// Save X screensaver parameters
XGetScreenSaver(qt_xdisplay(), &mXTimeout, &mXInterval,
@@ -49,6 +52,12 @@ SaverEngine::SaverEngine()
connect(&mLockProcess, TQT_SIGNAL(processExited(KProcess *)),
TQT_SLOT(lockProcessExited()));
+ mSAKProcess = new KProcess;
+ *mSAKProcess << "kdmtsak";
+ connect(mSAKProcess, TQT_SIGNAL(processExited(KProcess*)), this, TQT_SLOT(slotSAKProcessExited()));
+
+ TQTimer::singleShot( 0, this, TQT_SLOT(handleSecureDialog()) );
+
configure();
}
@@ -190,6 +199,36 @@ bool SaverEngine::isBlanked()
}
//---------------------------------------------------------------------------
+void SaverEngine::handleSecureDialog()
+{
+ // Wait for SAK press
+ mSAKProcess->start();
+}
+
+void SaverEngine::slotSAKProcessExited()
+{
+ int retcode = mSAKProcess->exitStatus();
+ if (retcode != 0) trinity_lockeng_sak_available = FALSE;
+
+ if (trinity_lockeng_sak_available == TRUE) {
+ bool ok = true;
+ if (mState == Waiting)
+ {
+ ok = startLockProcess( SecureDialog );
+ if( ok && mState != Saving )
+ {
+ }
+ }
+ else
+ {
+ mLockProcess.kill( SIGHUP );
+ }
+
+ TQTimer::singleShot( 0, this, TQT_SLOT(handleSecureDialog()) );
+ }
+}
+
+//---------------------------------------------------------------------------
//
// Read and apply configuration.
//
@@ -263,6 +302,9 @@ bool SaverEngine::startLockProcess( LockType lock_type )
case DontLock:
mLockProcess << TQString( "--dontlock" );
break;
+ case SecureDialog:
+ mLockProcess << TQString( "--securedialog" );
+ break;
default:
break;
}