Honor per-user lock screen SAK setting

This resolves Bug 811
Clean up screen saver settings display to more accurately reflect the current configuration
(cherry picked from commit 091b1eface)
v3.5.13-sru
Timothy Pearson 12 years ago committed by Slávek Banko
parent 06f7b3b478
commit eb1b42efff

@ -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 "/kdm/kdmdistrc" , &st ) == 0) { \
mTDMConfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/kdm/kdmdistrc" )); \
} \
else { \
mTDMConfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/kdm/kdmrc" )); \
} \
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-KDE path
KGlobal::dirs()->addResourceType("scrsav",
KGlobal::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);

@ -121,6 +121,8 @@ protected:
bool mUseTSAK;
bool mUseUnmanagedLockWindows;
bool mHideActiveWindowsFromSaver;
KSimpleConfig* mTDMConfig;
};
#endif

@ -332,6 +332,13 @@
<!-- /home/paco/cvsroot/kdebase/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/kdebase/kdesktop/lock/lockprocess.cc:336 -->
<!-- mSaver = config.readEntry("UseTDESAK"); -->
</entry>
<entry key="PluginsUnlock" type="StringList">
<default></default>
<label></label>

@ -295,11 +295,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
@ -364,7 +360,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

Loading…
Cancel
Save