summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-04-06 15:10:56 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-04-06 15:10:56 -0500
commit091b1eface0a6172927a481c8d7e4030f3d2d0b9 (patch)
tree96e1d92104f359027f1546049e9098e90755a270
parent67fdaf7041a47e442bc96b21a108931745180d71 (diff)
downloadtdebase-091b1eface0a6172927a481c8d7e4030f3d2d0b9.tar.gz
tdebase-091b1eface0a6172927a481c8d7e4030f3d2d0b9.zip
Honor per-user lock screen SAK setting
This resolves Bug 811 Clean up screen saver settings display to more accurately reflect the current configuration
-rw-r--r--kcontrol/screensaver/scrnsave.cpp51
-rw-r--r--kcontrol/screensaver/scrnsave.h2
-rw-r--r--kdesktop/kdesktop.kcfg7
-rw-r--r--kdesktop/lock/main.cc8
4 files changed, 55 insertions, 13 deletions
diff --git a/kcontrol/screensaver/scrnsave.cpp b/kcontrol/screensaver/scrnsave.cpp
index f58dd3815..776c8e43a 100644
--- a/kcontrol/screensaver/scrnsave.cpp
+++ b/kcontrol/screensaver/scrnsave.cpp
@@ -16,6 +16,7 @@
#include <sys/types.h>
#include <sys/wait.h>
+#include <sys/stat.h>
#include <tqbuttongroup.h>
#include <tqcheckbox.h>
@@ -41,6 +42,7 @@
#include <kprocess.h>
#include <kservicegroup.h>
#include <kstandarddirs.h>
+#include <ksimpleconfig.h>
#include <X11/Xlib.h>
@@ -48,6 +50,15 @@
#include <fixx11h.h>
+#define OPEN_TDMCONFIG_AND_SET_GROUP \
+if( stat( KDE_CONFDIR "/tdm/tdmdistrc" , &st ) == 0) { \
+ mTDMConfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/tdm/tdmdistrc" )); \
+} \
+else { \
+ mTDMConfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/tdm/tdmrc" )); \
+} \
+mTDMConfig->setGroup("X-*-Greeter");
+
template class TQPtrList<SaverConfig>;
const uint widgetEventMask = // X event mask
@@ -81,6 +92,9 @@ KScreenSaver::KScreenSaver(TQWidget *parent, const char *name, const TQStringLis
mMonitor = 0;
mTesting = false;
+ struct stat st;
+ OPEN_TDMCONFIG_AND_SET_GROUP
+
// Add non-TDE path
TDEGlobal::dirs()->addResourceType("scrsav",
TDEGlobal::dirs()->kde_default("apps") +
@@ -354,6 +368,8 @@ KScreenSaver::~KScreenSaver()
delete mTestProc;
delete mSetupProc;
delete mTestWin;
+
+ delete mTDMConfig;
}
//---------------------------------------------------------------------------
@@ -655,9 +671,30 @@ void KScreenSaver::processLockouts()
mActivateLbl->setEnabled( mEnabled );
mWaitEdit->setEnabled( mEnabled );
mLockCheckBox->setEnabled( mEnabled );
- mDelaySaverStartCheckBox->setEnabled( mEnabled && !mUseUnmanagedLockWindows );
- mUseTSAKCheckBox->setEnabled( !mUseUnmanagedLockWindows );
- mHideActiveWindowsFromSaverCheckBox->setEnabled( !mUseUnmanagedLockWindows );
+ if (mEnabled && !mUseUnmanagedLockWindows) {
+ mDelaySaverStartCheckBox->setEnabled( true );
+ mDelaySaverStartCheckBox->setChecked( mDelaySaverStart );
+ }
+ else {
+ mDelaySaverStartCheckBox->setEnabled( false );
+ mDelaySaverStartCheckBox->setChecked( false );
+ }
+ if (!mUseUnmanagedLockWindows && mTDMConfig->readBoolEntry("UseSAK", true)) {
+ mUseTSAKCheckBox->setEnabled( true );
+ mUseTSAKCheckBox->setChecked( mUseTSAK );
+ }
+ else {
+ mUseTSAKCheckBox->setEnabled( false );
+ mUseTSAKCheckBox->setChecked( false );
+ }
+ if (!mUseUnmanagedLockWindows) {
+ mHideActiveWindowsFromSaverCheckBox->setEnabled( true );
+ mHideActiveWindowsFromSaverCheckBox->setChecked( mHideActiveWindowsFromSaver );
+ }
+ else {
+ mHideActiveWindowsFromSaverCheckBox->setEnabled( false );
+ mHideActiveWindowsFromSaverCheckBox->setChecked( false );
+ }
mLockLbl->setEnabled( mEnabled && mLock );
mWaitLockEdit->setEnabled( mEnabled && mLock );
}
@@ -885,7 +922,7 @@ void KScreenSaver::slotLock( bool l )
//
void KScreenSaver::slotDelaySaverStart( bool d )
{
- mDelaySaverStart = d;
+ if (mDelaySaverStartCheckBox->isEnabled()) mDelaySaverStart = d;
processLockouts();
mChanged = true;
emit changed(true);
@@ -895,7 +932,7 @@ void KScreenSaver::slotDelaySaverStart( bool d )
//
void KScreenSaver::slotUseTSAK( bool u )
{
- mUseTSAK = u;
+ if (mUseTSAKCheckBox->isEnabled()) mUseTSAK = u;
processLockouts();
mChanged = true;
emit changed(true);
@@ -905,7 +942,7 @@ void KScreenSaver::slotUseTSAK( bool u )
//
void KScreenSaver::slotUseUnmanagedLockWindows( bool u )
{
- mUseUnmanagedLockWindows = u;
+ if (mUseUnmanagedLockWindowsCheckBox->isEnabled()) mUseUnmanagedLockWindows = u;
processLockouts();
mChanged = true;
emit changed(true);
@@ -915,7 +952,7 @@ void KScreenSaver::slotUseUnmanagedLockWindows( bool u )
//
void KScreenSaver::slotHideActiveWindowsFromSaver( bool h )
{
- mHideActiveWindowsFromSaver = h;
+ if (mHideActiveWindowsFromSaverCheckBox->isEnabled()) mHideActiveWindowsFromSaver = h;
processLockouts();
mChanged = true;
emit changed(true);
diff --git a/kcontrol/screensaver/scrnsave.h b/kcontrol/screensaver/scrnsave.h
index f9d074ed5..a8f6e53b0 100644
--- a/kcontrol/screensaver/scrnsave.h
+++ b/kcontrol/screensaver/scrnsave.h
@@ -121,6 +121,8 @@ protected:
bool mUseTSAK;
bool mUseUnmanagedLockWindows;
bool mHideActiveWindowsFromSaver;
+
+ KSimpleConfig* mTDMConfig;
};
#endif
diff --git a/kdesktop/kdesktop.kcfg b/kdesktop/kdesktop.kcfg
index bbb495989..2895db99d 100644
--- a/kdesktop/kdesktop.kcfg
+++ b/kdesktop/kdesktop.kcfg
@@ -332,6 +332,13 @@
<!-- /home/paco/cvsroot/tdebase/kdesktop/lock/lockprocess.cc:336 -->
<!-- mSaver = config.readEntry("HideActiveWindowsFromSaver"); -->
</entry>
+ <entry key="UseTDESAK" type="Bool">
+ <default>true</default>
+ <label></label>
+ <whatsthis>When enabled, the Trinity Secure Attention Key (TSAK) system will be used to secure the screen locker. This requires system wide TSAK support to be enabled prior to use.</whatsthis>
+ <!-- /home/paco/cvsroot/tdebase/kdesktop/lock/lockprocess.cc:336 -->
+ <!-- mSaver = config.readEntry("UseTDESAK"); -->
+ </entry>
<entry key="PluginsUnlock" type="StringList">
<default></default>
<label></label>
diff --git a/kdesktop/lock/main.cc b/kdesktop/lock/main.cc
index c2a6c753a..0659217a0 100644
--- a/kdesktop/lock/main.cc
+++ b/kdesktop/lock/main.cc
@@ -321,11 +321,7 @@ int main( int argc, char **argv )
struct stat st;
KSimpleConfig* tdmconfig;
OPEN_TDMCONFIG_AND_SET_GROUP
-#ifdef BUILD_TSAK
- trinity_desktop_lock_use_sak = tdmconfig->readBoolEntry("UseSAK", true);
-#else
- trinity_desktop_lock_use_sak = false;
-#endif
+
LockProcess process;
// Start loading core functions, such as the desktop wallpaper interface
@@ -390,7 +386,7 @@ int main( int argc, char **argv )
trinity_desktop_lock_delay_screensaver_start = KDesktopSettings::delaySaverStart();
if (trinity_desktop_lock_use_system_modal_dialogs) {
#ifdef BUILD_TSAK
- trinity_desktop_lock_use_sak = tdmconfig->readBoolEntry("UseSAK", true);
+ trinity_desktop_lock_use_sak = tdmconfig->readBoolEntry("UseSAK", true) && KDesktopSettings::useTDESAK();
#else
trinity_desktop_lock_use_sak = false;
#endif