@ -162,20 +162,16 @@ KScreenSaver::KScreenSaver(TQWidget *parent, const char *name, const TQStringLis
mSettingsGroup = new TQGroupBox ( i18n ( " Settings " ) , this ) ;
mSettingsGroup = new TQGroupBox ( i18n ( " Settings " ) , this ) ;
mSettingsGroup - > setColumnLayout ( 0 , Qt : : Vertical ) ;
mSettingsGroup - > setColumnLayout ( 0 , Qt : : Vertical ) ;
leftColumnLayout - > addWidget ( mSettingsGroup ) ;
leftColumnLayout - > addWidget ( mSettingsGroup ) ;
groupLayout = new TQVBoxLayout ( mSettingsGroup - > layout ( ) ,
TQGridLayout * settingsGroupLayout = new TQGridLayout ( mSettingsGroup - > layout ( ) , 4 , 2 , KDialog : : spacingHint ( ) ) ;
KDialog : : spacingHint ( ) ) ;
mEnabledCheckBox = new TQCheckBox ( i18n (
mEnabledCheckBox = new TQCheckBox ( i18n ( " Start a&utomatically " ) , mSettingsGroup ) ;
" Start a&utomatically " ) , mSettingsGroup ) ;
mEnabledCheckBox - > setChecked ( mEnabled ) ;
mEnabledCheckBox - > setChecked ( mEnabled ) ;
TQWhatsThis : : add ( mEnabledCheckBox , i18n (
TQWhatsThis : : add ( mEnabledCheckBox , i18n ( " Automatically start the screen saver after a period of inactivity. " ) ) ;
" Automatically start the screen saver after a period of inactivity. " ) ) ;
connect ( mEnabledCheckBox , TQT_SIGNAL ( toggled ( bool ) ) , this , TQT_SLOT ( slotEnable ( bool ) ) ) ;
connect ( mEnabledCheckBox , TQT_SIGNAL ( toggled ( bool ) ) ,
settingsGroupLayout - > addWidget ( mEnabledCheckBox , 0 , 0 ) ;
this , TQT_SLOT ( slotEnable ( bool ) ) ) ;
groupLayout - > addWidget ( mEnabledCheckBox ) ;
TQBoxLayout * hbox = new TQHBoxLayout ( ) ;
TQBoxLayout * hbox = new TQHBoxLayout ( ) ;
groupLayout- > addLayout ( hbox ) ;
settin gsG roupLayout- > addLayout ( hbox , 1 , 0 ) ;
hbox - > addSpacing ( 30 ) ;
hbox - > addSpacing ( 30 ) ;
mActivateLbl = new TQLabel ( i18n ( " After: " ) , mSettingsGroup ) ;
mActivateLbl = new TQLabel ( i18n ( " After: " ) , mSettingsGroup ) ;
mActivateLbl - > setEnabled ( mEnabled ) ;
mActivateLbl - > setEnabled ( mEnabled ) ;
@ -191,29 +187,23 @@ KScreenSaver::KScreenSaver(TQWidget *parent, const char *name, const TQStringLis
mActivateLbl - > setBuddy ( mWaitEdit ) ;
mActivateLbl - > setBuddy ( mWaitEdit ) ;
hbox - > addWidget ( mWaitEdit ) ;
hbox - > addWidget ( mWaitEdit ) ;
hbox - > addStretch ( 1 ) ;
hbox - > addStretch ( 1 ) ;
TQString wtstr = i18n (
TQString wtstr = i18n ( " The period of inactivity after which the screen saver should start. " ) ;
" The period of inactivity "
" after which the screen saver should start. " ) ;
TQWhatsThis : : add ( mActivateLbl , wtstr ) ;
TQWhatsThis : : add ( mActivateLbl , wtstr ) ;
TQWhatsThis : : add ( mWaitEdit , wtstr ) ;
TQWhatsThis : : add ( mWaitEdit , wtstr ) ;
mLockCheckBox = new TQCheckBox ( i18n (
mLockCheckBox = new TQCheckBox ( i18n ( " &Require password to stop " ) , mSettingsGroup ) ;
" &Require password to stop " ) , mSettingsGroup ) ;
mLockCheckBox - > setEnabled ( mEnabled ) ;
mLockCheckBox - > setEnabled ( mEnabled ) ;
mLockCheckBox - > setChecked ( mLock ) ;
mLockCheckBox - > setChecked ( mLock ) ;
connect ( mLockCheckBox , TQT_SIGNAL ( toggled ( bool ) ) ,
connect ( mLockCheckBox , TQT_SIGNAL ( toggled ( bool ) ) , this , TQT_SLOT ( slotLock ( bool ) ) ) ;
this , TQT_SLOT ( slotLock ( bool ) ) ) ;
settingsGroupLayout - > addWidget ( mLockCheckBox , 2 , 0 ) ;
groupLayout - > addWidget ( mLockCheckBox ) ;
TQWhatsThis : : add ( mLockCheckBox , i18n ( " Prevent potential unauthorized use by requiring a password to stop the screen saver. " ) ) ;
TQWhatsThis : : add ( mLockCheckBox , i18n (
" Prevent potential unauthorized use by requiring a password "
" to stop the screen saver. " ) ) ;
hbox = new TQHBoxLayout ( ) ;
hbox = new TQHBoxLayout ( ) ;
groupLayout- > addLayout ( hbox ) ;
settingsGroupLayout - > addLayout ( hbox , 3 , 0 ) ;
hbox - > addSpacing ( 30 ) ;
hbox - > addSpacing ( 30 ) ;
mLockLbl = new TQLabel ( i18n ( " After: " ) , mSettingsGroup ) ;
mLockLbl = new TQLabel ( i18n ( " After: " ) , mSettingsGroup ) ;
mLockLbl - > setEnabled ( mEnabled & & mLock ) ;
mLockLbl - > setEnabled ( mEnabled & & mLock ) ;
TQWhatsThis : : add ( mLockLbl , i18n (
TQWhatsThis : : add ( mLockLbl , i18n ( " The amount of time, after the screen saver has started, to ask for the unlock password. " ) ) ;
" The amount of time, after the screen saver has started, to ask for the unlock password. " ) ) ;
hbox - > addWidget ( mLockLbl ) ;
hbox - > addWidget ( mLockLbl ) ;
mWaitLockEdit = new TQSpinBox ( mSettingsGroup ) ;
mWaitLockEdit = new TQSpinBox ( mSettingsGroup ) ;
mWaitLockEdit - > setSteps ( 1 , 10 ) ;
mWaitLockEdit - > setSteps ( 1 , 10 ) ;
@ -230,25 +220,48 @@ KScreenSaver::KScreenSaver(TQWidget *parent, const char *name, const TQStringLis
mWaitEdit - > setFixedWidth ( mWaitLockEdit - > sizeHint ( ) . width ( ) ) ;
mWaitEdit - > setFixedWidth ( mWaitLockEdit - > sizeHint ( ) . width ( ) ) ;
mWaitLockEdit - > setFixedWidth ( mWaitLockEdit - > sizeHint ( ) . width ( ) ) ;
mWaitLockEdit - > setFixedWidth ( mWaitLockEdit - > sizeHint ( ) . width ( ) ) ;
}
}
connect ( mWaitLockEdit , TQT_SIGNAL ( valueChanged ( int ) ) ,
connect ( mWaitLockEdit , TQT_SIGNAL ( valueChanged ( int ) ) , this , TQT_SLOT ( slotLockTimeoutChanged ( int ) ) ) ;
this , TQT_SLOT ( slotLockTimeoutChanged ( int ) ) ) ;
mLockLbl - > setBuddy ( mWaitLockEdit ) ;
mLockLbl - > setBuddy ( mWaitLockEdit ) ;
hbox - > addWidget ( mWaitLockEdit ) ;
hbox - > addWidget ( mWaitLockEdit ) ;
hbox - > addStretch ( 1 ) ;
hbox - > addStretch ( 1 ) ;
TQString wltstr = i18n (
TQString wltstr = i18n ( " Choose the period after which the display will be locked. " ) ;
" Choose the period "
" after which the display will be locked. " ) ;
TQWhatsThis : : add ( mLockLbl , wltstr ) ;
TQWhatsThis : : add ( mLockLbl , wltstr ) ;
TQWhatsThis : : add ( mWaitLockEdit , wltstr ) ;
TQWhatsThis : : add ( mWaitLockEdit , wltstr ) ;
mDelaySaverStartCheckBox = new TQCheckBox ( i18n ( " &Delay saver start after lock " ) , mSettingsGroup ) ;
mDelaySaverStartCheckBox - > setEnabled ( true ) ;
mDelaySaverStartCheckBox - > setChecked ( mDelaySaverStart ) ;
connect ( mDelaySaverStartCheckBox , TQT_SIGNAL ( toggled ( bool ) ) , this , TQT_SLOT ( slotDelaySaverStart ( bool ) ) ) ;
settingsGroupLayout - > addWidget ( mDelaySaverStartCheckBox , 0 , 1 ) ;
TQWhatsThis : : add ( mDelaySaverStartCheckBox , i18n ( " When manually locking the screen, wait to start the screen saver until the configured start delay has elapsed. " ) ) ;
mUseTSAKCheckBox = new TQCheckBox ( i18n ( " &Use Secure Attention Key " ) , mSettingsGroup ) ;
mUseTSAKCheckBox - > setEnabled ( true ) ;
mUseTSAKCheckBox - > setChecked ( mUseTSAK ) ;
connect ( mUseTSAKCheckBox , TQT_SIGNAL ( toggled ( bool ) ) , this , TQT_SLOT ( slotUseTSAK ( bool ) ) ) ;
settingsGroupLayout - > addWidget ( mUseTSAKCheckBox , 1 , 1 ) ;
TQWhatsThis : : add ( mUseTSAKCheckBox , i18n ( " Require Secure Attention Key prior to displaying the unlock dialog. " ) ) ;
mUseUnmanagedLockWindowsCheckBox = new TQCheckBox ( i18n ( " Use &legacy lock windows " ) , mSettingsGroup ) ;
mUseUnmanagedLockWindowsCheckBox - > setEnabled ( true ) ;
mUseUnmanagedLockWindowsCheckBox - > setChecked ( mUseUnmanagedLockWindows ) ;
connect ( mUseUnmanagedLockWindowsCheckBox , TQT_SIGNAL ( toggled ( bool ) ) , this , TQT_SLOT ( slotUseUnmanagedLockWindows ( bool ) ) ) ;
settingsGroupLayout - > addWidget ( mUseUnmanagedLockWindowsCheckBox , 2 , 1 ) ;
TQWhatsThis : : add ( mUseUnmanagedLockWindowsCheckBox , i18n ( " Use old-style unmanaged X11 lock windows. " ) ) ;
mHideActiveWindowsFromSaverCheckBox = new TQCheckBox ( i18n ( " &Hide active windows from saver " ) , mSettingsGroup ) ;
mHideActiveWindowsFromSaverCheckBox - > setEnabled ( true ) ;
mHideActiveWindowsFromSaverCheckBox - > setChecked ( mHideActiveWindowsFromSaver ) ;
connect ( mHideActiveWindowsFromSaverCheckBox , TQT_SIGNAL ( toggled ( bool ) ) , this , TQT_SLOT ( slotHideActiveWindowsFromSaver ( bool ) ) ) ;
settingsGroupLayout - > addWidget ( mHideActiveWindowsFromSaverCheckBox , 3 , 1 ) ;
TQWhatsThis : : add ( mHideActiveWindowsFromSaverCheckBox , i18n ( " Hide all active windows from the screen saver and use the desktop background as the screen saver input. " ) ) ;
// right column
// right column
TQBoxLayout * rightColumnLayout =
TQBoxLayout * rightColumnLayout = new TQVBoxLayout ( topLayout , KDialog : : spacingHint ( ) ) ;
new TQVBoxLayout ( topLayout , KDialog : : spacingHint ( ) ) ;
mMonitorLabel = new TQLabel ( this ) ;
mMonitorLabel = new TQLabel ( this ) ;
mMonitorLabel - > setAlignment ( AlignCenter ) ;
mMonitorLabel - > setAlignment ( AlignCenter ) ;
mMonitorLabel - > setPixmap ( TQPixmap ( locate ( " data " ,
mMonitorLabel - > setPixmap ( TQPixmap ( locate ( " data " , " kcontrol/pics/monitor.png " ) ) ) ;
" kcontrol/pics/monitor.png " ) ) ) ;
rightColumnLayout - > addWidget ( mMonitorLabel , 0 ) ;
rightColumnLayout - > addWidget ( mMonitorLabel , 0 ) ;
TQWhatsThis : : add ( mMonitorLabel , i18n ( " A preview of the selected screen saver. " ) ) ;
TQWhatsThis : : add ( mMonitorLabel , i18n ( " A preview of the selected screen saver. " ) ) ;
@ -292,6 +305,8 @@ KScreenSaver::KScreenSaver(TQWidget *parent, const char *name, const TQStringLis
setAboutData ( about ) ;
setAboutData ( about ) ;
mSaverList . setAutoDelete ( true ) ;
mSaverList . setAutoDelete ( true ) ;
processLockouts ( ) ;
}
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
@ -396,6 +411,10 @@ void KScreenSaver::readSettings( bool useDefaults )
mTimeout = config - > readNumEntry ( " Timeout " , 300 ) ;
mTimeout = config - > readNumEntry ( " Timeout " , 300 ) ;
mLockTimeout = config - > readNumEntry ( " LockGrace " , 60000 ) ;
mLockTimeout = config - > readNumEntry ( " LockGrace " , 60000 ) ;
mLock = config - > readBoolEntry ( " Lock " , false ) ;
mLock = config - > readBoolEntry ( " Lock " , false ) ;
mDelaySaverStart = config - > readBoolEntry ( " DelaySaverStart " , true ) ;
mUseTSAK = config - > readBoolEntry ( " UseTDESAK " , true ) ;
mUseUnmanagedLockWindows = config - > readBoolEntry ( " UseUnmanagedLockWindows " , false ) ;
mHideActiveWindowsFromSaver = config - > readBoolEntry ( " HideActiveWindowsFromSaver " , true ) ;
mSaver = config - > readEntry ( " Saver " ) ;
mSaver = config - > readEntry ( " Saver " ) ;
if ( mTimeout < 60 ) mTimeout = 60 ;
if ( mTimeout < 60 ) mTimeout = 60 ;
@ -444,6 +463,10 @@ void KScreenSaver::save()
config - > writeEntry ( " Timeout " , mTimeout ) ;
config - > writeEntry ( " Timeout " , mTimeout ) ;
config - > writeEntry ( " LockGrace " , mLockTimeout ) ;
config - > writeEntry ( " LockGrace " , mLockTimeout ) ;
config - > writeEntry ( " Lock " , mLock ) ;
config - > writeEntry ( " Lock " , mLock ) ;
config - > writeEntry ( " DelaySaverStart " , mDelaySaverStart ) ;
config - > writeEntry ( " UseTDESAK " , mUseTSAK ) ;
config - > writeEntry ( " UseUnmanagedLockWindows " , mUseUnmanagedLockWindows ) ;
config - > writeEntry ( " HideActiveWindowsFromSaver " , mHideActiveWindowsFromSaver ) ;
if ( ! mSaver . isEmpty ( ) )
if ( ! mSaver . isEmpty ( ) )
config - > writeEntry ( " Saver " , mSaver ) ;
config - > writeEntry ( " Saver " , mSaver ) ;
@ -620,15 +643,24 @@ void KScreenSaver::slotPreviewExited(KProcess *)
void KScreenSaver : : slotEnable ( bool e )
void KScreenSaver : : slotEnable ( bool e )
{
{
mEnabled = e ;
mEnabled = e ;
mActivateLbl - > setEnabled ( e ) ;
processLockouts ( ) ;
mWaitEdit - > setEnabled ( e ) ;
mLockCheckBox - > setEnabled ( e ) ;
mLockLbl - > setEnabled ( e & & mLock ) ;
mWaitLockEdit - > setEnabled ( e & & mLock ) ;
mChanged = true ;
mChanged = true ;
emit changed ( true ) ;
emit changed ( true ) ;
}
}
//---------------------------------------------------------------------------
//
void KScreenSaver : : processLockouts ( )
{
mActivateLbl - > setEnabled ( mEnabled ) ;
mWaitEdit - > setEnabled ( mEnabled ) ;
mLockCheckBox - > setEnabled ( mEnabled ) ;
mDelaySaverStartCheckBox - > setEnabled ( mEnabled & & ! mUseUnmanagedLockWindows ) ;
mUseTSAKCheckBox - > setEnabled ( ! mUseUnmanagedLockWindows ) ;
mHideActiveWindowsFromSaverCheckBox - > setEnabled ( ! mUseUnmanagedLockWindows ) ;
mLockLbl - > setEnabled ( mEnabled & & mLock ) ;
mWaitLockEdit - > setEnabled ( mEnabled & & mLock ) ;
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//
//
@ -849,6 +881,46 @@ void KScreenSaver::slotLock( bool l )
emit changed ( true ) ;
emit changed ( true ) ;
}
}
//---------------------------------------------------------------------------
//
void KScreenSaver : : slotDelaySaverStart ( bool d )
{
mDelaySaverStart = d ;
processLockouts ( ) ;
mChanged = true ;
emit changed ( true ) ;
}
//---------------------------------------------------------------------------
//
void KScreenSaver : : slotUseTSAK ( bool u )
{
mUseTSAK = u ;
processLockouts ( ) ;
mChanged = true ;
emit changed ( true ) ;
}
//---------------------------------------------------------------------------
//
void KScreenSaver : : slotUseUnmanagedLockWindows ( bool u )
{
mUseUnmanagedLockWindows = u ;
processLockouts ( ) ;
mChanged = true ;
emit changed ( true ) ;
}
//---------------------------------------------------------------------------
//
void KScreenSaver : : slotHideActiveWindowsFromSaver ( bool h )
{
mHideActiveWindowsFromSaver = h ;
processLockouts ( ) ;
mChanged = true ;
emit changed ( true ) ;
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//
//
void KScreenSaver : : slotSetupDone ( KProcess * )
void KScreenSaver : : slotSetupDone ( KProcess * )